Buildings are becoming suitable for application of sophisticated energy management approaches to increase their energy efficiency and possibly turn them into active energy market participants. The paper proposes a modular coordination mechanism between building zones comfort control and building microgrid energy flows control based on model predictive control. The approach opens possibilities to modularly coordinate technologically heterogeneous building subsystems for economically-optimal operation under user comfort constraints. The imposed modularity is based on a simple interface for exchanging building consumption and microgrid energy price profiles. This is a key element for technology separation, replication and up-scaling towards the levels of smart grids and smart cities where buildings play active roles in energy management. The proposed coordination mechanism is presented in a comprehensive realistic case study of maintaining comfort in an office building with integrated microgrid. The approach stands out with significant performance improvements compared to various non-coordinated predictive control schemes and baseline controllers. Results give detailed information about yearly cost-effectiveness of the considered configurations, which are suitable for deployment as short- and long- term zero-energy building investments.