Contract

Mid Penn Bank Supplemental Executive Retirement Plan Agreement This Supplemental Executive Retirement Plan Agreement (this “Agreement”) is adopted this 6th day of September, 2022 (the “Effective Date”), by and between Mid Penn Bank, a Pennsylvania bank and trust company headquartered in Millersburg, Pennsylvania (the “Bank”), and Jordan Space (the “Executive”). The purpose of this Agreement is to provide specified benefits to the Executive, a member of a select group of management or highly compensated employees who contribute materially to the continued growth, development and future success of the Bank. This Agreement shall be unfunded for tax purposes and for purposes of Title I of the Employee Retirement Income Security Act of 1974 (“ERISA”), as amended from time to time. Article 1 Definitions Whenever used in this Agreement, the following words and phrases shall have the meanings specified: 1.1 “Accrued Benefit” means the dollar value of the liability that should be accrued by the Bank, under generally accepted accounting principles, for the Bank’s obligation to the Executive under this Agreement, calculated by applying Accounting Standards Codification 710- 10 (or any successor thereto) and the Discount Rate. 1.2 “Affiliate” means any business entity with whom the Bank would be considered a single employer under Code Section 414(b) and 414(c). Such term shall be interpreted in a manner consistent with the definition of “service recipient” contained in Code Section 409A. 1.3 “Beneficiary” means each designated person or entity, or the estate of the deceased Executive, entitled to any benefits upon the death of the Executive pursuant to Article 3. 1.4 “Beneficiary Designation Form” means the form established from time to time by the Plan Administrator that the Executive completes, signs and returns to the Plan Administrator to designate one or more Beneficiaries. 1.5 “Board” means the Board of Directors of the Bank as from time to time constituted. 1.6 “Change in Control” means a change in the ownership or effective control of the Bank, or in the ownership of a substantial portion of the assets of the Bank, as such change is defined in Code Section 409A and regulations thereunder. 1.7 “Code” means the Internal Revenue Code of 1986, as amended, and all regulations and guidance thereunder, including such regulations and guidance as may be promulgated after the Effective Date.

2 1.8 “Competing Business” means a business or enterprise (other than the Corporation, the Bank and their Affiliates) that is engaged in the commercial banking, financial services, investment or insurance business in which the Corporation, the Bank or any of their Affiliates is engaged. 1.9 “Corporation” means Mid Penn Bancorp, Inc. 1.10 “Disability” means a condition of the Executive whereby the Executive either: (i) is unable to engage in any substantial gainful activity by reason of any medically determinable physical or mental impairment which can be expected to result in death or can be expected to last for a continuous period of not less than twelve (12) months; or (ii) is, by reason of any medically determinable physical or mental impairment which can be expected to result in death or can be expected to last for a continuous period of not less than twelve (12) months, receiving income replacement benefits for a period of not less than three (3) months under an accident and health plan covering employees or directors of the Bank. Medical determination of Disability may be made by either the Social Security Administration or by the provider of disability insurance covering employees or directors of the Bank, provided that the definition of “disability” applied under such insurance program complies with the requirements of the preceding sentence. Upon the request of the Plan Administrator, the Executive must submit proof to the Plan Administrator of the Social Security Administration’s or the provider’s determination. 1.11 “Discount Rate” means the rate used by the Plan Administrator for determining the Accrued Benefit. The initial Discount Rate is four percent (4%). The Plan Administrator may adjust the Discount Rate to maintain the rate within reasonable standards according to generally accepted accounting principles and applicable bank regulatory guidance. 1.12 “Early Termination” means Separation from Service before attainment of Normal Retirement Age, except when such Separation from Service occurs within twenty-four (24) months following a Change in Control or due to death, Disability or Termination for Cause. 1.13 “Normal Retirement Age” means age seventy (70). 1.14 “Normal Retirement Date” means the later of Normal Retirement Age or Separation from Service. 1.15 “Participant” means any other director or employee of the Bank who is a party to an agreement providing for benefits substantially similar to this Agreement. 1.16 “Person” shall have the meaning ascribed to such term in Section 3(9) of ERISA. 1.17 “Plan Administrator” means the Compensation Committee of the Board, or such other committee or person as the Board shall appoint. 1.18 “Plan Year” means each twelve (12) month period commencing on January 1st and ending on December 31st of such year. The initial Plan Year shall commence on the Effective Date and end on the following December 31st.

3 1.19 “Schedule A” means the schedule attached to this Agreement and made a part hereof. Schedule A shall be updated upon a change in any of the benefit amounts under Article 2. 1.20 “Separation from Service” means termination of the Executive’s employment with the Bank and its Affiliates for reasons other than death or Disability. Whether a Separation from Service has occurred shall be determined in accordance with the requirements of Code Section 409A based on whether the facts and circumstances indicate that the Bank and Executive reasonably anticipated that no further services would be performed after a certain date or that the level of bona fide services the Executive would perform after such date (whether as an employee or as an independent contractor) would permanently decrease to no more than twenty percent (20%) of the average level of bona fide services performed (whether as an employee or an independent contractor) over the immediately preceding thirty-six (36) month period (or the full period of services to the Bank if the Executive has been providing services to the Bank less than thirty-six (36) months). A Separation from Service will not be deemed to have occurred while the Executive is on military leave, sick leave, or other bona fide leave of absence if the period of such leave does not exceed six (6) months or, if longer, the period for which a statute or contract provides the Executive with the right to reemployment with the Bank. If the Executive’s leave exceeds six (6) months, but the Executive is not entitled to reemployment under a statute or contract, the Executive incurs a Separation from Service on the next day following the expiration of such six (6) month period. In determining whether a Separation from Service occurs the Plan Administrator shall take into account, among other things, the definition of “service recipient” and “employer” set forth in Treasury regulation §1.409A-l(h)(3). The Plan Administrator shall have full and final authority to determine conclusively whether a Separation from Service occurs and the date of such Separation from Service. 1.21 “Specified Employee” means an employee who at the time of Separation from Service is a key employee of the Bank or its Affiliates, if any stock of the Bank or its Affiliates is publicly traded on an established securities market or otherwise. For purposes of this Agreement, an employee is a “key employee” if the employee meets the requirements of Code Section 416(i)(1)(A)(i), (ii), or (iii) (applied in accordance with the regulations thereunder and disregarding section 416(i)(5)) at any time during the twelve (12) month period ending on December 31 (the “identification period”). If the employee is a key employee during an identification period, the employee is treated as a key employee for purposes of this Agreement during the twelve (12) month period that begins on the first day of April following the close of the identification period. 1.22 “Termination for Cause” means Separation from Service for “Cause,” as such term is defined in Executive’s Employment Agreement with the Corporation and Bank dated September 6, 2022, as the same may be amended from time to time. 1.23 “Termination for Good Reason” means Separation from Service for “Good Reason”, as such term is defined in Executive’s Employment Agreement with the Corporation and Bank dated September 6, 2022, as the same may be amended from time to time. Article 2

8 2.13.2 All determinations to be made under this Section 2.13 shall be made, in writing, by the Corporation’s independent certified public accountant immediately prior to the Change in Control (the “Accounting Firm”), which firm shall provide its determinations and any supporting calculations in writing to both the Bank and Executive within ten (10) days of the date of termination. Any such determination by the Accounting Firm shall be binding upon the Bank and Executive. Executive shall in his or her sole discretion determine which and how much of the Agreement Payments shall be eliminated or reduced consistent with the requirements of this Section 2.13, which determination shall be made by delivery of written notice to the Bank within 10 days of Executive’s receipt of the determination of the Accounting Firm. Within five (5) days after Executive’s timely determination, the Bank shall pay (or cause to be paid) or distribute (or cause to be distributed) to or for the benefit of Executive, such amounts as are then due to Executive under this Agreement. In the event Executive does not make such timely determination then within 15 days after the Bank’s receipt of the determination of the Accounting Firm, the Bank in its sole discretion may pay (or cause to be paid) or distribute (or cause to be distributed) to or for the benefit of Executive such portion of the Agreement Payments as it may deem appropriate, but no less than the Reduced Amount. 2.13.3 As a result of the uncertainty in the application of Section 280G of the Code at the time of the initial determination by the Accounting Firm hereunder, it is possible that Agreement Payments, as the case may be, will have been made by the Bank which should not have been made (“Overpayment”) or that additional Agreement Payments which have not been made by the Bank could have been made (“Underpayment”), in each case, consistent with the calculations required to be made hereunder. Within two (2) years after the Separation from Service, the Accounting Firm shall review the determination made by it pursuant to the preceding paragraph. In the event that the Accounting Firm determines that an Overpayment has been made, any such Overpayment shall be treated for all purposes as a loan to Executive which Executive shall repay to the Bank together with interest at the applicable Federal rate provided for in Section 7872(f)(2) of the Code (the “Federal Rate”); provided, however, that no amount shall be payable by Executive to the Bank if and to the extent such payment would not reduce the amount which is subject to taxation under Section 4999 of the Code. In the event that the Accounting Firm determines that an Underpayment has occurred, any such Underpayment shall be promptly paid by the Bank to or for the benefit of Executive together with interest thereon at the Federal Rate. 2.13.4 All of the fees and expenses of the Accounting Firm in performing the determinations referred to in paragraphs (b) and (c) above shall be borne solely by the Corporation or the Bank. The Bank agrees to indemnify and hold harmless the Accounting Firm of and from any and all claims, damages and expenses of any nature resulting from or relating to its determinations pursuant to paragraphs (b) and (c) above, except for claims, damages or expenses resulting from the gross negligence or willful misconduct of the Accounting Firm.

10 of such benefit to the guardian, legal representative or person having the care or custody of such minor, incompetent person or incapable person. The Plan Administrator may require proof of incompetence, minority or guardianship as it may deem appropriate prior to distribution of the benefit. Any distribution of a benefit shall be a distribution for the account of the Executive and the Beneficiary, as the case may be, and shall completely discharge any liability under this Agreement for such distribution amount. Article 4 General Limitations 4.1 Termination for Cause. Notwithstanding any provision of this Agreement to the contrary, the Bank shall not distribute any benefit under this Agreement if the Executive’s employment with the Bank is terminated by the Bank due to a Termination for Cause. 4.2 Misstatement. No benefit shall be distributed if an insurance company which issued a life insurance policy covering the Executive and owned by the Bank denies coverage (i) for material misstatements of fact made by the Executive on an application for such life insurance, or (ii) for any other reason. 4.3 Removal. Notwithstanding any provision of this Agreement to the contrary, the Bank shall not distribute any benefit under this Agreement if the Executive is subject to a final removal or prohibition order issued by an appropriate federal banking agency pursuant to Section 8(e) of the Federal Deposit Insurance Act. 4.4 Regulatory Restrictions. Notwithstanding anything herein to the contrary, any payments made to the Executive pursuant to this Agreement, or otherwise, shall be subject upon compliance with 12 U.S.C. Section 1828 and FDIC Regulation 12 CFR Part 359, Golden Parachute Indemnification Payments and any other regulations or guidance promulgated thereunder. 4.5 Competition after Separation from Service. The Executive shall forfeit, for the Executive and the Beneficiary, any unpaid benefits payable hereunder, if the Executive: (a) directly or indirectly, and whether as principal or investor or as an employee, officer, director, manager, partner, consultant, agent, or otherwise, alone or in association with any other Person, becomes involved in a Competing Business (as defined below) in any county in the Commonwealth of Pennsylvania in which the Corporation, the Bank or any of their Affiliates has maintained a branch or other office during the period of Executive’s employment (excluding an ownership interest of $100,000 or less in the stock of one or more publicly-traded companies); or (b) directly or indirectly, whether alone or in association with any other Person, for the purpose of conducting or engaging in any Competing Business, calls upon, solicits, or advises any Person who is, or was, during the then most recent 12-month period, a customer of the Corporation, the Bank or any of their Affiliates, or takes away or interferes or attempts to take away or interfere with any custom, trade, business, patronage, or affairs of the Corporation, the Bank or any of their Affiliates, or hires

16 8.4 Tax Withholding and Reporting. The Bank shall withhold any taxes that are required to be withheld, including but not limited to taxes owed under Code Section 409A from the benefits provided under this Agreement. The Executive acknowledges that the Bank’s sole liability regarding taxes is to forward any amounts withheld to the appropriate taxing authorities. The Bank shall satisfy all applicable reporting requirements, including those under Code Section 409A. 8.5 Applicable Law. This Agreement and all rights hereunder shall be governed by the laws of the Commonwealth of Pennsylvania, except to the extent preempted by the laws of the United States of America. 8.6 Unfunded Arrangement. The Executive and the Beneficiary are general unsecured creditors of the Bank for the distribution of benefits under this Agreement. The benefits represent the mere promise by the Bank to distribute such benefits. The rights to benefits are not subject in any manner to anticipation, alienation, sale, transfer, assignment, pledge, encumbrance, attachment or garnishment by creditors. Any insurance on the Executive’s life or other informal funding asset is a general asset of the Bank to which the Executive and Beneficiary have no preferred or secured claim. 8.7 Reorganization. The Bank shall not merge or consolidate into or with another bank, or reorganize, or sell substantially all of its assets to another bank, firm or person unless such succeeding or continuing bank, firm or person agrees to assume and discharge the obligations of the Bank under this Agreement. Upon the occurrence of such an event, the term “Bank” as used in this Agreement shall be deemed to refer to the successor or survivor entity. 8.8 Entire Agreement. This Agreement constitutes the entire agreement between the Bank and the Executive as to the subject matter hereof. No rights are granted to the Executive by virtue of this Agreement other than those specifically set forth herein. 8.9 Interpretation. Wherever the fulfillment of the intent and purpose of this Agreement requires and the context will permit, the use of the masculine gender includes the feminine and use of the singular includes the plural. 8.10 Alternative Action. In the event it shall become impossible for the Bank or the Plan Administrator to perform any act required by this Agreement due to regulatory or other constraints, the Bank or Plan Administrator may perform such alternative act as most nearly carries out the intent and purpose of this Agreement and is in the best interests of the Bank, provided that such alternative act does not violate Code Section 409A. 8.11 Headings. Article and section headings are for convenient reference only and shall not control or affect the meaning or construction of any provision herein. 8.12 Validity. If any provision of this Agreement shall be illegal or invalid for any reason, said illegality or invalidity shall not affect the remaining parts hereof, but this Agreement shall be construed and enforced as if such illegal or invalid provision had never been included herein.

18 IN WITNESS WHEREOF, the Executive and a duly authorized representative of the Bank have signed this Agreement. EXECUTIVE MID PENN BANK /s/ Jordan Space By: /s/ Xxxx X. Xxxxxxxx Xxxxxx Space Title: President and CEO [Signature Page to Supplemental Executive Retirement Plan Agreement of Jordan Space]

SCHEDULE A Jordan Space Early Termination Disability Pre-Retirement Death Plan Year Annual Benefit Annual Benefit Annual Benefit Plan Years Commencing on the Effective Date and Ending on December 31, 2022 $0 $0 $0 January 1 – December 31, 2023 $8,000 $8,000 $8,000 January 1 – December 31, 2024 $16,000 $16,000 $16,000 January 1 – December 31, 2025 $24,000 $24,000 $24,000 January 1 – December 31, 2026 $32,000 $32,000 $32,000 January 1 – December 31, 2027 January 1 – December 31, 2028 January 1 – December 31, 2029 January 1 – December 31, 2030 January 1 – December 31, 2031 $40,000 $48,000 $56,000 $64,000 $72,000 $40,000 $48,000 $56,000 $64,000 $72,000 $40,000 $48,000 $56,000 $64,000 $72,000 January 1 – December 31, 2032 and All Subsequent Plan Years $80,000 $80,000 $80,000

1 BENEFICIARY DESIGNATION FORM { } New Designation { } Change in Designation I, Jordan Space, designate the following as Beneficiary under this Agreement: Primary: ___________________________________________________________ ___________________________________________________________ _____% _____% Contingent: ___________________________________________________________ ___________________________________________________________ _____% _____% Notes: Please PRINT CLEARLY or TYPE the names of the beneficiaries. To name a trust as Beneficiary, please provide the name of the trustee(s) and the exact name and date of the trust agreement. To name your estate as Beneficiary, please write “Estate of [your name]”. Be aware that none of the contingent beneficiaries will receive anything unless ALL of the primary beneficiaries predecease you. I understand that I may change these beneficiary designations by delivering a new written designation to the Plan Administrator, which shall be effective only upon receipt and acknowledgment by the Plan Administrator prior to my death. I further understand that the designations will be automatically revoked if the Beneficiary predeceases me, or, if I have named my spouse as Beneficiary and our marriage is subsequently dissolved. Name: Jordan Space Signature: _______________________________ Date ______ Received by the Plan Administrator this ________ day of ___________________, 20___ By: _________________________________ Title: _________________________________