Mets starting pitcher Tylor Megill delivers against the Brewers during...

Mets starting pitcher Tylor Megill delivers against the Brewers during the first inning of an MLB game at Citi Field on June 16. Credit: Kathleen Malone-Van Dyke

Tylor Megill was the Mets’ surprise Opening Day starter and did pretty well: five shutout innings against the Nationals.

Megill also was the starting pitcher when the Mets threw a combined no-hitter against the Phillies on April 29. The righthander went five innings in that one, too.

But Megill has been on the injured list since June 17 with a right shoulder strain. When he returns, it probably will be as a reliever.

Megill took the first step toward that goal on Thursday when he struck out all three batters in a one-inning outing in his first rehab appearance for Double-A Binghamton.

Megill threw 19 pitches, 11 for strikes, and hit 97 mph against the Yankees’ Somerset affiliate.

Manager Buck Showalter said Megill will get consideration for a bullpen role when he returns.

“I know he did well [Thursday] night,” Showalter said. “Felt good. Feels good today. So I’m sure he’s going to take a day or two off and pitch again. That’s the plan.”

Megill hadn’t pitched out of the bullpen since 2019 in Class A, but the Mets need power arms in the pen as they ready for the postseason. Megill, who added a ton of velocity this season, has 47 strikeouts in 41 1⁄3 innings to go with his 4-2 record and 5.01 ERA.

“We were talking about, ‘Does he pitch back-to-back? Does he pitch multiple innings?’ ” Showalter said. “What are you more concerned with? Him pitching, say, two or three innings or pitching back-to-back one inning? That’s what we’re trying to get our arms around now.

“It’s tough because he hasn’t really had a background in it. So you’ve got to ask yourself, ‘What is he most likely to be asked to do for you here when he gets here and be able to contribute?’ and try to lean on that. Because I don’t think you’re going to be able to do both [starting and relieving]. So who knows?

“He’s also got to take some precautions. You’re doing something different with him than he’s ever done. He hasn’t pitched two days later after pitching an inning. We’ve got to cross these hurdles before we run out of time.”

The Mets also are considering using Friday night’s starter, David Peterson, in a bullpen role sooner rather than later. Carlos Carrasco is expected to return from the injured list on Sunday to give the Mets a full five-man rotation.

Unless someone gets injured or Showalter wants to use Peterson as a spot starter, the lefthander probably is going to start getting more reps as a reliever after Friday.

Peterson went into Friday with a 7-3 record and 3.21 ERA in 20 outings, 16 of them starts. As a reliever, he is 1-0 with a 4.50 ERA in eight innings.

Showalter was asked before the game what he knew about Peterson before the season.

“I knew he was lefthanded and tall, to start off with,” Showalter said. “I looked at his numbers and knew a lot of people thought highly of him and was anxious to see him in the spring.

“I went into it with an open mind. Curious to see what his secondary stuff was going to be like. Is he going to be able to defend himself against righthanded hitters, which is what he’s going to see a lot up here? Good lefthanded pitchers up here — starters — they have one thing in common: They have pitches to get righthanded hitters out with. So far, he’s done that.

“He’s a guy that has answered a need in a very important role for us, in a lot of ways, at every turn. Even when guys went down, Pete’s been there.”