Endophytic fungus Penicillium crustosum EP-1 was used to create spherical shape magnesium oxide nanoparticles (MgO-NPs). The MgO-NPs possess a crystalline structure with sizes of 8–35 nm. The weight percentages of Mg and O were 42.44% and 30.13%, respectively, as shown in energy-dispersive X-ray analysis. In addition, analysis involving dynamic light scattering indicated the uniformity of MgO-NPs within the colloidal solution. These NPs displayed a polydispersity index of 0.341 and held a surface charge of −29.7 mV. A field experimental was carried out to assess the outcome of foliar spraying of MgO-NPs at 5, 10, and 20 ppm on the growth, yield, and metabolic activities of Nigella sativa L. Our results indicated that MgO-NPs significantly enhanced various growth parameters, including chlorophyll content (both a and b), total carotenoids, carbohydrate and protein levels in both shoots and seeds, as well as free proline concentration, compared to the control plants at both 55 and 75 days after planting. In addition, all yield traits were markedly increased. Moreover, high-performance liquid chromatography is employed for the identification of phenolic compounds within the seeds. Data indicated that sex phenolic acids, two phenols, and five flavonoids were present with high concentrations due to MgO-NPs treatment as opposed to untreated plants.