EXHIBIT NO. 99.(i) 2

LEGAL OPINION CONSENT

I consent to the incorporation by reference in this Post-Effective Amendment No. 91 to the Registration Statement (the “Registration Statement”) of MFS® Series Trust XIII (the “Trust”) (File Nos. 2-74959 and 811-3327), of my opinion dated June 27, 2017, appearing in Post-Effective Amendment No. 65 to the Trust’s Registration Statement, which was filed with the Securities and Exchange Commission on June 27, 2017.

 /s/BRIAN E. LANGENFELD 

 Brian E. Langenfeld

 Vice President and Managing Counsel

Boston, Massachusetts

June 25, 2026