EXHIBIT 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in Registration Statement (No. 333- 271227) on Form N-2 of our reports dated February 26, 2026, relating to the consolidated financial statements of MidCap Financial Investment Corporation (the “Company”) and the effectiveness of the Company’s internal control over financial reporting appearing in this Annual Report on Form 10-K of the Company for the year ended December 31, 2025.
/s/ Deloitte & Touche LLP
New York, New York
February 26, 2026