Metal-organic frameworks offer tremendous potential for efficient separation of molecular mixtures. Different pore sizes and suitable functionalizations of the framework allow for an adjustment of the static selectivity. Here we report membranes which offer dynamic control of the selectivity by remote signals, thus enabling a continuous adjustment of the permeate flux. This is realized by assembling linkers containing photoresponsive azobenzene-side-groups into monolithic, crystalline membranes of metal-organic frameworks. The azobenzene moieties can be switched from the trans to the cis configuration and vice versa by irradiation with ultraviolet or visible light, resulting in a substantial modification of the membrane permeability and separation factor. The precise control of the cis:trans azobenzene ratio, for example, by controlled irradiation times or by simultaneous irradiation with ultraviolet and visible light, enables the continuous tuning of the separation. For hydrogen:carbon-dioxide, the separation factor of this smart membrane can be steplessly adjusted between 3 and 8.