Lifestyle modifications, metformin, and linagliptin reduce the incidence of type 2 diabetes (T2D) in people with prediabetes. The gut microbiota (GM) may enhance such interventions' efficacy. We determined the effect of linagliptin/metformin (LM) vs metformin (M) on GM composition and its relationship to insulin sensitivity (IS) and pancreatic β-cell function (Pβf) in patients with prediabetes. A cross-sectional study was conducted at different times: basal, six, and twelve months in 167 Mexican adults with prediabetes. These treatments increased the abundance of GM SCFA-producing bacteria M (Fusicatenibacter and Blautia) and LM (Roseburia, Bifidobacterium, and [Eubacterium] hallii group). We performed a mediation analysis with structural equation models (SEM). In conclusion, M and LM therapies improve insulin sensitivity and Pβf in prediabetics. GM is partially associated with these improvements since the SEM models suggest a weak association between specific bacterial genera and improvements in IS and Pβf.