In the electrochemical CO2 reduction reaction (CO2RR), control over the binding of intermediates is key for tuning product selectivity and catalytic activity. Here we report the use of reticular chemistry to control the binding of CO2RR intermediates on metal catalysts encapsulated inside metal–organic frameworks (MOFs), thereby allowing us to improve CO2RR electrocatalysis. By varying systematically both the organic linker and the metal node in a face-centered cubic (fcu) MOF, we tune the adsorption of CO2, pore openness, and Lewis acidity of the MOFs. Using operando X-ray absorption spectroscopy (XAS) and in situ Raman spectroscopy, we reveal that the MOFs are stable under operating conditions and that this tuning plays the role of optimizing the *CO binding mode on the surface of Ag nanoparticles incorporated inside the MOFs with the increase of local CO2 concentration. As a result, we improve the CO selectivity from 74% for Ag/Zr-fcu-MOF-1,4-benzenedicarboxylic acid (BDC) to 94% for Ag/Zr-fcu-MOF-1,4-naphthalenedicarboxylic acid (NDC). The work offers a further avenue to utilize MOFs in the pursuit of materials design for CO2RR.