Clubroot, caused by Plasmodiophora brassicae, is a major disease that significantly impairs the yield of cruciferous crops and causes significant economic losses across the globe. The prevention of clubroot, especially in tumorous stem mustard (without resistant varieties), are is limited and primarily relies on fungicides. Engineered nanoparticles have opened up new avenues for the management of plant diseases, but there is no report on their application in the prevention of clubroot. The results showed that the control efficacy of 500 mg/L MgO NPs against clubroot was 54.92%. However, when the concentration was increased to 1,500 and 2,500 mg/L, there was no significant change in the control effect. Compared with CK, the average fresh and dry weight of the aerial part of plants treated with MgO NPs increased by 392.83 and 240.81%, respectively. Compared with the F1000 treatment, increases were observed in the content of soil available phosphorus (+16.72%), potassium (+9.82%), exchangeable magnesium (+24.20%), and water-soluble magnesium (+20.64%) in the 1,500 mg/L MgO NPs treatment. The enzyme-linked immune sorbent assay (ELISA) results showed that the application of MgO NPs significantly increased soil peroxidase (POD, +52.69%), alkaline protease (AP, +41.21%), alkaline phosphatase (ALP, +79.26%), urease (+52.69%), and sucrase (+56.88%) activities; And also increased plant L-phenylalanine ammonla-lyase (PAL, +70.49%), polyphenol oxidase (PPO, +36.77%), POD (+38.30%), guaiacol peroxidase (POX, +55.46%) activities and salicylic acid (SA, +59.86%) content. However, soil and plant catalase (CAT, −27.22 and − 19.89%, respectively), and plant super oxidase dismutase (SOD, −36.33%) activities were significantly decreased after the application of MgO NPs. The metagenomic sequencing analysis showed that the MgO NPs treatments significantly improved the α-diversity of the rhizosphere soil microbial community. The relative abundance of beneficial bacteria genera in the rhizosphere soil, including Pseudomonas, Sphingopyxis, Acidovorax, Variovorax, and Bosea, was significantly increased. Soil metabolic functions, such as oxidative phosphorylation (ko00190), carbon fixation pathways in prokaryotes (ko00720), indole alkaloid biosynthesis (ko00901), and biosynthesis of various antibiotics (ko00998) were significantly enriched. These results suggested that MgO NPs might control clubroot by promoting the transformation and utilization of soil nutrients, stimulating plant defense responses, and enriching soil beneficial bacteria.