Diabetic bone defects, exacerbated by hyperglycemia-induced inflammation and oxidative stress, present significant therapeutic challenges. This study introduces a novel injectable scaffold, MgH2@PLGA/F-GM, consisting of foamed gelatin-methacryloyl (GelMA) and magnesium hydride (MgH2) microspheres encapsulated in poly(lactic-co-glycolic acid) (PLGA). This scaffold is uniquely suited for diabetic bone defects, conforming to complex shapes and fostering an environment conducive to tissue regeneration. As it degrades, Mg(OH)2 is released and dissolved by PLGA's acidic byproducts, releasing therapeutic Mg2+ ions. These ions are instrumental in macrophage phenotype modulation, inflammation reduction, and angiogenesis promotion, all vital for diabetic bone healing. Additionally, hydrogen (H2) released during degradation mitigates oxidative stress by diminishing reactive oxygen species (ROS). This multifaceted approach not only reduces ROS and inflammation but also enhances M2 macrophage polarization and cell migration, culminating in improved angiogenesis and bone repair. This scaffold presents an innovative strategy for addressing the complexities of diabetic bone defect treatment.