To explore the profound influence of immunity on the pathogenesis of MDD more deeply, we combined multiple bioinformatics approaches to identify four hub genes (TLR2, RETN, HP, and IL7R) as key biomarkers of MDD, they showed significant differential expression between MDD patients and HCs. Here, IL7R is linked to major depressive disorder.