Glutathione (GSH) plays a vital role in many physiological processes, and its abnormal levels have been found to be associated with several diseases. In contrast to traditional methods using electron donor-containing electrolytes for photoelectrochemical (PEC) sensing, in this study, a target-driven electron donor generation in a PEC electrode was developed to detect GSH. Using well-aligned TiO2 nanotube arrays (TNTs) as the PEC substrate, mesoporous MIL-125(Ti) was grown in the TNTs through an in situ solvothermal method and subsequent two-step annealing treatment. The accommodation capacity of mesoporous MIL-125(Ti) allows a well loading of cystine and Pt nanoclusters (NCs). Taking advantage of the specific cleavage ability of disulfide bonds by GSH, cystine was converted to cysteine, which served as the electron donor for the PEC process. Benefiting from the confinement effect of mesoporous MIL-125(Ti), cysteine was effectively oxidized to cysteine sulfinic acid by the photogenerated holes. Importantly, the highly active Pt NCs decorated in the mesopores not only improved the charge transfer but also accelerated the above oxidation reaction. The synergistic effect of these factors enabled the efficient separation of the photogenerated electron-hole pairs, which induced a significant photocurrent increase and in turn led to the high-sensitivity detection of GSH. Consequently, the proposed PEC biosensor exhibited excellent performance in the detection of GSH in serum specimens. The target-driven electron donor generation designed in this study might open a new route for developing sensitive and selective PEC biosensors with application in complex biological environments.