MgC3PNH6O3 crystallizes in the trigonal R-3 space group. Mg(1) is bonded to one N(1), two equivalent O(2), and two equivalent O(3) atoms to form MgNO4 square pyramids that share  a cornercorner with one C(2)H2CN tetrahedra,  a cornercorner with one C(3)H2CN tetrahedra,  a cornercorner with one C(1)PH2N tetrahedra, corners with four equivalent P(1)CO3 tetrahedra, and edges with two equivalent Mg(1)NO4 square pyramids. The Mg(1)-N(1) bond length is 2.33 Å. There is one shorter (2.14 Å) and one longer (2.15 Å) Mg(1)-O(2) bond length. There is one shorter (2.06 Å) and one longer (2.23 Å) Mg(1)-O(3) bond length. There are three inequivalent C sites. In the first C site, C(1) is bonded to one P(1), one N(1), one H(1), and one H(6) atom to form distorted CPH2N tetrahedra that share  a cornercorner with one Mg(1)NO4 square pyramid,  a cornercorner with one C(2)H2CN tetrahedra, and  a cornercorner with one C(3)H2CN tetrahedra. The C(1)-P(1) bond length is 1.86 Å. The C(1)-N(1) bond length is 1.51 Å. The C(1)-H(1) bond length is 1.14 Å. The C(1)-H(6) bond length is 1.14 Å. In the second C site, C(2) is bonded to one C(3); one N(1); and two equivalent H(2,3) atoms to form distorted CH2CN tetrahedra that share  a cornercorner with one Mg(1)NO4 square pyramid,  a cornercorner with one C(3)H2CN tetrahedra,  a cornercorner with one C(1)PH2N tetrahedra, and  a cornercorner with one N(1)MgC3 tetrahedra. The C(2)-C(3) bond length is 1.50 Å. The C(2)-N(1) bond length is 1.52 Å. Both C(2)-H(2,3) bond lengths are 1.14 Å. In the third C site, C(3) is bonded to one C(2); one N(1); and two equivalent H(4,5) atoms to form distorted CH2CN tetrahedra that share  a cornercorner with one Mg(1)NO4 square pyramid,  a cornercorner with one C(2)H2CN tetrahedra,  a cornercorner with one C(1)PH2N tetrahedra, and  a cornercorner with one N(1)MgC3 tetrahedra. The C(3)-N(1) bond length is 1.54 Å. Both C(3)-H(4,5) bond lengths are 1.14 Å. P(1) is bonded to one C(1), one O(1), one O(2), and one O(3) atom to form distorted PCO3 tetrahedra that share corners with four equivalent Mg(1)NO4 square pyramids and  a cornercorner with one N(1)MgC3 tetrahedra. The P(1)-O(1) bond length is 1.51 Å. The P(1)-O(2) bond length is 1.52 Å. The P(1)-O(3) bond length is 1.51 Å. N(1) is bonded to one Mg(1), one C(1), one C(2), and one C(3) atom to form NMgC3 tetrahedra that share  a cornercorner with one C(2)H2CN tetrahedra,  a cornercorner with one C(3)H2CN tetrahedra, and  a cornercorner with one P(1)CO3 tetrahedra. There are four inequivalent H sites. In the first H site, H(1) is bonded in a single-bond geometry to one C(1) atom. In the second H site, H(2,3) is bonded in a single-bond geometry to one C(2) atom. In the third H site, H(4,5) is bonded in a single-bond geometry to one C(3) atom. In the fourth H site, H(6) is bonded in a single-bond geometry to one C(1) atom. There are three inequivalent O sites. In the first O site, O(1) is bonded in a single-bond geometry to one P(1) atom. In the second O site, O(2) is bonded in a 3-coordinate geometry to two equivalent Mg(1) and one P(1) atom. In the third O site, O(3) is bonded in a 3-coordinate geometry to two equivalent Mg(1) and one P(1) atom. Linkers: 9 [O]P([O])(=O)CN1CCN(CP([O])([O])=O)CC1. Metal clusters: 18 [Mg]. The MOF has largest included sphere 9.90 A, density 1.11 g/cm3, surface area 3963.23 m2/g, accessible volume 0.45 cm3/g