• First application of the in-situ XAFS in the shape-controlled catalyst analysis. • The durability of MEAs is effectively improved by the double-layer structure. • The maximum power density of MEA-Pt-Ni/C is 3.3% higher than MEA-Pt/C. To further promote the commercialization of fuel cells, it is essential to develop high-performance catalysts and apply them to the membrane electrode assembly (MEA). Here, the octahedral Pt-Ni/C is successfully used in MEA by a double-layer structure to obtain a higher performance than commercial Pt/C. The design of double-layer catalyst layer structure effectively hinders the diffusion of non-noble metals and improves the durability of MEA. Meanwhile, the catalytic and failure mechanism in proton-exchange membrane fuel cells (PEMFCs) is also directly reflected by the in-situ X-ray absorption fine structure (XAFS) for the first time. Compared to commercial Pt/C, the addition of Ni can effectively protect Pt by significantly reducing the valence change of Pt. Besides, the variation of coordination number of Pt in the Pt-Ni/C is smaller than that in Pt/C when the potential rises. This proves that the synergistic effect between different metals can improve the stability of Pt and reduce the adsorption capacity of oxygen on the surface of Pt atoms. It can provide a theoretical reference for putting the shape-controlled catalysts into practical application in the future.