We found that 5-HT produced by mast cells essentially contributed to pathogen clearance and immune homeostasis in infection by promoting the host protective indoleamine-2,3-dioxygenase 1/kynurenine pathway and limiting the microbial activation of the indole/aryl hydrocarbon receptor pathway. Here, AHR is linked to infection.