Islamic State claimed responsibility for an attack on Libya’s Foreign Ministry in Tripoli, the group said early on Wednesday on its news agency Amaq.