The findings enhance the understanding of the tumor immune microenvironment in GC and propose new immunotherapeutic targets. The T cell marker gene-based risk score offers a potential tool for gastroenterologists to tailor treatment plans more precisely according to the cancer's severity.