The oxygen electrocatalysis, i.e. the oxygen reduction and evolution reactions, is traditionally executed using noble metal and metal oxide-based nanostructures. However, they are associated with many disadvantages such as high cost, lower durability/selectivity and detrimental environmental effects; this motivates researchers to develop new electroactive materials. In this study, we presented the synthesis of a Co-containing metal–organic framework (Co-MOF) and explored its electrocatalytic application towards the oxygen electrocatalysis (i.e. the oxygen reduction reaction and oxygen evolution reaction). The Co-MOF efficiently catalyzes the ORR with a lower onset (0.85 V vs. RHE)/reduction potential and higher reduction current density by a four-electron reduction path. Moreover, the MOF shows higher durability with >70% performance retention after 25 hours of reaction and tolerance towards methanol; this demonstrates its potential for application in direct methanol fuel cells (DMFCs); furthermore, due to the availability of more active sites and accessible surface area, the Co-MOF performs well towards the OER with lower onset potential and small Tafel slope as compared to the commercial RuO2 nanoparticles. Moreover, it needs only 280 mV overpotential to deliver the state-of-the-art current density of 10 mA cm−2 and robust stability. It shows the high TOF value of 93.21 s−1 at the overpotential of 350 mV as compared to the reported MOF/nanoparticle-based electrocatalysts and the state-of-the-art RuO2. Therefore, we believe that the as-developed Co-MOF holds the potential to be used as both a cathode and an anode electrocatalyst in the future energy storage and conversion systems.