GO:0071286:   cellular response to magnesium ion
Any process that results in a change in state or activity of a cell (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a magnesium ion stimulus.