MoP/MoNiP@C is synthesized by combining polypyrrole, phosphomolybdate (PMo12) and nickel ions as supramolecular precursors through mutual electrostatic attraction, followed by a one-step high-temperature calcined phosphating process. MoP/MoNiP@C exhibits high HER activity.