Microporous polymers feature shape-persistent free volume elements (FVEs), which are permeated by small molecules and ions when used as membranes for chemical separations, water purification, fuel cells and batteries1–3. Identifying FVEs that have analyte specificity remains a challenge, owing to difficulties in generating polymers with sufficient diversity to enable screening of their properties. Here we describe a diversity-oriented synthetic strategy for microporous polymer membranes to identify candidates featuring FVEs that serve as solvation cages for lithium ions (Li+). This strategy includes diversification of bis(catechol) monomers by Mannich reactions to introduce Li+-coordinating functionality within FVEs, topology-enforcing polymerizations for networking FVEs into different pore architectures, and several on-polymer reactions for diversifying pore geometries and dielectric properties. The most promising candidate membranes featuring ion solvation cages exhibited both higher ionic conductivity and higher cation transference number than control membranes, in which FVEs were aspecific, indicating that conventional bounds for membrane permeability and selectivity for ion transport can be overcome4. These advantages are associated with enhanced Li+ partitioning from the electrolyte when cages are present, higher diffusion barriers for anions within pores, and network-enforced restrictions on Li+ coordination number compared to the bulk electrolyte, which reduces the effective mass of the working ion. Such membranes show promise as anode-stabilizing interlayers in high-voltage lithium metal batteries.