BackgroundSeveral reports in recent years have found an association between gut microbiota and upper urinary urolithiasis. However, the causal relationship between them remains to be clarified.MethodsGenetic variation is used as a tool in Mendelian randomization for inference of whether exposure factors have a causal effect on disease outcomes. We selected summary statistics from a large genome-wide association study of the gut microbiome published by the MiBioGen consortium with a sample size of 18,340 as an exposure factor and upper urinary urolithiasis data from FinnGen GWAS with 4,969 calculi cases and 213,445 controls as a disease outcome. Then, a two-sample Mendelian randomization analysis was performed by applying inverse variance-weighted, MR-Egger, maximum likelihood, and weighted median. In addition, heterogeneity and horizontal pleiotropy were excluded by sensitivity analysis.ResultsIVW results confirmed that classDeltaproteobacteria(OR = 0.814, 95% CI: 0.666–0.995,P= 0.045), orderNB1n(OR = 0.833, 95% CI: 0.737–0.940,P= 3.15 × 10−3), familyClostridiaceae1(OR = 0.729, 95% CI: 0.581–0.916,P= 6.61 × 10−3), genusBarnesiella(OR = 0.695, 95% CI: 0.551–0.877,P= 2.20 × 10−3), genusClostridium sensu_stricto_1(OR = 0.777, 95% CI: 0.612–0.986,P= 0.0380), genusFlavonifractor(OR = 0.711, 95% CI: 0.536–0.944,P= 0.0181), genusHungatella(OR = 0.829, 95% CI: 0.690–0.995,P= 0.0444), and genusOscillospira(OR = 0.758, 95% CI: 0.577–0.996,P= 0.0464) had a protective effect on upper urinary urolithiasis, whileEubacterium xylanophilum(OR =1.26, 95% CI: 1.010–1.566,P= 0.0423) had the opposite effect. Sensitivity analysis did not find outlier SNPs.ConclusionIn summary, a causal relationship was found between several genera and upper urinary urolithiasis. However, we still need further randomized controlled trials to validate.