Previous studies have suggested a potential association between the gut microbiota and arthritis. However, the causal links between the gut microbiota and various types of arthritis, as well as the potential mediating role of inflammatory proteins, remain unclear. Mendelian randomization was used to explore the causal relationships between gut microbiota, inflammatory proteins, and various forms of arthritis (osteoarthritis, rheumatoid and psoriatic arthritis, and ankylosing spondylitis [AS]). The inverse variance-weighted method was the primary analytical approach used. Furthermore, we examined the mediating role of inflammatory proteins in the pathway linking the gut microbiota to arthritis. Sensitivity analyses were performed to verify the robustness of the findings, and enrichment analyses were conducted to investigate the biological functions and pathways involved. We identified 11 positive and 14 negative causal effects linking the genetic liability of the gut microbiota to arthritis. Similarly, 9 positive and 8 negative causal effects between inflammatory proteins and arthritis were identified. Notably, an increased abundance of the order Bacillales (odds ratio [OR] = 1.199, 95% confidence interval [CI] = 1.030–1.394, P = 0.019) and higher interleukin-7 levels (OR = 1.322, 95% CI = 1.004–1.741, P = 0.046) significantly elevated the risk of AS. Furthermore, interleukin-7 mediated 13.8% of the effect caused by the order Bacillales, with a mediation effect size of β = 0.025 (95% CI = 0.001–0.064). Sensitivity and supplementary analyses revealed no significant evidence of horizontal pleiotropy or heterogeneity. Overall, our findings demonstrate causal links between the gut microbiota, inflammatory proteins, and four arthritis types, highlighting the gut microbiota as a potential therapeutic target. Crucially, interleukin-7 not only strongly correlated with AS but also partially mediated the effect exerted by the gut microbiota on AS, suggesting that managing the gut microbiota to modulate inflammatory proteins could serve as an effective therapeutic strategy for arthritis.