Graphical Abstract

The homeostasis of ascorbic acid (AA) plays vital roles in the brain, which relies on in vivo real-time concentration monitoring to uncover its correlation to neurological functions and diseases. Electrochemical sensing with carbon fiber electrodes (CFEs) offers high spatiotemporal resolution and sensitivity for in vivo sensing of AA but faces challenges such as electrode fouling by oxidation byproducts and interference from coexisting neurochemicals. Here, we report the design of metalloporphyrin-based olefin-conjugated covalent organic frameworks (COFs) that synergize atomically dispersed M-N₄ catalytic sites, hierarchical porosity, and π-conjugated conductivity to enhance AA oxidation kinetics while eliminating interference. We show that nickel porphyrin COFs-modified CFE gains exceptional sensitivity (4.44×10⁻³ μA·μM⁻¹), stability (negligible signal decay over 4000 s), and selectivity in rat brain, enabling real-time tracking of stimulus-evoked AA release during spreading depolarization. This study demonstrates the potential of COFs as a reliable platform for implementing implantable sensing technologies for accurate neurochemical profiling in complex networks.