This work presents a heterojunction-mediated photoelectrochemical (PEC) biointerface for selective detection of microcystin-LR (MC-LR) by introducing a direct Z-scheme heterojunction as efficient visible-light-driven photoactive species. Specifically, the Z-scheme type CdTe-Bi2S3 heterojunction was designed and synthesized as an ideal photoactive material, which exhibited higher PEC activity as compared with either CdTe quantum dots or Bi2S3 nanorods due to the improved photogenerated charges separation efficiency of heterojunction. Then the MC-LR aptamer was employed for selective recognition of MC-LR target, which was immobilized on the CdTe-Bi2S3 film by the formation of phosphor-amidate bonds between the phosphate group of aptamer and amino group of the chitosan film on the electrode. The proposed aptasensor showed a photocurrent signal due to the photoactive CdTe-Bi2S3 heterojunction, while the presence of MC-LR resulted in a dose-responsive decrease in PEC response, which allowed the quantification analysis of MC-LR by measuring the photocurrent signal of the fabricated aptasensor. Under optimal conditions, the resulted PEC aptasensor showed wide linear range (0.01-100 pM) and low detection limit (0.005 pM) for MC-LR determination with high selectivity and acceptable reproducibility. Finally, the proposed aptasensing method was successfully applied in MC-LR detection in real water samples.