What is charge density?
If it was about the number of protons in the nucleus, then Mercury would hardly be liquid at room temperature, would it?

Actually, it is about the density of free electrons, i.e. the density of the "electron gas" that makes up the metallic bonding. Obviously, this density has to be the negative of the ions' charge, so you might equivalently say it's about magnesium's (2+) charge, though that doesn't make much sense physically unless you also consider the conduction electrons, as the ions themselves of course repulse each other.