ObjectiveThe microbiota–gut–brain axis, especially the inflammatory pathway, may play a critical role in the pathogenesis of cognitive impairment in major depressive disorder (MDD). However, studies on the microbiota-inflammatory-cognitive function axis in MDD are lacking. The aim of the present study was to analyze the gut microbiota composition and explore the correlation between gut microbiota and inflammatory factors, cognitive function in MDD patients.MethodStudy participants included 66 first-episode, drug naïve MDD patients as well as 43 healthy subjects (HCs). The composition of fecal microbiota was evaluated using16S rRNA sequencing and bioinformatics analysis. The cytokines such as hs-CRP, IL-1β, IL-6, IL-10, and TNF-α in peripheral blood were detected via enzyme linked immunosorbent assay (ELISA); assessment of cognitive functions was performed using the Color Trail Test (CTT), The Repeatable Battery for the Assessment of Neuropsychological Status (RBANS) and the Stroop Color-Word Test (SCWT).ResultsWe found that compared with HCs, MDD patients had cognitive impairments and showed different α-diversity and β-diversity of gut microbiota composition. LDA effect size (LEfSe) analysis found MDD have higher Deinococcaceae and lower Bacteroidaceae, Turicibacteraceae, Clostridiaceae and Barnesiellaceae at family level. Deinococcus and Odoribacter was higher in the MDD group, however, Bacteroides, Alistipes, Turicibacter, Clostridium, Roseburia, and Enterobacter were lower at genus level. Furthermore, In MDD patients, the Bacteroidaceae and Bacteroides were both positively correlated with hsCRP, CCT1, CCT2. Alistipes was positively correlated with IL-6, Word time, Color time, Word-Color time, Color-Word time and negatively correlated with Delayed Memory, Total score and Standardized score. Turicibacteraceae and Turicibacter were both negatively correlated with IL-1β and IL-6.ConclusionThe present findings confirm that the gut microbiota in MDD patients have altered gut microbes that are closely associated with inflammatory factors and cognitive function in MDD patients.