The Mets said the 33-year-old Cespedes, who suffered a broken right ankle in an accident on his ranch, had the operation at the Hospital for Special Surgery in New York.
Cespedes hadn't played this season while recovering from surgery to remove calcification on both of his heels. The two-time All-Star played just 38 games last year and has played only 119 games since signing a four-year, $110 million deal before the 2017 season.
Mets general manager Brodie Van Wagenen said this week the team was told Saturday night that Cespedes sustained multiple ankle fractures on his ranch in Port St. Lucie, Florida, where the club's spring training complex is located.
Cespedes helped lead the Mets to the 2015 World Series and a 2016 playoff appearance.
The Associated Press contributed to this report.