Developing catalysts with excellent CO2 capture capability and electrochemical CO2 reduction reaction (CO2RR) at a wide potential range simultaneously is significant but remains a formidable challenge. Here, two novel InMg defective trinuclear cluster-based MOFs (SNNU-41 and SNNU-42) with abundant p-block unsaturated coordinated sites were reported and exhibited good CO2 capture and CO2RR performance simultaneously. Due to the suitable micropores, SNNU-41 showed higher CO2 capture ability at different adsorption pressure conditions. On account of the rigid framework and the closer p band center to Fermi level, SNNU-42 accelerated the conversion of CO2 molecule to C1 efficiency. Notably, via adjusting the ratio of p-block metal (In) in the SNNU-42 framework, the performance of the CO2RR was promoted drastically. SNNU-42 with the InMg (1:1.8) mixed cluster delivered an excellent Faradaic efficiency of 91.3% for C1 products and high selectivity of 72.0% for HCOOH at -2.5 V (vs Ag/Ag+) with a total current density of 77.2 mA cm-2. This work provides a possibility for efficient CO2 capture and CO2RR electrocatalysts through the modulation of electronic structures and composition in MOFs.