Production of mucus, running nose and all are response of our body towards some allergens or organisms.
WBC,lymphocytes and certain enzymes (cyclooxygenase,histamines) are the defensing systems in our body involved in these process.
If you are suffering from fever and body temperature raises these indicates the increase in body pyrogen level.Your body will start to produce and stimulate above mentioned systems and compounds to expel the fever causing bacteria.This leads to inflammation,mucus production and cough.