The design of robust networked structures is of significance in reality, and the integrity of network connections has been greatly emphasized in previous studies. However, besides structural integrity, a system should also keep the functionality when suffering from attacks and failures, i.e. robust community structure. Focusing on enhancing community robustness on complex networks, in this paper, based on a community robustness measure Rc, a multi-agent genetic algorithm, termed as MAGA-Rc, has been proposed to enhance the community robustness against attacks. The performance of MAGA-Rc is validated on several real-world networks, and the results show that MAGA-Rc could deal with the optimization of community robustness and outperforms several existing methods. The results provide convenience for networked property analyses and applicable to solve realistic optimization problems.