Background: Previous studies have indicated that the gut microbiota (GM) is associated with coronary artery disease (CAD), but the causality of these associations remains unestablished due to confounding factors and reverse causality. We conducted Mendelian randomization study (MR) to determine the causal effect of the specific bacterial taxa on CAD/myocardial infarction (MI) and identify the mediating factors involved.Methods: Two-sample MR, multivariable MR (MVMR) and mediation analysis were performed. Inverse-variance weighting (IVW) was the main method used to analyze causality, and sensitivity analysis was used to verify the reliability of the study. Causal estimates from CARDIoGRAMplusC4D and FinnGen databases were combined using the meta-analysis method, and repeated validation was conducted based on the UK Biobank (UKB) database. Confounders that may affect the causal estimates were corrected by MVMP and the potential mediation effects were investigated by using mediation analysis.Results: The study suggested that increased abundance of the RuminococcusUCG010 genus leads to a lower risk of CAD (OR, 0.88; 95% CI, 0.78, 1.00; p = 2.88 × 10−2) and MI (OR, 0.88; 95% CI, 0.79, 0.97; p = 1.08 × 10−2), with consistent results in both meta-analysis (CAD: OR, 0.86; 95% CI, 0.78, 0.96; p = 4.71 × 10−3; MI: OR, 0.82; 95% CI, 0.73, 0.92; p = 8.25 × 10−4) and repeated analysis of the UKB dataset (CAD: OR, 0.99; 95% CI, 0.99, 1.00, p = 2.53 × 10−4; MI: OR, 0.99; 95% CI, 0.99, 1.00, p = 1.85 × 10–11). Based on multiple databases, T2DM was proved as a mediating factor in the causal effect of RuminococcusUCG010 and CAD/MI, with an average mediation effect proportion of 20% on CAD and 17% on MI, respectively.Conclusion: This MR study provided suggestive genetic evidence that the higher the RuminococcusUCG010 abundance is, the lower the risk of CAD and MI, with T2DM playing a mediating effect. This genus may become a novel target in strategies for treating and preventing CAD and MI.