BackgroundConstipation is a prevalent gastrointestinal disorder affecting approximately 15% of the global population, leading to significant healthcare burdens. Emerging evidence suggests that gut microbiota plays a pivotal role in the pathogenesis of constipation, although causality remains uncertain due to potential confounding factors in observational studies. This study aims to clarify the causal relationships between gut microbiota and constipation using a bidirectional Mendelian Randomization (MR) approach, which helps to overcome confounding issues and reverse causality.MethodsUtilizing data from genome-wide association studies (GWAS) from the MiBioGen consortium and other sources, we identified genetic variants as instrumental variables (IVs) for 196 bacterial traits and constipation. These IVs were rigorously selected based on their association with the traits and absence of linkage with confounding factors. We applied several MR methods, including Inverse Variance Weighted (IVW), MR Egger, and MR-PRESSO, to examine the causal effects in both directions.ResultsOur analysis revealed a significant causal relationship where specific bacterial taxa such as Coprococcus1 (OR = 0.798, 95%CI: 0.711–0.896, p < 0.001), Coprococcus3 (OR = 0.851, 95%CI: 0.740–0.979, p = 0.024), Desulfovibrio (OR = 0.902, 95%CI: 0.817–0.996, p = 0.041), Flavonifractor (OR = 0.823, 95%CI: 0.708–0.957, p < 0.001), and Lachnospiraceae UCG004, whereas others including Ruminococcaceae UCG005 (OR = 1.127, 95%CI: 1.008–1.261, p = 0.036), Eubacterium nodatum group (OR = 1.080, 95%CI: 1.018–1.145, p = 0.025), Butyricimonas (OR = 1.118, 95%CI: 1.014–1.233, p = 0.002), and Bacteroidetes (OR = 1.274, 95%CI: 1.014–1.233, p < 0.001) increase constipation risk. In the reverse MR analysis, constipation was found to influence the abundance of certain taxa, including Family XIII, Porphyromonadaceae, Proteobacteria, Lentisphaeria, Veillonellaceae, Victivallaceae, Catenibacterium, Sellimonas, and Victivallales, indicating a bidirectional relationship. Sensitivity analyses confirmed the robustness of these findings, with no evidence of heterogeneity or horizontal pleiotropy.ConclusionThe relationship between our study gut microbiota and constipation interacts at the genetic level, which gut microbiota can influence the onset of constipation, and constipation can alter the gut microbiota. Coprococcus1, Coprococcus3, Desulfovibrio, Flavonifractor and Lachnospiraceae UCG004 play a protective role against constipation, while Ruminococcaceae UCG005, Eubacterium nodatum group, Butyricimonas, and Bacteroidetes are associated with an increased risk. In addition, constipation correlates positively with the abundance of Family XIII, Porphyromonadaceae and Proteobacteria, while negatively with Lentisphaeria, Veillonellaceae, Victivallaceae, Catenibacterium, Sellimonas, and Victivallales.