Reinforcing cement with nanoparticles is a way to reduce porosity and enhance the initial strength of cement. In this work, the calcium phosphate cement is reinforced with magnesium ion nanoparticles using the molecular dynamics simulation method. This work investigates the mechanical and thermal properties of simulated samples. In this approach, the ultimate strength, Young's modulus, and thermal stability are studied. The effects of different initial temperature values and pressures will be researched next. As the initial temperature increased from 300 to 400 K, the ultimate strength and Young's modulus decreased from 0.879 and 0.171 MPa to 0.843 and 0.154 MPa. Also, the thermal stability reduced from 1321 to 1294 K. This material has more strength at lower than higher temperatures. With increasing temperature, the materials become softer and lose their strength. As the initial temperature in the atomic samples increases, the mobility intensifies, and as a result, the stability of the structures decreases. Increasing the initial pressure from 1 to 5 bar, the ultimate strength and Young's modulus enhanced from 0.879 and 0.171 MPa to 0.889 and 0.178 MPa. Also, the thermal stability increased from 1321 K to 1371 K by increasing the initial pressure to 5 bar. As the pressure increases, the amplitude of the particle oscillation decreases. The nanoparticle-reinforced cement matrix shows more appropriate behavior in high-pressure environments. It is expected that the addition of Mg nanoparticles will increase the strength of calcium phosphate cement and be used for use in bone lesions.