Using MR analysis with blood metabolites and immune cells causally related to NSCLC, it was found that Tetrahydrocortisol glucuronide levels are positively associated with IgD− CD27− %B cell (OR = 1.395, 95% CI = 1.089–1.787, P = .008), X-17357 levels are positively associated with CD27 on IgD- CD38dim (OR = 1.177, 95% CI = 1.006–1.378, P = .042), and X-17357 levels are negatively associated with CD3 on Naive CD4+ (OR = 0.823, 95% CI = 0.692–0.979, P = .028). The gene discussed is CD27; the disease is non-small cell lung carcinoma.