Ab initio calculation of the structural, electronic and optical properties of half-Heusler MgYGa alloy are reported using the FP-LAPW approach of the Density Functional Theory. Generalized Gradient Approximation was used as the exchange and correlation potential for investigating these properties. Structural properties of MgYGa alloy, such as the lattice constants, bulk modulus and pressure derivative of the bulk module have been studied. Electronic properties were investigated by calculating and analyzing the electronic band structure, partial and total density of states graphs for the MgYGa compound. We have found that MgYGa compound has a metallic character. The investigation of optical properties indicates a great interaction between the compound and the incident light.