It sounds like something I've had in the past. I believe it's an infection in the colon. I didn't get any treatment and it went away but you could mention it to your doctor. They might have something you can take.
You really need to see a doctor, and rule out anything serious. Mucous with a bowel movement is always a sign to see your doctor.
Mucus secreting cells are one of the most abundant cells in the GI tract. The product of the cells, mucin, hits the watery environment and gets hydrated producing the mucus in our systems. We need that mucus for a variety of things including - as strange as it sounds - sticking the fecal material together to keep it cohesive, and helping the forming stool to 'slide.'
Mucus levels can go up and down to a large extent within a 'normal' condition. If the system is irritated for any reason the bowel will produce more mucus to protect itself and that can happen for a variety of reasons - diet change, medication usage, a system trying to 'right' itself after a bout of consitipation, etc. If you continue to experience larger than normal amounts of mucus and that production level continues over time, or the mucus turns color, then it might be time to consult with your doctor.