Both the brain and microbiome of humans develop rapidly in the first years of life, enabling extensive signaling between the gut and central nervous system (dubbed the “microbiome-gut-brain axis”). Emerging evidence implicates gut microorganisms and microbiota composition in cognitive outcomes and neurodevelopmental disorders (e.g., autism), but the influence of gut microbial metabolism on typical neurodevelopment has not been explored in detail. We investigated the relationship of the microbiome with the neuroanatomy and cognitive function of 281 healthy children in a cross-sectional analysis and demonstrated that differences in gut microbial taxa and gene functions are associated with the size of brain regions and with overall cognitive function. Many species, including Eubacterium eligens and Roseburia hominis, were associated with higher cognitive function, while some species such as Ruminococcus gnavus was more commonly found in children with low cognitive scores. Microbial enzymes involved in the metabolism of neuroactive compounds such as glutamate and GABA, were also associated with structure of the brain, including the first brain regions to develop such as the cerebellum, and with overall cognitive function.