Metabolic disorders and abnormal immune function changes occur in tumor tissues and cells to varying degrees. There is increasing evidence that reprogrammed energy metabolism contributes to the development of tumor suppressive immune microenvironment and influences the course of gastric cancer (GC). Current studies have found that tumor microenvironment (TME) also has important clinicopathological significance in predicting prognosis and therapeutic efficacy. Novel approaches targeting TME therapy, such as immune checkpoint blockade (ICB), metabolic inhibitors and key enzymes of immune metabolism, have been involved in the treatment of GC. However, the interaction between GC cells metabolism and immune metabolism and how to make better use of these immunotherapy methods in the complex TME in GC are still being explored. Here, we discuss how metabolic reprogramming of GC cells and immune cells involved in GC immune responses modulate anti-tumor immune responses, as well as the effects of gastrointestinal flora in TME and GC. It is also proposed how to enhance anti-tumor immune response by understanding the targeted metabolism of these metabolic reprogramming to provide direction for the treatment and prognosis of GC.