QuickLinks -- Click here to rapidly navigate through this document


Exhibit (l)

LOGO

April 30, 2019

Main Street Capital Corporation
1300 Post Oak Boulevard, 8th Floor
Houston, TX 77056

Ladies and Gentlemen:

        We have acted as counsel to Main Street Capital Corporation, a Maryland corporation (the "Company"), in connection with the preparation and filing by the Company with the Securities and Exchange Commission (the "Commission") of a registration statement on Form N-2, filed with the Commission on April 30, 2019 (as amended from time to time, the "Registration Statement") under the Securities Act of 1933, as amended (the "Securities Act"), with respect to the offer, issuance and sale, from time to time, pursuant to Rule 415 under the Securities Act, of up to $1,500,000,000 in aggregate offering amount of the following (the "Securities"):

        The Registration Statement provides that the Securities may be issued from time to time in amounts, at prices, and on terms to be set forth in one or more supplements to the final prospectus included in the Registration Statement at the time it becomes effective or in one or more free writing prospectuses.

        The Debt Securities are to be issued in one or more series under an indenture (the "Base Indenture") entered into by and between the Company and The Bank of New York Mellon Trust Company, N.A., as trustee (the "Trustee") and one or more supplemental indentures thereto (each, a "Supplemental Indenture" and, together with the Base Indenture, the "Indenture"). The Rights are to be issued under rights agreements (each a "Rights Agreement") to be entered into by and between the Company and the purchasers thereof or a rights agent to be identified in the applicable Rights Agreement.

        As counsel to the Company, we have participated in the preparation of the Registration Statement and have examined the originals or copies, certified or otherwise identified to our satisfaction as being true copies, of the following:


LOGO   Main Street
Capital Corporation
April 30, 2019
Page 2

        With respect to such examination and our opinions expressed herein, we have assumed, without any independent investigation or verification, (i) the genuineness of all signatures on all documents submitted to us for examination, (ii) the legal capacity of all natural persons, (iii) the authenticity of all documents submitted to us as originals, (iv) the conformity to original documents of all documents submitted to us as conformed or reproduced copies and the authenticity of the originals of such copied documents, and (v) that all certificates issued by public officials have been properly issued. We also have assumed, without independent investigation or verification the accuracy and completeness of all corporate records made available to us by the Company, that (i) the Supplemental Indentures and the Rights Agreements will be governed by the laws of the State of New York and (ii) the Indenture and the Rights Agreements will be valid and legally binding obligations of the parties thereto (other than the Company).

        As to certain matters of fact relevant to the opinions in this opinion letter, we have relied upon certificates of public officials (which we have assumed remain accurate as of the date of this opinion), upon certificates and/or representations of officers of the Company, upon such other certificates as we deemed appropriate, and upon such other data as we have deemed to be appropriate under the circumstances. We have not independently established the facts, or in the case of certificates of public officials, the other statements, so relied upon.

        This opinion letter is limited to the effect of the Maryland General Corporation Law (the "MGCL") and as to the Debt Securities and the Rights constituting valid and legally binding obligations of the Company, the laws of the State of New York, in each case, as in effect on the date hereof, and we express no opinion as to the applicability or effect of any other laws of the State of Maryland or the laws of any other jurisdictions. Without limiting the preceding sentence, we express no opinion as to any federal or state securities or broker-dealer laws or regulations thereunder relating to the offer, issuance and sale of the Securities pursuant to the Registration Statement. This opinion letter has been prepared, and should be interpreted, in accordance with customary practice followed in the preparation of opinion letters by lawyers who regularly give, and such customary practice followed by lawyers who on behalf of their clients regularly advise opinion recipients regarding, opinion letters of this kind.

        The opinions expressed in paragraphs 2 and 3 below are subject to the effect of (i) applicable bankruptcy, insolvency, reorganization, receivership, moratorium, fraudulent conveyance and other similar laws affecting the rights and remedies of creditors generally, (ii) general principles of equity (including, without limitation, the availability of specific performance or injunctive relief and the application of concepts of materiality, reasonableness, good faith and fair dealing), regardless of whether considered in a proceeding at law or in equity and (iii) federal and state securities laws or principles of public policy which may limit enforcement of rights to indemnification and contribution.


LOGO   Main Street
Capital Corporation
April 30, 2019
Page 3

        On the basis of and subject to the foregoing, and in reliance thereon, and subject to the limitations and qualifications set forth in this opinion letter, we are of the opinion that:


LOGO   Main Street
Capital Corporation
April 30, 2019
Page 4

        The opinions expressed in this opinion letter (i) are strictly limited to the matters stated in this opinion letter, and without limiting the foregoing, no other opinions are to be implied and (ii) are only as of the date of this opinion letter, and we are under no obligation, and do not undertake, to advise the addressee of this opinion letter or any other person or entity either of any change of law or fact that occurs, or of any fact that comes to our attention, after the date of this opinion letter, even though such change or such fact may affect the legal analysis or a legal conclusion in this opinion letter.

        We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to our firm in the "Legal Matters" section in the Registration Statement. We do not admit by giving this consent that we are in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations thereunder.

Very truly yours,

/s/ DECHERT LLP




QuickLinks