This paper proposes a novel cooperative voltage control strategy for an isolated microgrid based on the multi-agent advantage actor-critic (MA2C) algorithm. The proposed method facilitates the collaborative operation of a distributed energy system (DES) by adopting an attention mechanism to adaptively boost information processing effectiveness through the assignment of importance scores. Additionally, the algorithm we propose, executed through a centralized training and decentralized execution framework, implements secondary control and effectively restores voltage deviation. The introduction of an attention mechanism alleviates the burden of information transmission. Finally, we illustrate the effectiveness of the proposed method through a DES consisting of six energy nodes.