This paper proposed a novel harmonic suppression method of grid-connected current for voltage-controlled inverter. The grid-connected inverter model is converted to the port-controlled Hamiltonian model, and the grid-connected controller is designed based on the energy-shaping control theory, which effectively simplifies the structure of the grid-connected controller and controls the number of parameters. Based on this foundation, the effectiveness of the proposed harmonic suppression method of injected grid current is verified under different conditions by the inverter experimental platform, which is based on the Danfoss inverter and RT Box controller.