Activated carbon (AC) as an electrode for capacitive deionization (CDI) is constrained by its low specific surface area and specific capacitance, leading to electrical double layer overlap (EDL). To address this issue, a flow electrode capacitive deionization system (MDC-FCDI) was developed, which used modified MOFs-derived carbon (MDC) as the electrode. The MDC electrode exhibited enhanced specific capacitance (145.78 F/g) and specific surface area (2458.44 m2/g). Compared to conventional FCDI, the MDC-FCDI system demonstrated a 35–39 % improvement in heavy metal removal efficiency from wastewater containing Pb2+, Cu2+, Cd2+, and Zn2+. The selectivity of MDC-FCDI for heavy metals exhibited a unique “two-step phenomenon” that differed from what was observed in conventional CDI systems. In the MDC-FCDI system, high-valent ions experienced stronger electric field forces and preferentially occupied active sites on the electrode surface prior to the adsorption of ions with lower valence. The selectivity of the MDC-FCDI system for heavy metal ions is determined by three factors in the following order of priority: ionic charge, hydration radius, and ion feed concentration. This study offers a practical approach for expanding the range of MDC-FCDI applications.