The team didn't disclose the type of surgery, though Tim Healey of Newsday noted that it was for Cespedes' right ankle, which he injured on his Florida ranch.
Cespedes, 33, was taken to a New York hospital last week after stepping into a hole at the ranch. He suffered multiple ankle fractures.
Heading into the 2019 season, Cespedes was sidelined and rehabbing from injuries to both heels. Before the accident last week, he was believed to be on track for a return in late June or early July.
The two-time All-Star hasn't played since July 20, 2018. Cespedes owns a .826 career OPS with 163 home runs and 43 stolen bases and is owed $29.5 million next year.