Abstract As shared energy storage power plants have become a research hotspot, the cooperation between them and microgrids has attracted attention. In this paper, we propose a master-slave game optimization operation strategy for multi-energy microgrids, taking into account shared energy storage (ESS) clusters. Firstly, the inclusion of ESS clusters is considered in a combined heat and power (CHP) type multi-energy microgrid. Then, the optimal operation model is established and solved in two layers. The master-slave game model in the context of ESS clusters is proposed by analyzing the game relationship between the microgrid side and the user side, the arithmetic simulation with MATLAB, and the modeling and solving are carried out by the Yalmip tool and the CPLEX solver, and the combination of heuristic algorithms and the solver is used to optimize the strategies of the microgrid side and the user side. The optimization of the system after the optimization of this paper’s methodology can enhance the system economy.