The gut microbiota benefits humans via short-chain fatty acid (SCFA) production from carbohydrate fermentation, and deficiency in SCFA production is associated with type 2 diabetes mellitus (T2DM). We conducted a randomized clinical study of specifically designed isoenergetic diets, together with fecal shotgun metagenomics, to show that a select group of SCFA-producing strains was promoted by dietary fibers and that most other potential producers were either diminished or unchanged in patients with T2DM. When the fiber-promoted SCFA producers were present in greater diversity and abundance, participants had better improvement in hemoglobin A1c levels, partly via increased glucagon-like peptide-1 production. Promotion of these positive responders diminished producers of metabolically detrimental compounds such as indole and hydrogen sulfide. Targeted restoration of these SCFA producers may present a novel ecological approach for managing T2DM.