Here, we report a general strategy to template bifunctional acid-base sites in metal-organic framework pores. Using a mesoporous magnesium-based framework with ~3 nm pore channels, we show how carboxylic acid and benzylamine functional groups can be installed pairwise in a single configuration less than 7 Å apart. Relative to non-templated materials containing randomly distributed acid and base sites, the templated catalysts are over four-fold and two-fold more active for aldol condensation reactions with 4-nitrobenzaldehyde and furfural, respectively. Finally, the catalysts are stable and show no loss in activity or structural degradation after multiple cycles. Together, this work establishes metal-organic frameworks as an exciting platform for cooperative acid-base catalysis that balances the advantages of heterogeneous catalysts with the precision of enzymes.