Mechanically, we found that MgSO<sub>4</sub> inhibited microglia activation and BBB damage, possibly by suppressing IKK/NF-κB and NLRP3 inflammasome signaling pathways.<h4>Conclusion</h4>Our findings showed that MgSO<sub>4</sub> supplementation played an active role in the prevention and treatment of depression. This evidence concerns the gene NLRP3 and depressive symptom measurement.