In comparison to traditional energy conversion technologies, metal hydrides (MHs) provide a number of benefits, including compactness and safety. There have been recent studies on a wide range of MH applications, including refrigeration, heat pumps, H2 storage, fuel cells, water pumps, and energy storage. The present paper introduces a novel study where a MH reactor coupled with a mechanical hydrogen compressor and a hydrogen gas tank is numerically investigated as a thermal energy storage (TES) system. To assess the effectiveness and performance of the proposed TES system under different operating conditions, such as the H2 gas tank’s volume, heat discharging pressure, and solar field efficiency, a theoretical model and a computational code were developed and successfully validated through comparison with previously published experimental findings. Additionally, a mathematical formula giving the H2 gas tank’s volume for an optimized design of the TES system was suggested. Using the developed computer program, several numerical simulations were carried out, and the obtained findings demonstrated the feasibility and effectiveness of the proposed TES system. For instance, a thermal energy of 2.0 MJ can be stored and reused with 74 % thermal efficiency utilizing 1.0 kg of Mg2Fe alloy and operating conditions of 5 bar dehydriding pressure, 600 K hydriding temperature, 0.09 m3 H2 gas tank’s volume, and solar heat flux with 900 W m−2 maximumradiation. Furthermore, it was found that increasing the volume of the hydrogen gas tank from 0.03 m3 to 0.96 m3 results in 16 % improvement in the thermal efficiency of the TES system.