The 32-year-old hadn't played since May 13 with hip flexor and chronic heel injuries.
On Wednesday, he played first base for the first time in his career in a rehab game for the Mets' rookie league club.
After the game, Cespedes said that he learned he has calcification in both heels and is considering whether to have surgery in the offseason.
"The cause of my problems are my heels, because when I feel some pain on my heels, I started to modify my walking, my running or even my standing,'' he said through a translator.
He is wary of the procedure because he said the recovery time is eight to 10 months. When asked if he thinks he can finish out the season, Cespedes said he didn't know for sure.
"I've been playing like this for the last 15 years, but as time goes by it's getting worse and worse,'' he said.
Cespedes spent much of his layoff at the Mets' training complex in Port St. Lucie, Florida, and was upset by criticism.
"I found some things on social media, which, honestly, I don't care, but it shows that people don't know how hard I worked down there to get back,'' he said.
Mets manager Mickey Callaway said before that Cespedes could be shifted to first base later this season.
"One of the thoughts about first base is that he's going to stay hot the whole game because he's moving around all the time," Callaway said. "There's not that component of standing out in left field for five, six minutes and all of a sudden having to sprint 30 yards and dive and make a catch. So we're really trying to determine that, to make sure that's the best spot for him."
Information from The Associated Press was used in this report.