Depression and anxiety are serious psychiatric disorders with significant physical and mental health impacts, necessitating the development of safe and effective treatments. This study aimed to evaluate the efficacy of Jiangshi oligosaccharide (JSO), a type of inulin-based oligosaccharide, in alleviating anxiety and depression and to investigate the underlying molecular mechanisms. Using a mouse model of chronic restraint stress (CRS), JSO was administered orally at doses of 50, 100, and 200 mg/kg for 21 days. Behavioral tests, including the novelty-suppressed feeding test (NSFT), open field test (OFT), elevated plus maze test (EPMT), tail suspension test (TST), and forced swimming test (FST), demonstrated that JSO significantly improved anxiety- and depressive-like behaviors (P< 0.05). Notably, JSO reduced feeding latency in the NSFT, increased time spent in the center in the OFT, enhanced time and entries into open arms in the EPMT, and decreased immobility time in the TST and FST (P< 0.01). Histological and molecular analyses revealed that JSO treatment attenuated neuronal loss in the hippocampus (Hip) and medial prefrontal cortex (mPFC) and reduced the expression of inflammatory markers such as Iba-1 and GFAP in these regions. JSO significantly downregulated the mRNA and protein expression of pro-inflammatory factors (IL-1β, TNF-α, IL-6) while increasing anti-inflammatory markers (IL-10, TGF-β) (P< 0.05). Furthermore, JSO inhibited the c-GAS-STING-NLRP3 axis and apoptosis-related proteins (Bax/Bcl-2, Caspase-3/8/9) while promoting the expression of brain-derived neurotrophic factor (BDNF), PSD-95, and synaptophysin (SYP), indicating improved neuronal survival and synaptic plasticity (P< 0.01). These findings suggest that JSO exerts potent anti-anxiety and antidepressant effects by modulating neuroinflammation, synaptic function, and neuronal apoptosis in the Hip and mPFC of CRS mice. This study highlighted JSO as a potential therapeutic agent for stress-induced anxiety and depression.