Concentrations of the secondary bile acid, deoxycholic acid (DCA), are aberrantly elevated in colorectal cancer (CRC) patients, but the consequences remain poorly understood. Here, we screened a library of gut microbiota-derived metabolites and identified DCA as a negative regulator for CD8+ T cell effector function. Mechanistically, DCA suppressed CD8+ T cell responses by targeting plasma membrane Ca2+ ATPase (PMCA) to inhibit Ca2+-nuclear factor of activated T cells (NFAT)2 signaling. In CRC patients, CD8+ T cell effector function negatively correlated with both DCA concentration and expression of a bacterial DCA biosynthetic gene. Bacteria harboring DCA biosynthetic genes suppressed CD8+ T cells effector function and promoted tumor growth in mice. This effect was abolished by disrupting bile acid metabolism via bile acid chelation, genetic ablation of bacterial DCA biosynthetic pathway, or specific bacteriophage. Our study demonstrated causation between microbial DCA metabolism and anti-tumor CD8+ T cell response in CRC, suggesting potential directions for anti-tumor therapy.