In this study, we enriched endophytic microorganism A. lwoffii MA1, resulting in Cdcadmium content in spinach from 0.82 to 0.94 mg/kg and microbial reads from 139.77 to 247.82, indicating that endophytic microorganisms affect the Cdcadmium content in spinach. The diversity of soil around spinach roots shows that adding endophytic microbes helps restore soil microbial diversity. We further found the mechanism of endophytic microorganisms to increase Cdcadmium content in spinach through membrane protein adsorption by electron microscopy, ATR-FTIR, affinity chromatography and mass spectrometry. These results provide novel insights into the influence of endophytic microorganisms on Cdcadmium accumulation, offering a promising approach for mitigating Cdcadmium content in spinach and other vegetables.