Ontify
Catalysis of the reaction: ATP + H(2)O + Mg(2+) + protoporphyrin IX = ADP + 2 H(+) + magnesium protoporphyrin IX + phosphate.