To explore the effects of Weitiao No. 3 (3, WD-3) on anti-programmed cell death protein-1 (PD-1) immunotherapy in gastric cancer (GC). The intestinal microbiota was analyzed by 16S rDNA sequencing of fecal samples from three groups: healthy people (Health), GC patients (GC), and WD-3-treated GC patients (WD-3). Next, we established an orthotopic model of GC mice, which were treated with anti-PD-1, WD-3, or an inoculation of intestinal bacteria. Immune markers CD3, CD4, CD8, and forkhead box protein P3 (FOXP3), and the cell proliferation marker Ki67, were evaluated by immunohistochemistry. Cell apoptosis in GC tumors was assessed by terminal-deoxynucleotidyl-transferase-mediated deoxyuridine triphosphate nick end labeling staining. Enzyme-linked immunosorbent assays (ELISAs) were performed to analyze the serum levels of the following cytokines in GC mice: tumor necrosis factor (TNF)-α, interleukin (IL)-2, IL-6, IL-10, interferon (IFN)-γ, and transforming growth factor (TGF)-β. Sequencing data showed that there were significant differences in the composition of the gut microbial community among the three human groups. The gut bacteria in the three groups mainly comprised the phyla Firmicutes, Proteobacteria, Bacteroidetes, and Actinobacteria. At the genus level, the relative abundances of Bifidobacterium and Coprococcus showed significant decreases in the GC group, and an obvious increase in the WD-3 group, compared with the Health group. Interestingly, the relative abundance of Saccharopolyspora was only detected in the WD-3 group. The results of in vivo experiments in GC mice showed that WD-3 or anti-PD-1 treatment increased the levels of CD3+, CD4+, and CD8+ T cells, but decreased the levels of FOXP3+ regulatory T cells. Furthermore, WD-3 or PD-1 antibody treatment inhibited proliferation and promoted apoptosis of GC tumor cells. ELISA analysis showed that WD-3 or PD-1 antibody treatment facilitated TNF-α, IL-2, and IFN-γ expression, while suppressing IL-6, IL-10, and TGF-β expression. Combination therapy with WD-3 and anti-PD-1 intensified all of these effects. WD-3 enhanced the immunotherapeutic efficacy of anti-PD-1 by modulating the intestinal microbiota in an orthotopic model of GC mice.