When Magnesium Chloride dissolves in water, the Mg2+ and Cl- ions dissociate in solution, of course energy is required to break the lattice structure. However, an excess of energy is in fact released from the ionic bond making of water molecules surrounding the Mg2+ and Cl- ions, so-called 'clustering' of water molecules. Overall, more energy is released from the process of dissolving/bond making, this means the reaction is exothermic. Hence an increase in temperature.
This image shows a similar situation when Sodium chloride dissolves, notice the partial negative and partial positive charges of a water molecule.