With the rapid development of magnesium alloys in electric industry, the more advanced requirement of decorative property is given. In recent years, Micro-arc oxidation (MAO) technique is the most favorable method in the surface treatment of magnesium alloys. In this paper, green ceramic coating was prepared on the surface of AZ91D magnesium alloy by micro-arc oxidation. The effects of electrolyte concentration, additive content, and reaction time of micro-arc oxidation on the formation of oxide ceramic coating were studied. The results show that the sample has micro-arc oxidation coloring reaction in the electrolyte added with colored salt KCr2O7 whose concentration is 1.2g/L. When the concentration of main salt Na2SiO3 is 13g/L, the concentration of KF is 12g/L, the concentration of additive sodium citrate is 1.0 g/L, and the reaction time of micro-arc oxidation is 20 minutes, smooth and dense ceramic layer of yellowish green oxide film can be generated.