Passing mucus from your anus with or without stool may be a sign of a bacterial, viral, or parasitic infection that affects your GI tract. It could also be a symptom of IBS.