MgH2 nanoparticles with a size of <3 nm were formed by direct hydrogenation of Bu2Mg inside the pores of a carbon scaffold. The activation energy for the dehydrogenation was lowered by 52 kJ mol−1 compared to the bulk material, and a significantly reduced reaction enthalpy of 63.8 ± 0.5 kJ mol−1 and entropy (117.2 ± 0.8 J mol−1) was found for the nanoconfined system.