A detailed system-level Model Predictive Control (MPC) framework is developed for use with sustainable technology systems which have either electrical or thermal load flexibility. Differently from the majority of relevant works in the literature, the proposed MPC framework includes non-ideal conversion efficiencies, flexibility in electrical/thermal loads and a detailed battery degradation model. A hybrid PV estimator based on clear-sky models and actual measurements is exploited for the photovoltaic production prediction within the MPC optimization problem. The formulated MPC problem is multi-objective, which aims to maximize the profit from energy arbitrage and minimise carbon emissions via a sustainable technology weighting factor (). A key novelty of the proposed approach is associated with the real-time experimental testing of the MPC framework using a microgrid consisting of an actual energy storage asset, a PV system and two buildings with electrically powered thermal loads. The experimental setup comprises a Hardware-in-the-loop (HIL) system together with a physical 240 kW 180 kWh battery energy storage system and a Real Time Digital Simulator (RTDS). Three scenarios with differing levels of flexibility in the electrical and thermal loads are considered, so as to derive consistent comparisons. When flexibility in both the electrical and thermal loads is utilised, a reduction of up to 75 kg/day ( = 0.01) and an energy saving of up to 50 £/day ( = 0) is observed, yielding a reduction of around 10% in carbon emissions or energy consumption with respect to the base case.