Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We have issued our reports dated February 28, 2025, with respect to the consolidated financial statements, financial statement schedule and internal control over financial reporting included in the Annual Report of Main Street Capital Corporation on Form 10-K for the year ended December 31, 2024. We consent to the incorporation by reference of said reports in the Registration Statements of Main Street Capital Corporation on Form N-2ASR (File No. 333-263258) and Forms S-8 (File Nos. 333-203893, 333-208643 and File No. 333-264643).
/s/ GRANT THORNTON LLP
Houston, Texas
February 28, 2025