What should I do if my baby keeps coughing up lots of mucus?

Make an appt. Mucous production can be normal in a newborn for a few days. In older children, it can signal other issues like allergies, asthma, etc. Diagnosis also varies based on age. Many children on milk based formulas or older children who drink a lot of milk may see improvement by going off dairy. This issue is best answered with a visit with your pediatrician.
Call Your Doctor. Your child needs to be examined to determine the cause of their symptoms. Some possibilities include a cold, allergies, bronchitis, asthma and pneumonia. The only way to know if it is serious is for your pediatrician to examine the child.