The phase stability and magnetocrystalline anisotropy (MCA) of tetragonal Mn(Al1−xGax) with the L10-type structure (P4/mmm) has been studied using first-principles density functional calculations. The calculated decomposition energy indicates that partial replacement of Al by Ga suppresses the formation of Mn5(Al,Ga)8 and enhances the thermal stability of the L10 phase while the total magnetic moment per formula unit (f.u.) remains almost unchanged. The site- and atomic-resolved MCA calculations show that the MCA energy (MAE) comes mainly from the Mn atoms, and the total MAE increases from 0.25 meV/f.u. (x = 0) to 0.34 meV/f.u (x = 1). Spin resolved MCA and band structure calculations indicate that the high MCA is mainly due to spin flipping behavior near Fermi level. The derived effective magnetic anisotropy field increases from 37 kOe (x = 0) to 46 kOe (x = 1), in agreement with experiments. Doping with Ga improves the thermal stability of the L10 structure and enhances the magnetic anisotropy field, which facilitates developing high coercivity Mn-Al magnets.