In this study, Ag-CdIn2S4 was selected as a photosensitive material and combined with the zeolite imidazole frame-90 encapsulated methylene blue (ZIF-90@MB) to establish a controlled release system. On that basis, a self-powered photoelectrochemical (PEC) aptasensor was constructed based on target responses to realize the highly sensitive detection of prostate-specific antigen (PSA). The self-powered sensing method was employed to effectively avoid interference from other oxidizing/reducing substances in the system and improve the accuracy of the detection method. The band gap of CdIn2S4 was adjusted by Ag doping, and the visible light absorption capacity and photoelectric conversion efficiency of the material were improved by the local surface plasmon resonance (LSPR) effect of metal Ag. The ZIF-90 porous material was used as a carrier, the MB photosensitizer as a signal molecule was loaded in the ZIF-90 pore channel. The PSA aptamer (PApt) was attached to the ZIF-90@MB surface to form a simple biological gate. In the presence of the PSA, the recognition interaction between PApt and PSA made the biological gate open, then many MB molecules were released from ZIF-90 and enhanced the photocurrent signal. Under the optimal experimental conditions, the linear range of the sensor was 0.005 ∼ 50 ng mL−1, and the detection limit was 2.35 pg mL−1. The accurate determination of PSA in human serum was achieved, which provided a novel sensing strategy for the early diagnosis of clinical biomarkers.