A magnetic polypeptide nanocomposite with pH and near-infrared (NIR) dual responsiveness was developed as a drug carrier for cancer therapy, which was prepared through the self-assembly of Fe3O4 superparamagnetic nanoparticles, poly(aspartic acid) derivative (mPEG-g-PDAEAIM) and doxorubicin (DOX) in water. Fe3O4 nanoparticles were prepared to provide the superparamagnetic core of nanocomposites for tumor targeting via chemical co-precipitation. The protonable imidazole groups of mPEG-g-PDAEAIM with a pKa of ~7 were accountable for the pH-responsiveness of nanocomposites. The photothermal effect of nanocomposites under the irradiation of NIR laser was induced via the interactions between dopamine groups of mPEG-g-PDAEAIM and Fe3O4 superparamagnetic nanoparticles to trigger the drug release. NMR, FT-IR, TEM, hysteresis loop analysis and MRI were utilized to characterize the materials. The DOX loaded nanocomposites exhibited pH-responsive and NIR dependent on/off switchable release profiles. The nanocomposites without drug loading ([email protected]) showed excellent biocompatibility while DOX loaded nanocomposites caused MCF-7 cells’ apoptosis due to the photothermal/chemotherapy combination effects. Overall, the pH and near-infrared dual responsive magnetic nanocomposite had a great potential for cancer therapy.