Background The mucosa-associated gut microbiota directly modulates epithelial and mucosal function. In this study, we investigated the mucosa-associated microbial community in patients with inflammatory bowel disease (IBD), using endoscopic brush samples. Methods A total of 174 mucus samples from 43 patients with ulcerative colitis (UC), 26 with Crohn's disease (CD) and 14 non-IBD controls were obtained by gentle brushing of mucosal surfaces using endoscopic cytology brushes. The gut microbiome was analyzed using 16S rRNA gene sequencing. Results There were no significant differences in microbial structure among different anatomical sites (the ileum, cecum and sigmoid colon) within individuals. There was, however, a significant difference in microbial structure between CD, UC and non-IBD controls. The difference between CD and non-IBD controls was more marked than that between UC patients and non-IBD controls. a-Diversity was significantly lower in UC and CD patients than non-IBD controls. When comparing CD patients with non-IBD controls, the phylum Proteobacteria was significantly increased and the phyla Firmicutes and Bacteroidetes were significantly reduced. These included a significant increase in the genera Escherichia, Ruminococcus (R. gnavus), Cetobacterium, Actinobacillus and Enterococcus, and a significant decrease in the genera Faecalibacterium, Coprococcus, Prevotella and Roseburia. Comparisons between CD and UC patients revealed a greater abundance of the genera Escherichia, Ruminococcus (R. gnavus), Clostridium, Cetobacterium, Peptostreptococcus in CD patients, and the genera Faecalibacterium, Blautia, Bifidobacterium, Roseburia and Citrobacter in UC patients. Conclusions Mucosa-associated dysbiosis was identified in IBD patients. CD and UC may be distinguishable from the mucosa-associated microbial community structure.