Mastitis is an inflammation of the mammary gland tissue that can lead to decreased milk production and altered milk composition, carrying serious implications for the safety of dairy products. Although both caffeic acid (CA) and umbilical cord-mesenchymal stem cells (UC-MSCs) showed potential anti-inflammatory and immunomodulatory properties, little is known about their combined roles in treating mastitis. Here, we report the combined effects and mechanisms of CA and UC-MSCs on lipopolysaccharide (LPS)-induced mastitis. Based on the network pharmacological analysis, the potential relevant genes involved in the alleviating effects of CA on LPS-induced mastitis were inferred. In LPS-treated mammary epithelial cells, CA or/and UC-MSC conditioned medium (UC-MSC-CM) inhibited the phosphorylation of p65, p50, p38, IκB, and MKK3/6 proteins and the expression of downstream inflammatory factors TNF-α, IL-1β, IL-6, IL-8, and COX-2. Additionally, CA or/and hydrogel-loaded UC-MSCs also suppressed the activation of the above inflammatory pathway, leading to the alleviation of pathological damages in the LPS-induced mouse mastitis model. UC-MSCs exhibited more significant effects than CA, and the combined treatment of both was more effective. Our study sheds light on the synergistic and complementary effects of CA and UC-MSCs in alleviating mastitis, offering clues for understanding the regulation of the p38-MAPK/NF-κB↔TNF-α signal transduction loop in the tumor necrosis factor (TNF) pathway as a potential mechanism. This study provides a theoretical basis for developing a novel antibiotic alternative treatment of mastitis that may contribute to reducing economic losses in animal husbandry and protecting public health safety.