In this work, a facile solid phase extraction (SPE) method was developed for the analysis of trace Pb2+ and Cd2+ by using chitosan/thiol modified metal–organic frameworks (CS/MOF-SH) composite as adsorbent followed by graphite furnace atomic absorption spectrometer (GF-AAS) detection. The potential influencing factors, such as solution pH, adsorbent dosage, and extraction time, were fully estimated. Under the optimized extraction conditions, the detection limits of Pb2+ and Cd2+ were 0.033 µg L−1 and 0.008 µg L−1, respectively. Compared to other studies, CS/MOF-SH not only possessed superior adsorption performance, but also had the advantages of ease of handling and recyclability. Encouragingly, the developed method was of high accuracy and could monitor trace Pb2+ and Cd2+ in various certified reference materials (rice, wheat and tea) with complicated matrices, demonstrating its practical potential for regular monitoring of trace heavy metal ions in real food samples.