Mucus is primarily produced by specialized cells known as goblet cells and mucous glands. Goblet cells are found in the epithelial lining of organs such as the intestines and respiratory tract, while mucous glands are present in structures like the salivary glands and the esophagus.