The gastrointestinal tract, its resident microorganisms, and the central nervous system are connected by biochemical signaling, also known as "microbiome-gut-brain-axis." Both the human brain and the gut microbiome have critical developmental windows in the first years of life, raising the possibility that their development is co-occurring and likely co-dependent. Emerging evidence implicates gut microorganisms and microbiota composition in cognitive outcomes and neurodevelopmental disorders (e.g., autism and anxiety), 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 361 healthy children, demonstrating that differences in gut microbial taxa and gene functions are associated with overall cognitive function and with differences in the size of multiple brain regions. Using a combination of multivariate linear and machine learning (ML) models, we showed that many species, including Gordonibacter pamelae and Blautia wexlerae, were significantly associated with higher cognitive function, while some species such as Ruminococcus gnavus were more commonly found in children with low cognitive scores after controlling for sociodemographic factors. Microbial genes for enzymes involved in the metabolism of neuroactive compounds, particularly short-chain fatty acids such as acetate and propionate, were also associated with cognitive function. In addition, ML models were able to use microbial taxa to predict the volume of brain regions, and many taxa that were identified as important in predicting cognitive function also dominated the feature importance metric for individual brain regions. For example, B. wexlerae was the most important species in models predicting the size of the parahippocampal region in both the left and right hemispheres, while several species from the phylum Bacteroidetes, including GABA-producing B. ovatus, were important for predicting the size of the left accumbens area, but not the right. These findings provide potential biomarkers of neurocognition and brain development and may lead to the future development of targets for early detection and early intervention.