The trade-off between permeability and selectivity, along with the issue of membrane fouling, has constrained the widespread application of ultrafiltration (UF) membranes in recycling rare earth wastewater. Here, we present the incorporation of tannic acid (TA) modified molybdenum disulfide oxide (O-MoS2) as a functional enhancer to fabricate polyethersulfone (PES) based mixed matrix membranes through a nonsolvent induced phase separation (NIPS) approach. Compared to the unmodified PES membrane, the integration of TA-O-MoS2 significantly improves the hydrophilicity, porosity in the mixed matrix membrane. By altering the concentration of TA-O-MoS2, the TA-O-MoS2/PES UF membrane achieves enhanced hydrophilicity and charge properties, resulting in a remarkable improvement in separation performance. Specifically, the optimized membrane M2 (TA-O-MoS2 addition of 0.1 wt%) exhibits a water flux of 140.98 Lm−2h−1bar−1 and a PEG 20000 rejection rate of 91.00 %, representing increases of 180 % and 120 % over the control PES membrane, respectively. Notably, membrane M2 effectively retains 91.31 % of macromolecular organic compounds in rare earth wastewater, while permitting nearly complete passage of inorganic salts, for instance CaCl2 (3.26 %) and MgSO4 (4.84 %). Moreover, the TA-O-MoS2/PES membrane demonstrates robust antifouling properties and exceptional durability, indicating its significant potential for efficient treatment and resource recovery in rare earth wastewater.