It is crucial to use efficient catalysts for oxygen reduction reaction (ORR) and oxygen evolution reaction (OER) in energy conversion devices, aiming to mitigate energy crises. The catalytic activity of MPc-PI-COF-1 and MPc-PI-COF-2 (M = Mn, Fe, Co) towards ORR and OER is investigated systematically based on DFT methods. Different M-N4 sites can adjust the binding strength of oxygen-containing intermediates to effect catalysis activity, while the different linkers have only a minor effect. FePc-PI-COF-1 and MnPc-based COFs have low ORR overpotential (ηORR) values, even lower than Pt(111). For OER, CoPc-based COFs have comparable OER overpotential (ηOER) values to that on RuO2(110). To sum up, MnPc-based COFs are efficient ORR catalysts, and CoPc-based COFs have high OER activity. FePc-PI-COF-1 could be served as an effective bifunctional catalyst with a ηORR value of 0.38 V and ηOER value of 0.56 V. Moreover, FePc-PI-COF-1 exhibits exceptional resistance to various impurity gases, indicating its strong tolerance against poisoning. These study offer valuable insights for the rational discovery of reticular materials as highly efficient electrocatalysts.