In order to study the effects of recycled aggregate with different particle gradations and different contents on the mechanical properties of cement soil modified by nano-MgO, unconfined compressive strength and scanning electron microscope (SEM) tests were carried out. The cement content was fixed at 15% and the nano-MgO content was 1.5%. The effects of two ages, three recycled aggregate contents, and three recycled aggregate particle gradations were considered. The test results show that the unconfined compressive strength of natural graded (RA), recycled coarse aggregate (SRA), and recycled fine aggregate (TRA) reached the maximum when the content of recycled aggregate was 20%, and the unconfined compressive strength of SRA was higher than that of TRA and RA. The residual strength of RA and SRA samples first increased and then decreased with the increase in recycled aggregate content, and the residual strength of TRA samples increased gradually with the increase in recycled aggregate content. The variation law of peak strain and peak strength of the three particle graded samples was consistent, and the variation law of brittle failure degree was highly consistent with that of residual strength. When the recycled aggregate content of RA, SRA, and TRA samples was 20%, the deformation resistance and stiffness of the samples were the best. In addition, SRA samples showed the best deformation resistance, followed by TRA samples and, finally, RA samples. The smaller the porosity of the sample, the tighter the sample structure and the stronger the bearing capacity of SRA. The unconfined compressive strength of the WPRA sample was represented by an exponentially negative power function of the porosity.