β-Cyclodextrins (β-CDs) were grafted onto star-shaped poly(glycidyl methacrylate)s (S5-PGMAs) with a straightforward and efficient ring-opening addition of amine groups to result in PGMA–CDs, which not only possess good water-solubility and biocompatibility, but also can serve as polymeric supramolecular hosts to form inclusion complexes with suitable guests. They can be easily assembled on the surface of azobenzene-functionalized mesoporous silica nanoparticles (MSNs) via host–guest interactions to obtain MSN@PGMA–CD hybrid nanoparticles, which have been fully characterized by Fourier transform infrared (FT-IR) spectroscopy, thermogravimetric analysis (TGA), transmission electron microscopy (TEM) and elemental analysis. The experimental results showed that these types of inorganic–organic hybrid mesoporous nanocomposites possess good cargo encapsulation and release properties, as compared with the simple supramolecular nanovalves with β-CD itself as the gating component, upon activation by light, temperature variation, and competitive binding agents. In addition, the extremely low cytotoxicity of the nanocomposites demonstrated by MTT assay can further broaden their applications in controlled drug release.