Metal-free heteroatom-doped porous carbons such as N, P co-doped nanoporous carbon materials with designed properties are attracting increased attention for metal-air battery applications. Herein, we report a general approach to synthesizing highly branched N, P co-doped carbon nanotube cluster (NPCTC) derived from metal-organic frameworks as a bifunctional electrocatalyst. NPCTC were obtained by treating ZIF-8 with butyl methylphosphinate, followed by two-step pyrolysis. Benefiting from the cross-linking polymerization and self-aggregation between ZIF-8 and the monomer, the resulting NPCTC exhibited higher mechanical stability and strength. Although the wall thickness was <5 nm, no obvious shrinkage and collapse were observed after graphitization, thereby maximizing the exposure of the active sites. Studies of oxygen electrocatalysis demonstrate that the NPCTC can deliver outstanding bifunctional performance with a more positive half-wave potential, higher limiting current density for oxygen reduction reaction (ORR) than Pt/C, and lower onset potential for oxygen evolution reaction (OER) than IrO2. Homemade Zn-air battery exhibited stable charge-discharge durability over 180 cycles, with an overpotential increase of only 0.15 V. The improved electrochemical performance was mainly attributed to the synergistic effect of N, P co-doping and the distinct geometry of NPCTC, i.e., three-dimensionally interconnected hollow ultrathin nanotube branches facilitating electron and mass transfer.