The development of a new Neodymium/Dysprosium metal–organic framework, referred to as Nd/Dy-BTC MOF, based on benzene-1,2,4-tricarboxylic acid, has been achieved through an in situ growth process on 2D transition metal carbides (MXene) surfaces. This synthesis was conducted via a solvothermal method utilizing a solvent mixture of water, ethanol, and dimethylformamide. The primary objective of this research is to investigate the framework’s efficacy as a photocatalyst for the degradation of anionic dye, as well as its potential for sensing certain explosives. The Nd/Dy-MOF@MXene has been characterized by various analysis techniques. The prepared Nd/Dy-MOF@MXene was utilized as catalyst in selective degradation of methyl orange dye. The study examined the influence of pH and catalyst concentration, revealing that the catalyst achieves peak efficiency of 93.55% when exposed to sunlight in an acidic medium. The reusability of the catalyst shows the highest efficient photocatalyst after four cycles of reusability. The detection of explosives, specifically 2,4,6-trinitrophenol, through photoluminescence techniques has been conducted, utilizing the Stern-Volmer equation to evaluate the quenching efficiency. The findings indicated remarkable efficiency and selectivity of Nd/Dy-MOF@MXene for 2,4,6-trinitrophenol, achieving a quenching efficiency of 91%. Furthermore, the reusability tests demonstrated that Nd/Dy-MOF@MXene exhibits outstanding recyclability, maintaining performance over five cycles. The antibacterial activity of Nd/Dy-MOF@MXene was investigated against Gram-positive and Gram-negative strains due to indication of medicine properties of Nd/Dy-MOF@MXene.