EXHIBIT NO. 99.(j) 6

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We consent to the references to our firm under the captions “Financial Highlights” in each 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 September 28, 2026, and each included in this Post-Effective Amendment No. 187 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 July 16, 2026, with respect to the financial statements and financial highlights of MFS Aggressive Growth Allocation Fund, MFS Conservative Allocation Fund, MFS Emerging Markets Equity Fund, MFS Growth Allocation Fund, MFS International Growth Fund, MFS International Intrinsic Equity Fund, MFS International Value Fund, MFS Managed Wealth Fund, and MFS Moderate Allocation Fund (each a series of MFS Series Trust X) included in the Annual Reports (Form N-CSR) for the year ended May 31, 2026, into this Registration Statement, filed with the Securities and Exchange Commission.

/s/ERNST & YOUNG LLP 

Ernst & Young LLP

Boston, Massachusetts

September 24, 2026