Constipation-predominant irritable bowel syndrome (IBS-C) is a chronic functional intestinal disease that can significantly reduce patients' quality of life. This study aims to evaluate the clinical effect and mechanism of YunPi RouGan (YPRG) prescription on IBS-C patients with liver-depression and spleen-deficiency syndrome. 42 IBS-C patients receiving treatment at Jiangsu Provincial Hospital of Integrated Traditional Chinese and Western Medicine from May 2022 to March 2023 were recruited and randomly assigned to either the treatment or control group, with 21 patients in each group. The patients received either a YPRG prescription or a linalotide capsule for 4 weeks. A series of scales were utilized to evaluate the clinical symptoms, psychological aspects, and quality of life in IBS patients. Meanwhile, fresh fecal samples were collected to analyze the changes in gut microbiota by 16SrDNA sequencing. In terms of clinical treatment, both YPRG prescription and the first-line drug linaclotide have similar effects for IBS-C. However, YPRG prescription has demonstrated significant improvements in several symptoms, such as abdominal distension and belching. Furthermore, it has been shown to upregulate the diversity of gut microbiota and induce changes in the types of dominant microbiota in IBS-C patients. At the phylum level, Firmicutes and Bacteroides increased, while Proteobacteria, actinobacteria, and desulphurobacteria decreased. At the genus level, Bacteroides, Spirillum, Clostridium praxis, Roxella, Para-salmonella, Haemophilus, koala bacillus, Micrococcus rare, Spirillum, and Streptococcus increased significantly. The effect of YPRG prescription on improving the clinical symptoms of IBS-C may be attributed to its potential to regulate gut microbiota.