In this work, we developed a highly selective detector towards the antibiotic drug chloramphenicol (CAP) using Co nanoparticle, which are grown in situ on N‐doped carbon nanotube polyhedra (Co@NCNP), which are obtained by a pyrolysis strategy derived from core‐shell ZIF‐8@ZIF‐67. Physical characterization verified that metal‐organic framework (MOFs)‐derived Co@NCNP nanocomposites present a nanotube structure on their mesoporous polyhedron surface. As a result, the as‐prepared Co@NCNP can be used as a sensitive electrochemical sensor for chloramphenicol detection, and the modified electrode is also studied by electrochemical methods such as electrochemical impedance spectroscopy (EIS), cyclic voltammetry (CV), and differential pulse voltammetry (DPV). When compared with single ZIF‐67‐derived electrode, the Co@NCNP displays a higher electrocatalytic activity in the presence of chloramphenicol. Moreover, an excellent performance with a linear response range of 5–268.83 μM and a low detection limit of 0.5 μM (S/N=3) is observed for the Co@NCNP modified electrode. Finally, the fabricated chloramphenicol sensor achieves a good anti‐interference ability, stability, excellent repeatability, and remarkable reproducibility. The sensor also could be applied in human serum to determine of chloramphenicol with a satisfactory result.