Natural killer (NK) cells, as key immune cells, play essential roles in tumor cell immune escape and immunotherapy. Accumulating evidence has demonstrated that the gut microbiota community affects the efficacy of anti-PD1 immunotherapy and that remodeling the gut microbiota is a promising strategy to enhance anti-PD1 immunotherapy responsiveness in advanced melanoma patients; however, the details of the mechanism remain elusive. In this study, we found thatEubacterium rectalewas significantly enriched in melanoma patients who responded to anti-PD1 immunotherapy and that a highE. rectaleabundance was related to longer survival in melanoma patients. Furthermore, administration ofE. rectaleremarkably improved the efficacy of anti-PD1 therapy and increased the overall survival of tumor-bearing mice; moreover, application ofE. rectaleled to a significant accumulation of NK cells in the tumor microenvironment. Interestingly, conditioned medium isolated from anE. rectaleculture system dramatically enhanced NK cell function. Gas chromatography–mass spectrometry/ultrahigh performance liquid chromatography–tandem mass spectrometry-based metabolomic analysis showed thatl-serine production was significantly decreased in theE. rectalegroup; moreover, administration of anl-serine synthesis inhibitor dramatically increased NK cell activation, which enhanced anti-PD1 immunotherapy effects. Mechanistically, supplementation withl-serine or application of anl-serine synthesis inhibitor affected NK cell activation through Fos/Fosl. In summary, our findings reveal the role of bacteria-modulated serine metabolic signaling in NK cell activation and provide a novel therapeutic strategy to improve the efficacy of anti-PD1 immunotherapy in melanoma.