Purpose: The intratumoral microorganisms participates in the progression and immunotherapy of colorectal cancer (CRC). However, due to technical limitations, the impact of microorganisms on CRC has not been fully understood. Therefore, we conducted a systematic analysis of relationship between bacterial lipopolysaccharide (LPS)-associated genes and immune cells to explore new biomarkers for predicting the prognosis of CRC. Methods: The single-cell RNA sequencing data and the Comparative Toxicogenomics Database were used to screen T cells-associated LPS-related genes (TALRGs). Then, we established and validated the TALRGs risk signature in The Cancer Genome Atlas Colon Adenocarcinoma (TCGA-COAD) cohort and GSE39582 cohort. Besides, we compared the differences in tumor-infiltrating immune cell types, immunotherapeutic response, somatic mutation profiles, and tumor mutation burden (TMB) between high-risk group and low-risk group. In addition, the immunotherapeutic cohort (Imvigor210) treated with an anti-PD-L1 agent was performed to explore the potential value of the TALRGs signature on immunotherapy. Results: Five prognostic TALRGs were identified and selected to build the prognostic model. The high-risk group had poor prognosis in both TCGA-COAD cohort (P < 0.0001) and GSE39582 cohort (P = 0.00019). The areas under the curves (AUCs) of TALRGs signature were calculated (TCGA-COAD cohort: 0.624 at 1 years, 0.639 at 3 years, 0.648 at 5 years; anti-PD-L1 cohort was 0.59). The high-risk group had advanced pathological stages and higher TMN stages in both TCGA-COAD cohort and GSE39582 cohort. The high-risk group had the higher infiltration of immunosuppressive cells, the expressions of immune checkpoint molecules, the IC50 values of chemotherapy drugs, and TP53 mutation rate (P < 0.05). In addition, patients with high TMB had worse prognosis (P < 0.05). Furthermore, the Imvigor210 also showed patients with high-risk scores had poor prognosis (platinum-treated cohort: P = 0.0032; non-platinum-treated cohort: P = 0.00017). Conclusions: Microorganisms are closely related to the tumor microenvironment to influence the progression and immune response of CRC via stimulating T cells through LPS-related genes. The TALRGs signature contributed to predict the prognosis and immunotherapy of CRC, and became new therapeutic targets and biomarkers of CRC.