Intestinal inflammation shifts microbiota composition and metabolism. How the host monitors and responds to such changes remains unclear. Our findings show a protective mechanism by which the adaptive immune system monitors microbiota metabolites that are produced in response to colitis. This mechanism relies on Mucosal-associated invariant T (MAIT) cells, an evolutionary conserved T cell population recognizing intermediary adducts from the microbial riboflavin biosynthesis pathway. Experimental colitis using dextran salt sulfate (DSS) in mice resulted in increased concentrations of riboflavin and MAIT antigens in the caecum. Accordingly, metatranscriptomic analyses revealed a strong transcriptional activity of the riboflavin biosynthetic pathway genes during colitis. ribD, which controls bacterial production of the MAIT ligand precursor 5-A-RU, was predominantly expressed by the pathobiont Mucispirillum schaedleri, suggesting a major role for this bacterium in MAIT ligand production during colitis. Modulation of intestinal oxygen levels suggested a role for oxygen in inducing MAIT ligand production. MAIT ligands produced in the colon lumen rapidly crossed the intestinal barrier. MAIT cells from the colon, but also from the liver and spleen, received strong TCR signals during colitis, indicating activation by microbiota-derived ligands. Single-cell RNAseq analysis of colonic MAIT cells from control or chronic DSS-treated mice revealed a cluster of cells uniquely present during colitis which expressed genes involved in maintaining the gut barrier integrity. Mice devoid of MAIT cells (MR1-/-) suffered worse epithelial damage and intestinal inflammation, indicating a protective role for MAIT cells against colitis. MR1-/- mice were also more susceptible in a colitis-induced model of colorectal cancer. Of note, MAIT cell presence did not protect against colorectal tumor development in an orthotopic model, suggesting that MAIT cells alleviate inflammation-driven colonic tumorigenesis. Thus, MAIT cells monitor a bacterial metabolic pathway indicative of intestinal inflammation, providing host protection in return.