Hollow mesoporous silica nanoparticles (HMSs) were modified by β-cyclodextrin via a “click” reaction, an amphiphilic copolymer with a trans-azobenzene structure was then assembled onto β-cyclodextrin to cover the surface of the HMSs. The prepared nanocomposites can release drugs in a “release-stop-release” manner by converting light irradiation.