Mesoporous carbon nanoparticles in water do not dissolve. Functionalized mesoporous carbon nanoparticles were constructed by modifying the mesoporous carbon nanoparticles with polyethylenimine and folic acid for the targeted chemo-photothermal therapy of cancer cells under near-infrared irradiation.