In this report, a bifunctional electrocatalyst: Co nanoparticles attached on N-doped graphitized carbon material (Co@NC) was obtained by utilizing the porous Co(II)-based metal-organic frameworks (MOFs) as precursors under the one-step thermal treatment. The composites were fully analyzed by XRD, XPS, SEM, TEM, and BET and so on. The electrochemical explorations (OER and HER) show that the overpotential of Co@NC-6h-3 at the current density 10 mA cm−2 is the lower the commercial RuO2 catalyst (350 mA for 3; 380 mA for RuO2). The Tafel slopes of the composite material are 63 mV dec−1, which is comparable to the RuO2 (58 mV dec−1). The HER exploration show that the overpotential are 220 mv for 3, and the Tafel slopes of 3 is 119 mV dec−1 for 3. The explorations reveals that the composites Co@NC-6h-3 reveals good and stable catalytic performances for HER and OER, providing us with an efficient method to obtain the electrocatalysts via the pyrolysis of MOFs.