Abstract Background Emerging evidence suggests that the gut microbiota is associated with various intracranial neoplastic diseases. It has been observed that alterations in the gut microbiota are present in gliomas, meningiomas, and pituitary neuroendocrine tumors (Pit-NETs). However, the correlation between gut microbiota and craniopharyngioma (CP), a rare embryonic malformation tumor in the sellar region, has not been previously mentioned. Consequently, this study aimed to investigate the gut microbiota composition and metabolic patterns in CP patients, with the goal of identifying potential therapeutic approaches. Methods We enrolled 15 medication-free and non-operated patients with CP and 15 healthy controls (HCs), conducting sequential metagenomic and metabolomic analyses on fecal samples to investigate changes in the gut microbiota of CP patients. Results The composition of gut microbiota in patients with CP compared to HCs show significant discrepancies at both the genus and species levels. The CP group exhibits greater species diversity. And the metabolic patterns between the two groups vary markedly. Conclusions The gut microbiota composition and metabolic patterns in patients with CP differ significantly from the healthy population, presenting potential new therapeutic opportunities.