This paper focuses on the Model Predictive Control (MPC) based energy scheduling of a smart microgrid equipped with non-controllable (i.e., with fixed power profile) and controllable (i.e., with flexible and programmable operation) electrical appliances, as well as photovoltaic (PV) panels, and a battery energy storage system (BESS). The proposed control strategy aims at a simultaneous optimal planning of the controllable loads, the shared resources (i.e., the storage system charge/discharge and renewable energy usage), and the energy exchange with the grid. The control scheme relies on an iterative finite horizon on-line optimization, implementing a mixed integer linear programming energy scheduling algorithm to maximize the self-supply with solar energy and/or minimize the daily cost of energy bought from the grid under timevarying energy pricing. At each time step, the resulting optimization problem is solved providing the optimal operations of controllable loads, the optimal amount of energy to be bought/sold from/to the grid, and the optimal charging/discharging profile for the BESS. The proposed energy scheduling approach is applied to the demand side management control of the marina of Ballen, Samsø (Denmark), where a smart microgrid is currently being implemented as a demonstrator in the Horizon2020 European research project SMILE. Simulations considering the marina electric consumption (340 boat sockets, a service building equipped with a sauna and a wastewater pumping station, and the harbour master's office equipped with a heat pump), PV production (60kWp), and the BESS (237kWh capacity) based on a public real dataset are carried out on a one year time series with a 1 hour resolution. Simulations indicate that the proposed approach allows 90% exploitation of the production of the PV plant. Furthermore, results are compared to a naïve control approach. The MPC based energy scheduling improves the self-supply by 1.6% compared to the naïve control. Optimization of the business economy using the MPC approach, instead, yields to 8.2% savings in the yearly energy cost with respect to the naïve approach.