In this paper, a new environmentally friendly micro‐arc oxidation (MAO) colorant coating was proposed, which greatly improved the corrosion resistance of magnesium alloy. Herein, the black MAO coatings with uniform color and superior performance were successfully prepared on AZ91D alloy to expand the application of magnesium alloy. It was found that the color of the MAO coatings changes from white (80.76) to black (19.92) with the increased concentration of cupric pyrophosphate, attributed to the formation of copper compounds (CuO) in the outer layer of MAO coatings. In addition, electrochemical corrosion tests were also carried out in 3.5 wt% NaCl solution. And it was found that the corrosion potential and current were −1.32 V and 1.06×10−6 A/cm2, respectively, which increased by 0.15 V and decreased by 3.16×10−6 A/cm2 compared to those without cupric pyrophosphate. In conclusion, black MAO coatings produced at a cupric pyrophosphate concentration of 6 g/L, an oxidation time of 17 min, and a termination voltage of 375 V had an excellent performance and superior corrosion resistance. Therefore, it was provided a new idea for the research of surface in‐situ treatment technology with the composite of zirconia salt electrolyte and cupric pyrophosphate.