In this work, Co-based metal-organic framework (ZIF-67) coupled polyimide (ZIF-67/PI) film was fastly and effectively transformed into flexible Co nanoparticles modified 3D N-doped porous carbon (Co@3D NPC) electrode device using simple laser ablation technique at room temperature. Compared with 3D NPC electrode device that derived from pure polyimide film, Co@3D NPC exhibited significantly enhanced electron transfer ability, physical adsorption ability and electrochemically active surface area. By adjusting the laser power and ZIF-67 concentration, the surface morphology and electrochemical property of the Co@3D NPC electrode devices can be easily controlled. Furthermore, the fabricated flexible Co@/3D NPC electrode device exhibited exceptional electrochemical activity for the sensitive detection of clozapine and albendazole, two kinds of common veterinary drug and pesticide. The detection sensitivity of Co@/3D NPC electrode device reached to 410.47 μA μM−1 cm−2 and 580.33 μA μM−1 cm−2, with detection limits as low as 2.8 nM and 2.5 nM for clozapine and albendazole, respectively. Besides, the Co@/3D NPC electrode device demonstrated excellent stability and accuracy. Given the advantages of laser ablation technology, including its low cost, scalability, and high stability, the reported Co@/3D NPC electrode device holds significant potential for practical applications in the field of electrochemical analysis.