Substrate-selective catalysis is essential for sustainable synthesis but has long been constrained by the inherent trade-off between precision and versatility in competitive environments. To address this challenge, we developed an eco-friendly magnetic nanoreactor that integrates layer-by-layer covalent active-site engineering with sol-gel imprinting to achieve adaptive molecular recognition. These molecularly imprinted nanoreactors (MMIPs), constructed using target products as templates, exhibit triple selectivity: positional (para/meta-isomer discrimination >8-fold), electronic (nitro/cyano differentiation 2-fold) and spatial (isopropyl exclusion) in aldol catalysis. The nanoreactors operate effectively in both single and mixed substrate systems, bypassing the need for energy-intensive purification. A key innovation is the template-switching strategy that enables substrate reorientation, expanding recognition scope without structural redesign. For instance, m-MMIP demonstrates high selectivity (coefficient >1.7) for the low-reactivity m-nitrobenzaldehyde, using its cyclohexanone adduct as a template. The platform minimizes environmental impact by enabling energy-efficient substrate-selective catalysis, reducing the E-factor by >36% while improving atom efficiency by >1.6-fold. By synergizing molecular precision with scalable selectivity and covalent durability, this work establishes a programmable green catalysis paradigm for pharmaceutical and fine chemical synthesis, emphasizing waste reduction and resource optimization.