Searching for highly active oxygen reduction reaction (ORR) and oxygen evolution reaction (OER) catalysts is a challenging task in the development of clean energy devices. Herein, by using the poly[5,10,15,20-tetra(4-ethynyl-phenyl)porphyrin]diyne (TEPPD), we designed ORR and OER catalysts by anchoring 3d transition metal into TEPPD (TM@TEPPD, TM = Mn-Zn). Our study indicated that Fe@TEPPD is the best bifunctional catalyst for both ORR and OER. By proposing a proper descriptor, Ni-N3@TEPPD (Ni is only coordinated with three N atoms) is designed and also predicted to be a promising bifunctional catalyst. For Fe@TEPPD, ORR and OER become inactive when the acetylene bond in TEPPD is broken. The surface Pourbaix diagram indicated that on the surface of Fe@TEPPD, ORR and OER can be carried out at the whole pH region due to the high dissolution potential of Fe2+. For Ni-N3@TEPPD, however, the dissolution potential 0.71 V for Ni2+is low. Thus, for Ni-N3@TEPPD, ORR can be carried out only after pH>2.54, while OER is not likely at the whole pH region. This suggested that the conclusions from the free energy changes at URHE=0 and pH=0 could be different when different potentials and pH values are considered.