EXHIBIT NO. 99.(i) 2

LEGAL OPINION CONSENT

I consent to the incorporation by reference in this Post-Effective Amendment No. 76 to the Registration Statement (the “Registration Statement”) of MFS® Series Trust XII (the “Trust”) (File Nos. 333-126328 and 811-21780), of my opinion dated August 25, 2023, appearing in Post-Effective Amendment No. 74 to the Trust’s Registration Statement, which was filed with the Securities and Exchange Commission on August 25, 2023.

 AMANDA S. MOORADIAN 

 Amanda S. Mooradian

 Vice President and Senior Counsel

Boston, Massachusetts

August 27, 2025