EXHIBIT NO. 99.(j) 7

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We consent to the references to our firm under the captions “Financial Highlights” in the Prospectus and “Independent Registered Public Accounting Firm(s) and Financial Statements” and “Appendix M – Recipients of Non-Public Portfolio Holdings on an Ongoing Basis” in the Statement of Additional Information, each dated March 28, 2025, and each included in this Post-Effective Amendment No. 182 to the Registration Statement (Form N-1A, File No. 33-1657) of MFS Series Trust X (the “Registration Statement”).

We also consent to the incorporation by reference of our report dated January 14, 2025, with respect to the financial statements and financial highlights of MFS Global Opportunistic Bond Fund (a series of MFS Series Trust X) included in the Annual Report to Shareholders (Form N-CSR) for the year ended November 30, 2024, into this Registration Statement, filed with the Securities and Exchange Commission.

ERNST & YOUNG LLP 

/s/ Ernst & Young LLP

Boston, Massachusetts

March 26, 2025