As part of the second phase of the OptiEnR research project, the present work deals with improving the operation of a multi-energy district boiler by adding to the plant an optimally designed and controlled thermal storage tank. Previous study focused on both a design approach, based on a parametric analysis, and a non-predictive control strategy. The aim of the present work was to develop a Model Predictive Controller (MPC) to improve the management of the tank in real time. The proposed controller generates optimal command sequences dealing with the amount of thermal energy to be stored or released. As a result, both the fossil energy consumption and CO 2 emissions are significantly reduced while the economic gain is increased.