In some applications of microgrid and distributed generation, it is required to feed islanded or stand-alone loads with high-quality voltage to provide low total harmonic distortion (THD). To fulfil these demands, an LC filter is connected to the output terminals of power electronics converters. A cascaded voltage and current control loop with pulse-width modulation schemes are used to regulate the voltage and current in these systems. However, these strategies have some drawbacks, particularly when multiple-input multiple-output plants (MIMO) are controlled using single-input single-output (SISO) design methods. This methodology usually produces a sluggish transient response and cross-coupling between different control loops. In this paper, a model predictive control (MPC) strategy based on the concept of optimal switching sequences (OSS) is designed to control voltage and current in an LC filter connected to a three-level neutral-point clamped converter. The strategy solves two well-formulated optimisation problems to achieve control of the LC filter variables and the voltages of the DC-link capacitors. Hardware-in-the-Loop (HIL) results are obtained to validate the feasibility of the proposed strategy, using a PLECS-RT HIL platform and a DSP Microlab Box controller. In addition to the good dynamic performance of the proposed OSS-MPC, it is demonstrated by the HIL results that the control algorithm is capable of obtaining low total harmonic distortion (THD) in the output voltage for different conditions.