Introduction: The incidence and mortality of female breast cancer remain high, and the immune microenvironment of breast cancer has undergone significant alterations. However, the impact of blood immune cell levels on the risk of breast cancer is not fully understood. Therefor this study aims to investigate the causal relationship between blood immune cell levels and the risk of breast cancer.Methods: A Mendelian randomization (MR) analysis was employed to assess the causal relationship between immune cells and the risk of breast cancer, as along with their potential mediating factors. Genetic statistics of metabolites breast cancer and immune cells were obtained from the GWAS Catalog, while the genome-wide association study (GWAS) statistics of breast cancer were extracted from the UK biobank. Two-sample MR analysis were performed using inverse-variance weighted (IVW) to ascertain the causal association between immune cells and the risk of breast cancer. Furthermore, 1,400 metabolites were analyzed for their mediating role between immune cells and the risk of breast cancer.Results: MR analysis through IVW method revealed that genetically predicted CD24+ CD27+ B cells were associated with a decreased risk of breast cancer (OR = 0.9978, 95% CI: 0.996–0.999, p = 0.001), while IgD- CD38+ B cells were linked to an increased risk of breast cancer (OR = 1.002, 95% CI: 1.001–1.004, p = 0.005). Additional CD14+ CD16+ monocytes were associated with an increased risk of breast cancer (OR = 1.000, 95% CI: 1.000–1.001, p = 0.005). Mediation analysis revealed a positive causal relationship between IgD- CD38+ B cells and Glycerate levels, with the latter also exhibiting a positive causal relationship with the risk of breast cancer (p < 0.05). Conversely, IgD- CD38+ B cells displayed a negative causal relationship with Succinoyltaurine levels, and the latter also demonstrated a negative causal relationship with the risk of breast cancer (p < 0.05).Conclusion: This MR study provides novel genetic evidence supporting a causal relationship between IgD- CD38+ B cells and the risk of BC. Moreover, it is identified that IgD- CD38+ B cells contribute to an increased risk of BC through both positive and negative mediation effects involving Glycerate and Succinoyltaurine.