Background: Emerging evidence supports gut microbiota's association with mental distress, particularly depression and anxiety, the microbiota-gut-brain axis was the believed to be the underlying mechanism. This study investigated the causal relationships between specific gut microbiota and depression and anxiety disorders using large-scale genome-wide association study (GWAS) data. Methods: A two-sample bidirectional Mendelian randomization (MR) analysis was conducted to explore the causal effects of 211 microbial taxa on depression and anxiety across three large GWAS databases: FinnGen, PanUKBB, and PGC. Sensitive analyses were followed to validate the robustness of results. Random-effect meta-analysis was further performed to enhance the statistical power. Results: The MR analysis revealed that the Bifidobacteriales (IVW: OR 0.90, 95 %CI 0.83 to 0.98) and Bifidobacteriaceae (IVW: OR 0.90, 95 %CI 0.83 to 0.98) had a protective effect against depression. Clostridiales (cMLMA: OR 0.88, 95 %CI 0.81 to 0.95) and Parasutterella (cML-MA: OR 0.75, 95 %CI 0.64 to 0.88) showed negative associations with depression. Increased abundance of Oxalobacteraceae (cML-MA: OR 1.78, 95 %CI 1.24 to 2.56), Deltaproteobacteria (cML-MA: OR 2.17, 95 %CI 1.38 to 3.40), and Desulfovibrionales (cML-MA: OR 2.22, 95 %CI 1.41 to 3.49) was associated with a higher risk of depression. For anxiety, protective effects were found for Actinobacteria (phylum: IVW: OR 0.83, 95 %CI 0.76 to 0.87; class: IVW: OR 0.84, 95 %CI 0.75 to 0.93), Bifidobacteriales (IVW: OR 0.80, 95 %CI 0.75 to 0.85), Bifidobacteriaceae (IVW: OR 0.80, 95 %CI 0.75 to 0.85) and Bifidobacterium [g] (IVW: OR 0.79, 95 %CI 0.74 to 0.84). Lactobacillaceae [f] (cML-MA: OR 1.18, 95 %CI 1.08 to 1.28), Clostridia [c] (cML-MA: OR 1.15, 95 %CI 0.1.06 to 1.26) and Clostridiales [o] (IVW: OR 1.15, 95 %CI 1.05 to 1.27) were associated with increased anxiety risk. Meta-analysis results indicated significant associations, particularly the protective effects of Actinobacteria (OR 0.90, 95 % CI, 0.83 to 0.98) and Clostridiaceae1 (OR 0.91, 95 % CI, 0.83 to 0.99) on depression and several taxa on anxiety. No significant instrumental variables for depression or anxiety on gut microbiota were identified. Conclusions: Our findings highlight specific gut microbiota that are associated with depression and anxiety, underscoring the causal relationships between these intestinal microbes and psychiatric disorders. These results suggest potential strategies for mitigating disease symptoms and improving quality of life through microbiometargeted therapies. Further studies, including randomized controlled trials and investigations into sex-specific effects, are essential to validate and expand upon these findings.