Inflammation-related dALFF was associated with attention impairment in MDD patients, with variations observed among MDD subgroups. These findings contribute to the understanding of the intricate relationship between inflammation, dynamic brain activity and cognitive impairments in MDD.