Recently, two-dimensional materials (2DM) have garnered considerable interest in the field of membrane separation owing to their distinctive microstructure and chemical properties. However, membrane fouling still limits the further application of 2DM in wastewater treatment. This work designed and constructed a series of novel composite membranes by introducing the photocatalyst NH2-MIL-88B (Fe) into the structure of 2D material MXene (Ti3C2TX) nanosheets. The membranes not only improved their ability to remove various dyes from wastewater but also achieved in-situ degradation of pollutants on the membrane surface and inner structure, demonstrating its self-cleaning ability. This work solved the critical technical problem of MXene-based membrane fouling, providing a good reference for its further practical application. In addition, it also developed a comprehensive experiment that involves principles of materials science, chemical separation, and environmental protection. By reforming the original experimental design, it is helpful for college students to master interdisciplinary basic knowledge, cultivating their innovation and practical ability. Hence, this work involves approaches is meaningful for both environmental protection and experimental teaching.