Photovoltaic (PV) power generation is the main aspect of new energy power generation, and it is an important means to achieve the goal of carbon neutrality. When the PV system is connected to the grid, the nonlinear load of the grid will affect the power quality and consume reactive power. This paper proposes a PV power generation grid-connected system to improve power quality, with an active power filter (APF) function. Through the maximum power point tracking (MPPT) method, PV power generation can operate at the maximum power point and play the function of harmonic and reactive power compensation at the load side. To improve the dynamic performance of the grid-connected PV system and harmonic compensation simultaneously, multistep finite control set model predictive control (FCS-MPC) is adopted for the grid-connected module. The whole system does not need additional equipment, as it plays the role of two devices and effectively reduces the input cost. In this paper, the proposed structure and multistep FCS-MPC are verified in MATLAB/Simulink. The results show that the system injects the maximum power into the power grid at the same time when the load changes and compensates the harmonic generated by the nonlinear load of the power grid so that the total harmonic distortion of the power grid can meet the operation standard, and the system has good dynamic performance and steady-state performance.