Cervical cancer, a prevalent gynecological malignant tumor, poses a significant threat to women's health and lives. Immune checkpoint inhibitor (ICI) therapy has emerged as a promising avenue for treating cervical cancer. For patients with persistent or recurrent metastatic cervical cancer, If the sequence of dead receptor ligand-1 (PD-L1) is positive, ICI show significant clinical efficacy. PD-L1 expression serves as a valuable biomarker for assessing ICI therapeutic efficacy. However, the complex tumor immune microenvironment (TIME), encompassing immune cell composition and tumor-infiltrating lymphocyte (TIL) status, also exerts a profound influence on tumor immunity and prognosis. Given the remarkable strides made by ICI treatments in improving the survival rates of cervical cancer patients, it becomes essential to identify a comprehensive biomarker that integrates various TIME aspects to enhance the effectiveness of ICI treatment. Therefore, the quest for biomarkers linked to multiple facets of TIME in cervical cancer is a vital pursuit. In this study, we have developed an Immune-Associated Gene Prognostic Index (IRGPI) with remarkable prognostic value specifically for cervical squamous cell carcinoma and endocervical adenocarcinoma (CESC). The Cancer Genome Atlas CESC dataset (n = 305) was meticulously analyzed to pinpoint key immune-related genes via weighted gene co-expression network analysis and differential gene expression assays. Subsequently, we employed Cox regression analysis to construct the IRGPI. Furthermore, the composition of immune cells and TIL status were examined using CIBERSORT and TIDE. Tumor expression of Epigen, LCN10, and P73 were determined with immunohistochemistry. The resulting IRGPI, composed of EPGN, LCN10, and TP73 genes, displayed a strong negative correlation with patient survival. The discovery was validated with a patient cohort from our hospital. The IRGPI not only predicts the composition of immune cell subtypes such as Macrophages M1, NK cells, Mast cells, Plasma cells, Neutrophils, Dendritic cells, T cells CD8, and T cells CD4 within CESC, but also indicates TIL exclusion, dysfunction, and PD-1 and PD-L1 expression. Therefore, the IRGPI emerges as a promising biomarker not only for prognostic assessment but also for characterizing multiple immune features in CESC. Additionally, our results underscored the significant associations between the IRGPI and immune cell composition, TIL exclusion, and dysfunction, along with PD-1 and PD-L1 expression in the TIME. Consequently, the IRGPI stands out as a biomarker intimately connected to both the survival and TIME status of CESC patients, offering potential insights into immunotherapy strategies for CESC.