It has been indicated the critical transition temperature (Tc) of MgB2 decreases with the increase of hydrostatic pressure, but this is a comprehensive Tc change after the multiaxial strain, and the influence of strain on Tc is not fully understood. In this paper, based on the McMillan superconducting calculation formula and the first-principles density functional theory, the Tc change and the properties of MgB2 such as energy band, Fermi surface, differential charge density, and phonon dispersion under uniaxial strain were studied, and the relationship between uniaxial strain and these properties was analyzed. The calculated Tc of MgB2 at zero strain was 38.35 K, which is in good agreement with the experimental value of 39 K. When the a-axis strain was 1%, the Tc value could increase to 49.7 K, and there was a further improvement trend. When the a-axis compression strain was −1%, Tc decreases to 31.52 K. When the c-axis tension–compression strain was applied, the change of Tc value was small. Further analysis showed that the impact of a-axis strain on the differential charge density, electronic band structure, phonon dispersion, and other properties of MgB2 was significantly greater than that of c-axis strain, and the influence of these properties on Tc was discussed. The work in this paper has certain theoretical and guiding significance for preparing MgB2 with higher Tc and the study of the effect of uniaxial strain on Tc of superconducting materials.