Cordycepin is considered a major bioactive component in Cordyceps militaris extract. This study was performed to evaluate the ameliorative effect of Cordyceps militaris extract (CME) and cordycepin (CPN) supplementation on intestinal damage in LPS-challenged piglets. The results showed that CPN or CME supplementation significantly increased the villus height (p < 0.01) and villus height/crypt depth ratio (p < 0.05) in the jejunum and ileum of piglets with LPS-induced intestinal inflammation. Meanwhile, CPN or CME supplementation alleviated oxidative stress and inflammatory responses by reducing the levels of MDA (p < 0.05) and pro-inflammatory cytokines in the serum. Additionally, supplementation with CPN or CME modulated the structure of the intestinal microbiota by enriching short-chain fatty acid-producing bacteria, and increased the level of butyrate (p < 0.05). The RNA-seq results demonstrated that CME or CPN altered the complement and coagulation-cascade-related genes (p < 0.05), including upregulating gene KLKB1 while downregulating the genes CFD, F2RL2, CFB, C4BPA, F7, C4BPB, CFH, C3 and PROS1, which regulate the complement activation involved in inflammatory and immune responses. Correlation analysis further demonstrated the potential relation between the gut microbiota and intestinal inflammation, oxidative stress, and butyrate in piglets. In conclusion, CPN or CME supplementation might inhibit LPS-induced inflammation and oxidative stress by modulating the intestinal microbiota and its metabolite butyrate in piglets.