Mucus is a sign of infection and the intestinal tract is most likely the place for it. There can be a number of possibilities from a rogue bacteria, yeast/fungus, parasites and viruses.
The most logical thing to do is ask the doctor to submit a stool sample and see if they pick up on anything. Typically if it is a bacterial situation (but not always), the white blood cell count would be altered. However there are pathogens that do not create this.