EXHIBIT NO. 99.(j) 3
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the references to our firm under the captions “Financial Highlights” in the Prospectuses 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 August 28, 2026, and each included in this Post-Effective Amendment No. 79 to the Registration Statement (Form N-1A, File No. 333-126328) of MFS Series Trust XII (the “Registration Statement”).
We also consent to the incorporation by reference of our reports dated June 12, 2026, with respect to the financial statements and financial highlights of MFS Lifetime Income Fund, MFS Lifetime 2030 Fund, MFS Lifetime 2035 Fund, MFS Lifetime 2040 Fund, MFS Lifetime 2045 Fund, MFS Lifetime 2050 Fund, MFS Lifetime 2055 Fund, MFS Lifetime 2060 Fund, MFS Lifetime 2065 Fund, and MFS Core Bond Fund (each a series of MFS Series Trust XII) included in the Annual Reports (Form N-CSR) for the year ended April 30, 2026, into this Registration Statement, filed with the Securities and Exchange Commission.
/s/ERNST & YOUNG LLP
Ernst & Young LLP
Boston, Massachusetts
August 26, 2026