Magnetic properties of Mg-doped WS2 monolayer under strain are investigated by ab initio methods. Without strain, the Mg-doped WS2 monolayer is a magnetic nano material and the total magnetic moment is about 1.68 μB. We applied strain to Mg-doped WS2 monolayer from −10 to 10%. The system changes from semiconductor to half-metallic material from 3 to 10% strain. The magnetic moment gets a maximum value of 2.07 μB at −3% compressive strain. However, the magnetic moment of system decreases to zero sharply when compressive strain arrived at −5%. The coupling among the 3s states of Mg, 5d states of W, and 3p states of S is responsible for the strong strain effect on the magnetic properties. Our studies predict Mg-doped WS2 monolayer under strain to be candidates for application in spintronics.