Dairy cows undergo dynamic physiological changes from late gestation to early lactation, including metabolic changes and immune dysfunction. The aim of this study was to investigate the relationship between immune function and metabolic changes in peripartum dairy cows. Fifteen healthy Holstein dairy cows were enrolled 14 days prior to parturition, and plasma was collected on day −7, 0, 7, and 21 relative to calving. Plasma non-esterified fatty acids (NEFAs), glucose, β-hydroxybutyric acid (BHBA), immunoglobulin G (IgG), tumor necrosis factor alpha (TNF-α), and interleukin-2 levels were measured, and metabolic profiles were determined using ultra-high-performance liquid chromatography–quadrupole time-of-flight mass spectrometry. The data were analyzed using Tukey–Kramer adjustment for multiple comparisons, and multivariate and univariate statistical analyses were performed to screen for differential metabolites. The results showed that the concentrations of NEFAs, glucose, BHBA, and TNF-α in the plasma significantly increased and concentrations of IgG and interleukin-2 in plasma significantly decreased from −7 d to the calving day (p < 0.05). Additionally, the concentrations of glucose, IgG, and TNF-α significantly decreased from 0 to +7 d, and concentrations of NEFAs decreased significantly from +7 to +21 d (p < 0.05). The following six primary metabolic pathways were identified in all time point comparisons, and L-glutamate, linoleic acid, taurine, and L-tryptophan were involved in these major metabolic pathways. Correlation and pathway analyses indicated that a negative energy balance during the transition period adversely affects immune responses in cows, and L-tryptophan exerts immunomodulatory effects through the Trp-Kyn pathway, resulting in depletion of Trp and elevation of Kyn.