The synthesis or release of any molecular mediator of the immune response, resulting in an increase in its intracellular or extracellular levels.