BackgroundPrevious researches have suggested a significant connection between the gut microbiota/immune cells and morphine tolerance (MT), but there is still uncertainty regarding their causal relationship. Hence, our objective is to inverstigate this causal association and reveal the impact of gut microbiota/immune cells on the risk of developing MT using a two-sample Mendelian randomization (MR) study.MethodsWe conducted a comprehensive analysis using genome-wide association study (GWAS) summary statistics for gut microbiota, immune cells, and MT. The main approach employed was the inverse variance-weighted (IVW) method in MR. To assess horizontal pleiotropy and remove outlier single-nucleotide polymorphisms (SNPs), we utilized the Mendelian randomization pleiotropy residual sum and outlier (MR-PRESSO) technique as well as MR-Egger regression. Heterogeneity detection was performed using Cochran’s Q-test. Additionally, leave-one-out analysis was carried out to determine if any single SNP drove the causal association signals. Finally, we conducted a reverse MR to evaluate the potential of reverse causation.ResultsWe discovered that 6 gut microbial taxa and 16 immune cells were causally related to MT (p < 0.05). Among them, 2 bacterial features and 9 immunophenotypes retained a strong causal relationship with lower risk of MT: genus. Lachnospiraceae NK4A136group (OR: 0.962, 95% CI: 0.940–0.987, p = 0.030), genus. RuminococcaceaeUCG011 (OR: 0.960, 95% CI: 0.946–0.976, p = 0.003), BAFF-R on B cell (OR: 0.972, 95% CI: 0.947–0.998, p = 0.013). Furthermore, 4 bacterial features and 7 immunophenotypes were identified to be significantly associated with MT risk: genus. Flavonifractor (OR: 1.044, 95% CI: 1.017–1.069, p = 0.029), genus. Prevotella9 (OR: 1.054, 95% CI: 1.020–1.090, p = 0.037), B cell % CD3-lymphocyte (OR: 1.976, 95% CI: 1.027–1.129, p = 0.026). The Cochrane’s Q test revealed no heterogeneity (p > 0.05). Furthermore, the MR-Egger and MR-PRESSO analyses reveal no instances of horizontal pleiotropy (p > 0.05). Besides, leave-one-out analysis confirmed the robustness of MR results. After adding BMI to the multivariate MR analysis, the gut microbial taxa and immune cells exposure-outcome effect were attenuated.ConclusionOur research confirm the potential link between gut microbiota and immune cells with MT, shedding light on the mechanism by which gut microbiota and immune cells may contribute to MT. These findings lay the groundwork for future investigations into targeted prevention strategies.