Compared to solid polymers, polymer foams are widely used in civil and industrial applications, including packaging, sports equipment, absorbents, and automotive components. This is due to their superior properties, such as low weight, high strength-to-weight ratio, excellent insulation, thermal stability, impact resistance, toughness, and long fatigue life. This study presents a novel approach to incorporating dimethylhydrogensiloxane into epoxy resin for the fabrication of polymer foams, while systematically investigating the impact of foaming agent addition on the properties of the foams. The experimental results show that the foaming agent induces a reaction between the Si-H bonds in the agent and the N-H bonds in the curing agent, releasing hydrogen gas within the polymer. This reaction also forms stable Si-N bonds in the polymer matrix, significantly improving the thermal stability of the epoxy resin foam. Furthermore, the study examines how varying foaming agent concentrations influence the foam's properties. Specifically, at a foaming agent concentration of 3 wt%, the foam exhibits the highest specific compressive strength of 7.9 MPa/cm2.