The main challenge for gas storage and separation in nanoporous materials is that many molecules of interest adsorb too weakly to be effectively retained. Instead of synthetically modifying the internal surface structure of the entire bulk—as is typically done to enhance adsorption—here we show that post exposure of a prototypical porous metal-organic framework to ethylenediamine can effectively retain a variety of weakly adsorbing molecules (for example, CO, CO2, SO2, C2H4, NO) inside the materials by forming a monolayer-thick cap at the external surface of microcrystals. Furthermore, this capping mechanism, based on hydrogen bonding as explained by ab initio modelling, opens the door for potential selectivity. For example, water molecules are shown to disrupt the hydrogen-bonded amine network and diffuse through the cap without hindrance and fully displace/release the retained small molecules out of the metal-organic framework at room temperature. These findings may provide alternative strategies for gas storage, delivery and separation.