In patients with MDD and T2DM, TNF-α levels were significantly correlated with tryptophan, quinolinic acid, kynurenine/tryptophan, quinolinic acid/tryptophan, and quinolinic acid/kynurenine levels (β =  − 0.695, adjusted p = 0.030; β = 0.898, adjusted p = 0.020; β = 0.934, adjusted p = 0.012; β = 0.951, adjusted p < 0.001; β = 0.834, adjusted p = 0.002, respectively). Here, TNF is linked to type 2 diabetes mellitus.