Methicillin-resistant Staphylococcus aureus (MRSA) has emerged as a frequent cause of purulent skin and soft tissue infections. In this study, a test-to-treat chip was developed as an integrated platform for the highly sensitive detection and treatment of MRSA infections. By integrating arginine (Arg) ligand-doped FeMOFs onto TiO2 nanotube arrays (TNT), the resulting Arg-FeMOF-TNT chips exhibited excellent photoelectrochemical (PEC) activity under visible-light irradiation. As phosphatidylcholine (PC) specific pore-forming toxins (PC-PFTs) secreted by MRSA can specifically generate small holes in the phospholipid membrane (PM), the PM covered Arg-FeMOF-TNT photoactive surface can be re-exposed to the electrolyte in the presence of PC-PFTs and then reacted with electron donors in the electrolyte. On the basis of switch-on PEC signals, a detection limit as low as 6 CFU mL−1 was achieved for MRSA. Furthermore, benefitting from its intrinsic photocatalytic activity, the Fenton-like catalytic activity of FeMOFs, and the loaded Arg on the chip, abundant reactive oxygen species (ROSs) and nitric oxide (NO, arginine decomposition product) were generated in the bacterial microenvironment, resulting in the effective sterilization of MRSA. Importantly, the PM modification endow the chip to process good biosafety and remarkable antibacterial specificity towards MRSA. Animal experiment results further demonstrated that the chip can rapidly kill MRSA in wounds and promote wound healing under 532-nm-laser irradiation. This all-in-one chip offers a new method for the diagnosing bacteria and also provides new insight into the design of test-to-treat platforms for PC-PFTs bacteria.