The immune response dominated by macrophages plays a pivotal role in the regeneration of bone tissue. In this work, an injectable temperature-responsive hydrogel composed of geniposide-loaded mesoporous bioactive glass, chitosan and β-glycerophosphate (G-M Gel) was prepared, showing robustly networks, uniform pore structure, excellent biocompatibility, immunomodulatory effect and osteogenic potential. In an inflammatory microenvironment elicited by lipopolysaccharide (LPS), the proportion of M1 and M2 macrophages measured by flow cytometry were 33.17 % and 2.07 %, respectively. After G-M Gel treatment, the proportion of M1 macrophages decreased to 14.4 %, while the proportion of M2 macrophages increased significantly to 16.2 %. LPS treated macrophage conditioned medium inhibited the expression of osteogenic related factors (OCN, OPN, Runx2), alkaline phosphatase (ALP) and alizarin red S (ARS) in MC3T3-E1 cells. In contrast, LPS + G-M Gel treated macrophage conditioned medium significantly increased the expression of osteogenic related factors, ALP and ARS. These results demonstrated that G-M Gel can augment bone formation by promoting the polarization of M2 macrophages, showing great potential clinical application of G-M Gel in bone regeneration field.