The shuffled frog leaping algorithm (SFLA) is presented, to optimally design multiple proportional-integral (PI) controllers of the static synchronous compensator (STATCOM) system with the purpose of improving the transient stability of a grid-connected wind farm. The control strategy of the STATCOM system depends on a sinusoidal pulse width modulation voltage source converter, which is controlled by the cascaded PI control scheme. The response surface methodology is used to establish a second-order fitted model of the transient voltage responses at the point of common coupling in terms of PI controllers' parameters. For realistic responses, a three-mass drive train model is used for the wind turbine generator system because of its great influence on the dynamic analyses. The SFLA code is built using MATLAB software. The effectiveness of optimised PI-controlled STATCOM by the SFLA is then compared to that optimised by genetic algorithms technique taking into consideration symmetrical and unsymmetrical fault conditions. The proposed control scheme is applied to a real grid-connected wind farm system at Hokkaido Island, Japan. The validity of the proposed system is verified by the simulation results, which are performed using PSCAD/EMTDC software environment. With the proposed SFLA-based STATCOM, the transient stability of a grid-connected wind farm can be enhanced.