In your equation, the oxidation state of Mg on the left is 0 because all elements in their normal condition have oxidation numbers of 0. On the right side, in MgCl2, you have an Mg2+ ion, and so it has an oxidation number of +2. So, Mg has been oxidized.

On the left side, the H in HCl has an oxidation number of +1, and on the right the H in H2 has an oxidation number of 0. So, H has been reduced. Therefore, H+ is the oxidant.