Over the past decade, we have contributed to the chemistry of microbial natural products and synthetic ligands, related to riboflavin and uracils, that modulate immune cells called mucosal associated invariant T cells (MAIT cells). These highly abundant T lymphocytes were only discovered in 2003 and have become recognized for their importance in mammalian immunology. Unlike other T cells, MAIT cells are not activated by peptide or lipid antigens. In collaboration with immunology and structural biology research groups, we discovered that they are instead activated by unstable nitrogen-containing heterocycles synthesized by bacteria. The most potent naturally occurring activating compound (antigen) is 5-(2-oxopropylideneamino)-d-ribitylaminouracil (5-OP-RU). This compound is an imine (Schiff base) formed through condensation between an intermediate in the biosynthesis of riboflavin (vitamin B2) and a metabolic byproduct of mammalian and microbial glycolysis. Although it is very unstable in water due to intramolecular ring closure or hydrolysis, we were able to develop a non-enzymatic synthesis that yields a pure kinetically stable compound in a nonaqueous solvent. This compound has revolutionized the study of MAIT cell immunology due to its potent activation (EC50 = 2 pM) of MAIT cells and its development into immunological reagents for detecting and characterizing MAIT cells in tissues. MAIT cells are now linked to key physiological processes and disease, including antibacterial defense, tissue repair, regulation of graft-vs-host disease, gastritis, inflammatory bowel diseases, and cancer. 5-OP-RU activates MAIT cells and, like a vaccine, has been shown to protect mice from bacterial infections and cancers. Mechanistic studies on the binding of 5-OP-RU to its dual protein targets, the major histocompatibility complex class I related protein (MR1) and the MAIT cell receptor (MAIT TCR), have involved synthetic chemistry, 2D 1H NMR spectroscopy, mass spectrometry, computer modeling and molecular dynamics simulations, biochemical, cellular, and immunological assays, and protein structural biology. These combined studies have revealed structural influences for 5-OP-RU in solution on protein binding and antigen presentation and potency; informed the development of potent (EC50 = 2 nM) and water stable analogues; led to fluorescent analogues for detecting and tracking binding proteins in and on cells; and enabled discovery of drugs and drug-like molecules that bind MR1 and modulate MAIT cell function. MAIT cells offer new opportunities for chemical synthesis to enhance the stability, potency, selectivity, and bioavailability of small molecule ligands for MR1 or MAIT TCR proteins, and to contribute to the understanding of T cell immunity and the development of prospective new immunomodulating medicines.