The NASA MESSENGER mission explored the innermost planet of the solar system and obtained a rich data set of range measurements for the determination of Mercury’s ephemeris. Here we use these precise data collected over 7 years to estimate parameters related to general relativity and the evolution of the Sun. These results confirm the validity of the strong equivalence principle with a significantly refined uncertainty of the Nordtvedt parameter η = (−6.6 ± 7.2) × 10−5. By assuming a metric theory of gravitation, we retrieved the post-Newtonian parameter β = 1 + (−1.6 ± 1.8) × 10−5 and the Sun’s gravitational oblateness, {{J}}_{2 odot } = (2.246 ± 0.022) × 10−7. Finally, we obtain an estimate of the time variation of the Sun gravitational parameter, dot{{G} {{M}}_ odot} {mathrm{/}}{{G}}{{M}}_ odot = (−6.13 ± 1.47) × 10−14, which is consistent with the expected solar mass loss due to the solar wind and interior processes. This measurement allows us to constrain left| {{dot{ G}}} right|{mathrm{/}}{{G}} to be <4 × 10−14 per year.