Cirrhosis is associated with brain dysfunction known as hepatic encephalopathy (HE). The mechanisms behind HE are unclear although hyperammonemia and systemic inflammation through gut dysbiosis have been proposed. We aimed to define the individual contribution of specific gut bacterial taxa towards astrocytic and neuronal changes in brain function using multi-modal MRI in patients with cirrhosis. 187 subjects (40 controls, 147 cirrhotic; 87 with HE) underwent systemic inflammatory assessment, cognitive testing, stool microbiota analysis and brain MRI analysis. MR spectroscopy (MRS) changes of increased Glutamate/glutamine, reduced myo-inositol and choline are hyperammonemia-associated astrocytic changes, while diffusion tensor imaging (DTI) demonstrates changes in neuronal integrity and edema. Linkages between cognition, MRI parameters and gut microbiota were compared between groups. We found that HE patients had a significantly worse cognitive performance, systemic inflammation, dysbiosis and hyperammonemia compared to controls and cirrhotics without HE. Specific microbial families (autochthonous taxa negatively and Enterobacteriaceae positively) correlated with MR spectroscopy and hyperammonemia-associated astrocytic changes. On the other hand Porphyromonadaceae, were only correlated with neuronal changes on DTI without linkages with ammonia. We conclude that specific gut microbial taxa are related to neuronal and astrocytic consequences of cirrhosis-associated brain dysfunction.