Microgrids contain various power systems with different power capacities and generation fluctuations. An overall power management strategy is necessary to manage power flows among all interconnected elements. This paper presents a multi –agent system solution to energy management in a microgrid based on distributed hybrid renewable energy generation and distributed consumption (vital loads and non-sensitive loads). The real model of each element connected is needed, enabling microgrid modeling and control. A new architecture using multi –agent system solution is proposed, allowing making all the calculations required in Matlab Simulink and the intelligent strategy of energy management is executed by agents designed by Jade. While the communication middleware between Jade and Simulink is carried out by MacsimJX. Finally, it was justified how multi agent system can be a suitable solution to microgrid implementation requirements.