TNF-α levels were higher in patients with MDD and T2DM than in those with only MDD, and TNF-α had an effect modification on the quinolinic acid/tryptophan ratio and serotonin in patients depending on the presence of T2DM. Here, TNF is linked to type 2 diabetes mellitus.