Islamic State has claimed responsibility for an attack at the communications ministry in the Afghan capital Kabul that killed seven people, the militant group's Aamaq news agency said on Sunday.