The exploitation of efficient earth-abundant electrocatalysts in a wide pH range is crucial for the practical application of the hydrogen evolution reaction (HER); but it still remains challenging. Here we demonstrate novel self-supported hierarchical MoS2/CoS2 nanotube arrays as efficient pH-universal electrocatalysts, where Co metal–organic frameworks (MOFs) are used as a precursor and sacrificial template to form one-dimensional CoS2 nanotubes surrounded by vertically aligned two-dimensional MoS2 nanosheets. Owing to the achievement of a unique hollow architecture with abundant exposed edges and accelerated reaction kinetics, the self-supported MoS2/CoS2 heterostructure exhibits a superior HER catalytic performance with long-term durability in acidic, neutral and alkaline electrolytes. Impressively, it delivers a current density of 10 mA cm−2 at low overpotentials of 90 mV in acidic media and 85 mV in alkaline media and small Tafel slope values of 30 mV dec−1 in acidic media and 34 mV dec−1 in alkaline media, respectively. Our first-principles calculations reveal that the strong interfacial interactions between MoS2 and CoS2 increase the electronic states at S–S edges and dramatically reduce the Gibbs free energy of hydrogen and the energy barrier for water dissociation. Overall, this work offers an exciting avenue for the rational design of hollow heterogeneous catalyst arrays by MOF-engaged interfacial engineering for scalable hydrogen generation.