Magnesium phosphate bone cement (MPC) has gained widespread usage in orthopedic implantation due to its fast‐setting and high initial strength benefits. However, the simultaneous attainment of drug‐controlled release and osteogenic potential in MPC remains a significant challenge. Herein, we proposed a strategy to create a smart injectable cement system using nanocontainers and chondroitin sulfate. It employed nanocontainers containing alendronate‐loaded mesoporous silica nanoparticles, which had been surface‐modified with polypyrrole to control drug release in response to near infrared (NIR) stimulation. The alendronate‐incorporated cement (ACMPC) exhibited improved compressive strength (70.6 ± 5.9 MPa), prolonged setting time (913 s), and exceptional injectability (96.5% of injection rate and 242 s of injection time). It also showed the capability to prevent degradation, thus preserving mechanical properties. Under NIR irradiation, the cement showed good antibacterial properties due to the combined impact of hyperthermia, reactive oxygen species, and alendronate. Furthermore, ACMPC (NIR) group displayed good biocompatibility and osteogenesis capabilities, which also led to an increase in alkaline phosphatase activity, extracellular matrix mineralization, and the upregulation of osteogenic genes. This research has significant implications for developing multifunctional biomaterials and clinical application.This article is protected by copyright. All rights reserved