The aim of this study was to investigate the inhibitory effects of Cordyceps militaris solid medium extract (CME) and cordycepin (COR) on LTA-induced inflammation in MH-S cells and their mechanisms of action. In this study, the establishment of an LTA-induced MH-S inflammation model was determined, the CCK-8 method was used to determine the safe concentration range for a drug for COR and CME, the optimal concentration of COR and CME to exert anti-inflammatory effects was further selected, and the expression of inflammatory factors of TNF-α, IL-1β, IL-18, and IL-6 was detected using ELISA. The relative expression of TNF-α, IL-1β, IL-18, IL-6, IL-10, TLR2 and MyD88 mRNA was detected using RT-PCR, and the IL-1β, IL-18, TLR2, MyD88, NF-κB p-p65, NLRP3, pro-caspase-1, Caspase-1 and ASC protein expression in the cells were detected using Western blot; immunofluorescence assay detected the expression of Caspase-1 in MH-S cells. The results revealed that both CME and COR inhibited the levels of IL-1β, IL-18, IL-6, and TNF-α in the supernatants of LTA-induced MH-S cells and the mRNA expression levels of IL-1β, IL-18, IL-6, TNF-α, TLR2 and MyD88, down-regulated the LTA-induced IL-1β, IL-18, TLR2 in MH-S cells, MyD88, NF-κB p-p65/p65, NLRP3, ASC, pro-caspase-1, and caspase-1 protein expression levels, and inhibited LTA-induced caspase-1 activation in MH-S cells. In conclusion, CME can play a therapeutic role in LTA-induced inflammation in MH-S cells via TLR2/NF-κB/NLRP3, and may serve as a potential drug for bacterial pneumonia caused by Gram-positive bacteria.