•FMT attenuates cognitive deficits in Fmr1 KO mice•FMT ameliorates social novelty preference•↓A. muciniphila in Fmr1 KO mice•A. muciniphila reduces TNF-α in the cortex and hippocampus•FMT normalized the increased expression level of Iba1. Here, TNF is linked to Cognitive impairment.