ATLANTA — As Terry Collins told it, the first thing Matt Harvey said after an encouraging bullpen session with pitching coach Dan Warthen the other day was, “I’m back.”

“He was very, very excited the way he threw,” Collins said Friday night before Harvey faced the Braves at Turner Field. “His first words were, ‘I’m back.’ So we’ll see. Tonight will be a good indication.”

Harvey’s efforts in the Mets’ 6-3 victory in Atlanta indeed was a good indication — that he still has some work to do.

Harvey battled command issues and needed 101 pitches to get through five innings. He left with a 5-2 lead, but it would have been closer if Yoenis Cespedes had not thrown out a runner at the plate to end Harvey’s evening.

Harvey (1-3) allowed seven hits, walked one, hit a batter and struck out five. Still, he picked up his first victory of the season and lowered his ERA to 5.24 in a game that included a 56-minute rain delay before the bottom of the eighth.

When the game resumed, Juan Lagares replaced Cespedes in centerfield. When he slid awkwardly into second base on an RBI double that made it 6-2 in the seventh, Cespedes re-injured the right leg bruise he suffered while jumping into the stands at Citi Field on April 13.

As far as Harvey, he probably expected more against a rebuilding Braves team after working with Warthen on what the Mets are calling mechanical issues.

Asked before the game if he’d ever seen Harvey struggle like this, Collins said: “No. First time.”

But the manager was optimistic. “He had a bullpen session where they made a couple of adjustments mechanically, and he felt great,” Collins said. “So hopefully he takes it into tonight’s game and we see the guy [where] we know what we’ve got.”

Instead of the dominant Dark Knight, the Mets got a pitcher who was not in command from pitch to pitch.

The Mets gave Harvey a 4-0 lead in the second inning on Granderson’s grand slam off Bud Norris (1-3). It was Granderson’s sixth career grand slam and first as a Met.

But Harvey gave up two runs in the bottom of the second. The first three Braves — the not-so imposing 4-5-6 of Adonis Garcia, A.J. Pierzynski and Kelly Johnson — each singled to produce a run. One out later, Mallex Smith dumped an RBI double inside the leftfield line to make it 4-2.

Harvey helped himself by retiring Norris on a close play at first on a bunt, with neither runner moving, and striking out Nick Markakis to end the inning.

Granderson made it 5-2 in the fourth with his second homer of the night. That blast to right gave the Mets a franchise-best 21 homers in a seven-game span, according to the Elias Sports Bureau. The previous high was 20 in the same span in 2004.

Harvey pitched scoreless ball for his final three innings. But it was not without adventure.

In the fourth, Harvey hit Smith with a 1-and-2 pitch to put two runners on with two outs. Pinch hitter Jace Peterson ended the inning with a fly ball to right.

In the fifth, with two on and two outs, Pierzynski lined Harvey’s final pitch to center for a single. Cespedes threw the ball home on the fly and Travis d’Arnaud tagged out Markakis to end the inning.