Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in this Registration Statement on Form S-8 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.
/s/ YOUNT, HYDE & BARBOUR, P.C.
Owings Mills, Maryland
May 22, 2024