<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.22.2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>426</ContextCount>
  <ElementCount>279</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>66</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>6</UnitCount>
  <MyReports>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>000 - Document - Document And Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-document-and-entity-information</Role>
      <ShortName>Document And Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>001 - Statement - Consolidated Balance Sheet (Current Period Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-balance-sheet-current-period-unaudited</Role>
      <ShortName>Consolidated Balance Sheet (Current Period Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>002 - Statement - Consolidated Balance Sheet (Current Period Unaudited) (Parentheticals)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-balance-sheet-current-period-unaudited-parentheticals</Role>
      <ShortName>Consolidated Balance Sheet (Current Period Unaudited) (Parentheticals)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>003 - Statement - Consolidated Statement of Income (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-statement-of-income-unaudited</Role>
      <ShortName>Consolidated Statement of Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>004 - Statement - Consolidated Statement of Comprehensive (Loss) Income (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-statement-of-comprehensive-loss-income-unaudited</Role>
      <ShortName>Consolidated Statement of Comprehensive (Loss) Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>005 - Statement - Consolidated Statement of Changes in Stockholders' Equity (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-statement-of-changes-in-stockholders-equity-unaudited</Role>
      <ShortName>Consolidated Statement of Changes in Stockholders' Equity (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>006 - Statement - Consolidated Statement of Changes in Stockholders' Equity (Unaudited) (Parentheticals)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-statement-of-changes-in-stockholders-equity-unaudited-parentheticals</Role>
      <ShortName>Consolidated Statement of Changes in Stockholders' Equity (Unaudited) (Parentheticals)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>007 - Statement - Consolidated Statement of Cash Flows (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-consolidated-statement-of-cash-flows-unaudited</Role>
      <ShortName>Consolidated Statement of Cash Flows (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>008 - Disclosure - Note 1 - Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-1-basis-of-presentation</Role>
      <ShortName>Note 1 - Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>009 - Disclosure - Note 2 - Revenue Recognition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-2-revenue-recognition</Role>
      <ShortName>Note 2 - Revenue Recognition</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>010 - Disclosure - Note 3 - Stock-based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-3-stockbased-compensation</Role>
      <ShortName>Note 3 - Stock-based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>011 - Disclosure - Note 4 - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-4-earnings-per-share</Role>
      <ShortName>Note 4 - Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>012 - Disclosure - Note 5 - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements</Role>
      <ShortName>Note 5 - Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>013 - Disclosure - Note 6 - Accumulated Other Comprehensive Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income</Role>
      <ShortName>Note 6 - Accumulated Other Comprehensive Income</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>014 - Disclosure - Note 7 - Investment and Equity Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities</Role>
      <ShortName>Note 7 - Investment and Equity Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>015 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>016 - Disclosure - Note 9 - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-9-commitments-and-contingencies</Role>
      <ShortName>Note 9 - Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>017 - Disclosure - Note 10 - Proposed Acquisition of Liberty Bancshares</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-10-proposed-acquisition-of-liberty-bancshares</Role>
      <ShortName>Note 10 - Proposed Acquisition of Liberty Bancshares</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>018 - Disclosure - Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-significant-accounting-policies-policies</Role>
      <ShortName>Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>019 - Disclosure - Note 2 - Revenue Recognition (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-2-revenue-recognition-tables</Role>
      <ShortName>Note 2 - Revenue Recognition (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-2-revenue-recognition</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>020 - Disclosure - Note 3 - Stock-based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-3-stockbased-compensation-tables</Role>
      <ShortName>Note 3 - Stock-based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-3-stockbased-compensation</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>021 - Disclosure - Note 4 - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-4-earnings-per-share-tables</Role>
      <ShortName>Note 4 - Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-4-earnings-per-share</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>022 - Disclosure - Note 5 - Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-tables</Role>
      <ShortName>Note 5 - Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>023 - Disclosure - Note 6 - Accumulated Other Comprehensive Income (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income-tables</Role>
      <ShortName>Note 6 - Accumulated Other Comprehensive Income (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>024 - Disclosure - Note 7 - Investment and Equity Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities-tables</Role>
      <ShortName>Note 7 - Investment and Equity Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>025 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-tables</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>026 - Disclosure - Note 2 - Revenue Recognition (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-2-revenue-recognition-details-textual</Role>
      <ShortName>Note 2 - Revenue Recognition (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-2-revenue-recognition-tables</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>027 - Disclosure - Note 2 - Revenue Recognition - Disaggregation of Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-2-revenue-recognition-disaggregation-of-revenue-details</Role>
      <ShortName>Note 2 - Revenue Recognition - Disaggregation of Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>028 - Disclosure - Note 3 - Stock-based Compensation (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-3-stockbased-compensation-details-textual</Role>
      <ShortName>Note 3 - Stock-based Compensation (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-3-stockbased-compensation-tables</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>029 - Disclosure - Note 3 - Stock-based Compensation - Activity Related to Restricted Stock Units Awarded (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-3-stockbased-compensation-activity-related-to-restricted-stock-units-awarded-details</Role>
      <ShortName>Note 3 - Stock-based Compensation - Activity Related to Restricted Stock Units Awarded (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>030 - Disclosure - Note 4 - Earnings Per Share (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-4-earnings-per-share-details-textual</Role>
      <ShortName>Note 4 - Earnings Per Share (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-4-earnings-per-share-tables</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>031 - Disclosure - Note 4 - Earnings Per Share - Shares Used in Calculation of Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-4-earnings-per-share-shares-used-in-calculation-of-earnings-per-share-details</Role>
      <ShortName>Note 4 - Earnings Per Share - Shares Used in Calculation of Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>032 - Disclosure - Note 5 - Fair Value Measurements (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-details-textual</Role>
      <ShortName>Note 5 - Fair Value Measurements (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-tables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>033 - Disclosure - Note 5 - Fair Value Measurements - Assets Measured on a Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-assets-measured-on-a-recurring-basis-details</Role>
      <ShortName>Note 5 - Fair Value Measurements - Assets Measured on a Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>034 - Disclosure - Note 5 - Fair Value Measurements - Fair Value Reconciliation of Level 3 Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-fair-value-reconciliation-of-level-3-assets-details</Role>
      <ShortName>Note 5 - Fair Value Measurements - Fair Value Reconciliation of Level 3 Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>035 - Disclosure - Note 5 - Fair Value Measurements - Assets Measured on a Nonrecurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-assets-measured-on-a-nonrecurring-basis-details</Role>
      <ShortName>Note 5 - Fair Value Measurements - Assets Measured on a Nonrecurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>036 - Disclosure - Note 5 - Fair Value Measurements - Additional Quantitative Information About Assets Measured at Fair Value on Non-recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-additional-quantitative-information-about-assets-measured-at-fair-value-on-nonrecurring-basis-details</Role>
      <ShortName>Note 5 - Fair Value Measurements - Additional Quantitative Information About Assets Measured at Fair Value on Non-recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>037 - Disclosure - Note 5 - Fair Value Measurements - Estimated Fair Value of the Company's Financial Instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-5-fair-value-measurements-estimated-fair-value-of-the-companys-financial-instruments-details</Role>
      <ShortName>Note 5 - Fair Value Measurements - Estimated Fair Value of the Company's Financial Instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>038 - Disclosure - Note 6 - Accumulated Other Comprehensive Income (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income-details-textual</Role>
      <ShortName>Note 6 - Accumulated Other Comprehensive Income (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income-tables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>039 - Disclosure - Note 6 - Accumulated Other Comprehensive Income (Loss) - Changes in Accumulated Other Comprehensive Income (Loss) by Component, Net of Tax (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income-loss-changes-in-accumulated-other-comprehensive-income-loss-by-component-net-of-tax-details</Role>
      <ShortName>Note 6 - Accumulated Other Comprehensive Income (Loss) - Changes in Accumulated Other Comprehensive Income (Loss) by Component, Net of Tax (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-6-accumulated-other-comprehensive-income-tables</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>040 - Disclosure - Note 7 - Investment and Equity Securities (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities-details-textual</Role>
      <ShortName>Note 7 - Investment and Equity Securities (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities-tables</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>041 - Disclosure - Note 7 - Investment and Equity Securities - Amortized Cost and Fair Values of Securities Available for Sale (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities-amortized-cost-and-fair-values-of-securities-available-for-sale-details</Role>
      <ShortName>Note 7 - Investment and Equity Securities - Amortized Cost and Fair Values of Securities Available for Sale (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>042 - Disclosure - Note 7 - Investment and Equity Securities - Amortized Cost and Fair Value of Debt Securities by Contractual Maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities-amortized-cost-and-fair-value-of-debt-securities-by-contractual-maturity-details</Role>
      <ShortName>Note 7 - Investment and Equity Securities - Amortized Cost and Fair Value of Debt Securities by Contractual Maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>043 - Disclosure - Note 7 - Investment and Equity Securities - Gross Unrealized Losses and Fair Value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-7-investment-and-equity-securities-gross-unrealized-losses-and-fair-value-details</Role>
      <ShortName>Note 7 - Investment and Equity Securities - Gross Unrealized Losses and Fair Value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>044 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-details-textual</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-tables</ParentRole>
      <Position>45</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>045 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Primary Segments of the Loan Portfolio (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-primary-segments-of-the-loan-portfolio-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Primary Segments of the Loan Portfolio (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>046 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Allowance for Loan Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-allowance-for-loan-losses-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Allowance for Loan Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>047 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Impaired Loans by Class (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-impaired-loans-by-class-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Impaired Loans by Class (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>048 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Additional Information on Impaired Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-additional-information-on-impaired-loans-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Additional Information on Impaired Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>049 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Classes of the Loan Portfolio Summarized by Credit Quality (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-classes-of-the-loan-portfolio-summarized-by-credit-quality-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Classes of the Loan Portfolio Summarized by Credit Quality (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>050 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Past Due Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-past-due-loans-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Past Due Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>051 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Nonaccrual Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-nonaccrual-loans-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Nonaccrual Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>052 - Disclosure - Note 8 - Loans and Related Allowance for Loan and Lease Losses - Troubled Debt Restructurings (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-8-loans-and-related-allowance-for-loan-and-lease-losses-troubled-debt-restructurings-details</Role>
      <ShortName>Note 8 - Loans and Related Allowance for Loan and Lease Losses - Troubled Debt Restructurings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="mbcn20220630_10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>053 - Disclosure - Note 10 - Proposed Acquisition of Liberty Bancshares (Details Textual)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://middlefieldbank.bank/20220630/role/statement-note-10-proposed-acquisition-of-liberty-bancshares-details-textual</Role>
      <ShortName>Note 10 - Proposed Acquisition of Liberty Bancshares (Details Textual)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://middlefieldbank.bank/20220630/role/statement-note-10-proposed-acquisition-of-liberty-bancshares</ParentRole>
      <Position>54</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" original="mbcn20220630_10q.htm">mbcn20220630_10q.htm</File>
    <File>ex_404696.htm</File>
    <File>ex_404697.htm</File>
    <File>ex_404698.htm</File>
    <File>ex_404699.htm</File>
    <File>ex_404700.htm</File>
    <File>mbcn-20220630.xsd</File>
    <File>mbcn-20220630_cal.xml</File>
    <File>mbcn-20220630_def.xml</File>
    <File>mbcn-20220630_lab.xml</File>
    <File>mbcn-20220630_pre.xml</File>
  </InputFiles>
  <SupplementalFiles>
    <File>mbclogosm.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="1497">http://fasb.org/us-gaap/2022</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2022</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
