First-principles calculations have been performed to study the structural, mechanical and magnetic properties of the MgYCo 4 and MgYNi 4 phases in AuBe 5 -type structure. The obtained values of cohesive energy as well as formation energy prove that the MgYCo 4 and MgYNi 4 phases have a good combination of structural stability and alloying ability, which is also supported by electronic structure. It is found that the magnetic moment of the MgYCo 4 phase is 19.06 l B per unit cell mainly owed to the 3d state of Co atom, and the MgYNi 4 phase exhibits no magnetism. Both the trigonal shear constant C 44 and the shear modulus G of the MgYNi 4 phase are larger than those of the MgYCo 4 phase. Plasticity of alloys has been estimated by the C 11 -C 12 and Young's modulus E, and C 12 -C 44 , shear to bulk modulus ratio G/B and Poisson's ratio m have been studied to predict the ductility of alloys. According to the calculated results, the MgYCo 4 phase has better plasticity as well as ductility, compared with the MgYNi 4 phase.