We have measured electron-ion recombination for C-like Mg 6+ forming Mg 5+ , and for B-like Mg 7+ forming Mg 6+ . These studies were performed using a merged electron-ion beam arrangement at the TSR heavy ion storage ring located in Heidelberg, Germany. Both primary ions have metastable levels with significant lifetimes. Using a simple cascade model we estimate the population fractions in these metastable levels. For the Mg 6+ results, we find that the majority of the stored ions are in a metastable level, while for Mg 7+ the metastable fraction is insignificant. We present the Mg 6+ merged beams recombination rate coefficient for DR via N = 2 → N = 2 core electron excitations (ΔN = 0 DR) and for Mg 7+ via 2 → 2 and 2 → 3 core excitations. Taking the estimated metastable populations into account, we compare our results to state-of-the-art multiconfiguration Breit-Pauli theoretical calculations. Significant differences are found at low energies where theory is known to be unreliable. Moreover, for both ions we observe a discrepancy between experiment and theory for ΔN = 0 DR involving capture into high-n Rydberg levels and where the stabilization is primarily due to a radiative transition of the excited core electron. This is consistent with previous DR experiments on M-shell iron ions which were performed at TSR. The large metastable content of the Mg 6+ ion beam precludes generating a plasma recombination rate coefficient (PRRC). However, this is not an issue for Mg 7+ and we present an experimentally derived Mg 7+ PRRC for plasma temperatures from 400 K to 10 7 K with an estimated uncertainty of less than 27% at a 90% confidence level. We also provide a fit to our experimentally derived PRRC for use in plasma modeling codes.