MXene attracts extensive interest due to its unique physicochemical properties and adjustable transmission channels. However, severe membrane fouling has made the separation performance below the theoretical prediction. Introducing solar energy into membrane filtration is fascinating to address this issue. Inspired by nature, here, we constructed an advanced 0D/2D/2D MXene-based heterogeneous layered membrane by coupling the graphitic carbon nitride (g-C3N4) and Ti3C2Tx (MXene) nanosheets. The titanium dioxide nanoparticles (TiO2 NPs) and oxygen vacancies were in-situ generated due to the thermodynamical metastability of the Ti3C2Tx nanosheets. The produced TiO2 NPs can broaden the transmission channel and endow this membrane with anti-fouling capacity. Meanwhile, the oxygen vacancy can capture the photogenerated electron and promote effective electron-hole pairs separation. The 0D/2D/2D heterojunction presented a broader light-absorption capacity. Notably, the designed membrane endowed a smaller bandgap (∼2.27 eV), which was lower than most previous reports. These features granted it superior self-cleaning ability. Hence, it kept its excellent separation and catalytic degradation capacity with flux recovery ratio greater than 98% after cyclic experiment. The remarkable self-cleaning capability of this membrane manifests its attractive potential application in low-energy and sustainable water purification.