Herein, a portable photoelectrochemical (PEC) in-vitro diagnostic platform for the ultrasensitive detection of alpha-fetoprotein (AFP) based on the cadmium sulfide (g-O-CdS) photoelectrode with graded oxygen doping was constructed. An LED flashlight is used as the light source, and a digital multimeter (DMM) is used as the signal readout device to achieve point-of-care testing (POCT). Due to the spatially graded concentration of oxygen doping, the internal built-in band bending enhanced the separation of photogenerated electron-hole pairs and facilitated photocorrosion from the oxidation of S atoms by the internal holes, and the intensity and stability of the photocurrent increased significantly. Quantitative analysis of AFP was realized by introducing H2O2 (photoanode sacrificial agent) into the detection system through sandwich immunoreaction and the modification of glucose oxidase (GOx) on the detection antibody and using DMM readout for the change of photocurrent signal. Under optimal conditions, the photocurrent was positively correlated with the AFP concentration in the dynamic working range from 0.2 to 100 ng mL−1 with a limit of detection of 74.8 pg mL−1. Such a sensitive, stable, and reliable PEC immunoassay miniaturizes the equipment and eliminates the need for expensive instrumentation, thereby offering a new avenue for the development of user-friendly and low-cost assay protocol for practical utilization in the quantitation of low-abundance analyte.