Controlling flexible hybrid microgrids (MGs) is difficult due to the system's complexity, which includes multiple energy sources, storage devices, and loads. Although adding new components to the MG system through the plug-and-play (PnP) feature enables operating of the system in different modes, it adds to the system's complexity, hence necessitates careful control system design. The most challenging aspect of designing the control system is ensuring that it can control the MG optimally in its various modes of operation. Previous methods based on logical control allow for synthesizing a controller capable of controlling the MG in its various operational modes. However, the resultant controller does not optimally operate the MG. Classical model predictive control allows optimal control of the MG only in specific operating modes. On the other hand, switched model predictive control (S-MPC) can optimally control the MG in its various modes. However, the design of S-MPC is complex, particularly for MGs with many operating modes or complex switching logic. Multiple factors contribute to the complexity, including model development, mode detection, and switching logic. This paper presents a hybrid method based on ɛ-variables and classical MPC for constructing the S-MPC for flexible hybrid MG with PnP capabilities. Our results show that the proposed controller synthesis approach provides an effective solution for optimally controlling flexible hybrid MGs with PnP capabilities as the proposed method enables: (i) an increase in the amount of energy export to the utility grid by 50.77% and (ii) a significant decrease in the amount of energy import from the grid by 46.7%.