Opioid receptor stimulants are analgesics used in patients with and without cancer; however, they often cause constipation, resulting in poor adherence and deterioration of the quality of life. Hence, suitable treatments for constipation are required. In this study, we investigated the pharmacological mechanisms of action of mashiningan (MNG), a Kampo medicine used to treat constipation, and evaluated the effect of MNG on opioid-induced constipation in rats. MNG (100 or 300 mg/kg) was orally administered to normal or codeine phosphate (CPH)-induced constipation in rats, and its effect was evaluated on the basis of fecal counts, characteristics, and weight. Small intestinal fluid secretion was measured after treatment with MNG alone or coadministration with a cystic fibrosis transmembrane conductance regulator (CFTR)-specific inhibitor (CFTRinh-172). The effects of MNG on the CFTR and type-2 chloride channel were determined using patch-clamp or short-circuit current experiments, respectively. MNG increased the fecal weight and proportion of soft feces in normal rats. CPH-induced constipation in rats decreased fecal counts and weight, whereas MNG prevented these effects and increased the proportion of soft feces. MNG increased the electronic chloride current, and this effect was inhibited by the CFTRinh-172 in the CFTR assay. Furthermore, MNG increased small intestinal fluid secretion, and this effect was abolished by coadministration with the CFTRinh-172. MNG improved opioid-induced constipation in rats, and this improvement may have been mediated by increasing intestinal fluid secretion via CFTR chloride channel activation. Therefore, MNG is expected as a medicine of the treatment of constipation in patients taking opioids.