In this study, magnesium oxide (MgO) nanoparticles were produced using Strychnous potatorum (SP), Moringa oleifera (MO) seed extracts, and its SP-MO mixed extract to effectively remove the malachite green and congo red dyes in textile water bodies. The structural clarity, particle size, morphology, surface area, porosity features, band gap, and surface potential charge of the MgO NPs were determined. The phytochemical components in the seed extract acted as a reducing agent and a surfactant during green synthesis and considerably improved the surface characteristics of MgO NPs. At various concentrations (25, 50, and 100 mg ml−1), the antibacterial properties of all the MgO NPs were tested against the pathogens Escherichia coli and Staphylococcus aureus. The nanoparticles prepared from SP-MO mixed extract (named MgO-M NPs) have the central zone of inhibition with 17 and 22 mm and efficiency of 96 and 91 %, respectively, for E. coli and S. aureus. Further, its DPPH scavenging activity observed that MgO-M NPs have more antioxidant properties with an efficiency of 91 %. The malachite green and congo red were examined for photocatalytic degradation under sunlight irradiation in the presence of various MgO NPs for 120 mins. The results observed that MgO-M NPs with high surface charge (- 43 mv) possessed high photocatalytic activity towards anionic-malachite green dyes (98.5 %) compared to cationic-congo red dyes (95.8 %). After dye degradation, MgO NPs retained their structural phase stability and functional characteristics, analyzed through XRD and FTIR studies.