A versatile low-temperature molten salt approach has been developed for fabricating a MoS2@CoS2 heterostructure electrocatalyst, where low-cost molten KSCN serves as both the reaction medium and sulfur source. The as-obtained electrocatalyst with a defect-rich structure is highly efficient for the hydrogen evolution reaction (HER), delivering a low overpotential of 96 mV at an HER current density of 10 mA cm-2, a small Tafel slope of 60 mV dec-1, and outstanding durability. Density functional theory (DFT) calculations suggest that the heterostructures present an optimized Gibbs free energy of hydrogen adsorption (ΔGH*) close to zero, which is responsible for the excellent HER performance.