The functionalization of metal-organic frameworks (MOFs) with organic small molecules by in situ postsynthetic modification has garnered considerable attention. However, the precise engineering of recognition sites using this method remains rarely explored in optically controlled bioelectronics. Herein, employing the Schiff base reaction to embed the small molecule (THBA) into a Zr-MOF, we fabricated a hydroxyl-rich MOF on the surface of titanium dioxide nanorod arrays (U6H@TiO2 NRs) to develop light-sensitive gate electrodes with tailored recognition capabilities. The U6H@TiO2 NR gate electrodes were integrated into organic photoelectrochemical transistor (OPECT) sensing systems to tailor a sensitive device for bilirubin (I-Bil) detection. In the presence of I-Bil, coordination effects, hydrogen bonding, and π-π interactions facilitated strong binding between U6H@TiO2 NRs and the target I-Bil. The electron-donating property of I-Bil influenced the gate voltage, enabling precise control of the channel status and modulation of the channel current. The OPECT device exhibited exceptional analytical performance toward I-Bil with wide linearity ranging from 1 × 10-16 to 1 × 10-9 M and a low limit detection of 0.022 fM. Leveraging the versatility of small molecules for boosting the functionalization of materials, this work demonstrates the great potential of the small molecule family for OPECT bioanalysis and holds promise for the advancement of OPECT sensors.