The enzyme methylenetetrahydrofolate dehydrogenase-cyclohydrolase (MTHFD2) in the mitochondrial folate cycle plays oncogenic roles in different types of cancers; nonetheless, the function of MTHFD2 in tumor immunity and underlying mechanisms are unclear. A systematic bioinformatics analysis and lab experiments were conducted to explore the role in the tumor microenvironment (TME). Elevated levels of MTHFD2 expression were observed in most cancer types, correlating with a poor clinical prognosis. MTHFD2 was found to influence immune cell infiltration within the TME in diverse cancer types. Single-cell RNA sequencing data from the TISCH database revealed predominant expression of MTHFD2 in macrophages within KIRC tissues. Immunohistochemical staining analysis confirmed the upregulation of MTHFD2 in KIRC tissues, indicating an unfavorable clinical outcome. Multiplex immunohistochemistry staining demonstrated the concurrent presence of CD163 and CD68 in KIRC tissues exhibiting elevated levels of MTHFD2 expression. Co-culture experiments showed that inhibition of MTHFD2 reversed macrophage polarization induced by tumor-associated macrophages in 786-O renal cell carcinoma (RCC) cells. Furthermore, MTHFD2 inhibition induced G2/M phase arrest in RCC cells. MTHFD2 serves as a prognostic factor and exerts significant influence on shaping an immunosuppressive microenvironment in different types of malignancies, particularly by influencing macrophage infiltration and polarization in KIRC tissues.