Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in this Registration Statement on Form S-3 and related Prospectus of MainStreet Bancshares, Inc. of our report dated March 20, 2024, relating to the consolidated financial statements of MainStreet Bancshares, Inc., appearing in the Annual Report on Form 10-K of MainStreet Bancshares, Inc. for the year ended December 31, 2023.
We also consent to the reference to our firm under the heading “Experts” in such Prospectus.
/s/ YOUNT, HYDE & BARBOUR, P.C.
Owings Mills, Maryland
May 22, 2024