Microbiota-directed complementary food (MDCF) formulations have been designed to repair the gut communities of malnourished children. A randomized controlled trial demonstrated that one formulation, MDCF-2, improved weight gain in malnourished Bangladeshi children compared to a more calorically dense standard nutritional intervention. Metagenome-assembled genomes from study participants revealed a correlation between ponderal growth and expression of MDCF-2 glycan utilization pathways by Prevotella copri strains. To test this correlation, here we use gnotobiotic mice colonized with defined consortia of age- and ponderal growth-associated gut bacterial strains, with or without P. copri isolates closely matching the metagenome-assembled genomes. Combining gut metagenomics and metatranscriptomics with host single-nucleus RNA sequencing and gut metabolomic analyses, we identify a key role of P. copri in metabolizing MDCF-2 glycans and uncover its interactions with other microbes including Bifidobacterium infantis. P. copri-containing consortia mediated weight gain and modulated energy metabolism within intestinal epithelial cells. Our results reveal structure–function relationships between MDCF-2 and members of the gut microbiota of malnourished children with potential implications for future therapies.