In this research, g-C3N4/Cu@CoO/NC, which contained graphitic phase carbon nitride (g-C3N4) with a binary nanostructure and Cu@CoO/NC with a bimetallic MOF precursor, was constructed by a low-temperature pyrolysis process. The g-C3N4/Cu@CoO/NC was characterised by several techniques, including X-ray diffraction, scanning electron microscope, transmission electron microscope and X-ray photoelectron spectroscopy. Further, it was used to prepare an electrochemical sensor for the detection of ractopamine (RAC) in meat samples. The sensor showed excellent electrochemical oxidation characteristics for RAC detection, with a wide linear range (0.005 μmol/L to 32.73 μmol/L) and low detection limit (1.53 nmol/L). Meanwhile, the reproducibility, stability and interference of the g-C3N4/Cu@CoO/NC/GCE sensor were found to be excellent. Besides, the g-C3N4/Cu@CoO/NC/GCE sensor was well-used for the detection of RAC in pork, pig liver and lamb samples with recovery rates ranging from 96.5 % to 102.2 %.