This article reports a green process for synthesizing MgO nanoparticles supported by the exfoliated g-C3N4 nanocomposite. Various techniques characterize were employed for the prepared MgO, g-C3N4 and MgO/g-C3N4 nanocomposites. The cubic and hexagonal phase structure was achieved for synthesized MgO NPs and g-C3N4, respectively, with spherical and curled ribbon-like morphology. The specific surface area was obtained as 70.48, 54.22 and 79.11 m2/g, respectively, for MgO, g-C3N4 and MgO/g-C3N4 nanocomposite. Similarly, corresponding optical properties were achieved with an energy gap of 3.42, 2.48, and 2.78 eV. XPS analysis confirms the purity of MgO/g-C3N4 nanocomposite by detecting their characteristic elemental peaks. The bioactivities of MgO, g-C3N4 and MgO/g-C3N4 nanocomposite, including antibacterial, turbidimetric and antioxidant efficacy, were investigated. The antibacterial activity was Gram-positive bacterial strains are more susceptible to treatment than Gram-negative ones due to the increased production of ROS in the MgO/g-C3N4 nanocomposite. Further, MgO, g-C3N4 and MgO/g-C3N4 nanocomposite were employed as catalysts for the degradation of cationic substances (Crystal Violet) and anionic (Eosin Yellow) dye under sunlight irradiation. Their photocatalytic activity towards CV and EY degradation of dyes was highly influenced, and efficiency of 98.9% and 97.33% for MgO/g-C3N4 nanocomposite. Therefore, the increased surface area with the active site and UV-Visible region of MgO/g-C3N4 is more suitable for dye effluent treatment.