Sepsis, a life-threatening condition, involves complex interactions among metabolic alterations, inflammatory mediators, and host responses. This study utilized a bidirectional Mendelian randomization approach to investigate the causal relationships between 1400 metabolites and sepsis, and the mediating role of inflammatory factors. We identified 36 metabolites significantly associated with sepsis (p < 0.05), with AXIN1, FGF-19, FGF-23, IL-4, and OSM showing an inverse association, suggesting a protective role, while IL-2 exhibited a positive correlation, indicating a potential risk factor. Among these metabolites, Piperine and 9-Hydroxystearate demonstrated particularly interesting protective effects against sepsis. Piperine’s protective effect was mediated through its interaction with AXIN1, contributing to a 16.296% reduction in sepsis risk. This suggests a potential pathway where Piperine influences sepsis outcomes by modulating AXIN1 levels. 9-Hydroxystearate also exhibited a protective role against sepsis, mediated through its positive association with FGF-19 and negative association with IL-2, contributing 9.436% and 12.565%, respectively, to its protective effect. Experimental validation confirmed significantly elevated IL-2 levels and reduced FGF-19, AXIN1, piperine, and 9-hydroxyoctadecanoic acid levels in sepsis patients compared to healthy controls. Piperine levels positively correlated with AXIN1, while 9-hydroxyoctadecanoic acid levels negatively correlated with IL-2 and positively correlated with FGF-19, supporting the Mendelian randomization findings. Our findings provide insights into the molecular mechanisms of sepsis, highlighting the unique roles and contributions of specific metabolites and their interactions with inflammatory mediators. This study enhances our understanding of sepsis pathophysiology and opens avenues for targeted therapeutic interventions and biomarker development for sepsis management. However, further research is essential to validate these pathways across diverse populations and fully explore the roles of these metabolites in sepsis.