CLEVELAND — Just who in the heck did James McCann think he was?

The problem: He didn’t know. Not when he held a bat in his hands, anyway. So, during McCann’s first four-plus years in the big leagues, all with the Tigers, his offensive numbers stagnated. That is, when they didn’t fall off a cliff, as they did in 2018.

Before he signed a one-year, $2.5 million free-agent deal with the White Sox last December — during an offseason that proved pivotal in his 2019 ascension to first-time All-Star — McCann was a conundrum of a catcher. Behind the plate, he was meticulously prepared. Alongside it as a hitter, he was an impostor.

In Detroit, he tried to imitate rising slugger J.D. Martinez. Unless he was too busy trying to do what five-time All-Star Victor Martinez did. And then there were all the times he watched the great batsman Miguel Cabrera, an 11-time All-Star and future Hall-of-Famer, and thought to himself, “Yeah, I’ll start doing that, too.”

It just so happened that Cabrera could load up dramatically with his hips and hands and still barrel up a fastball, still take a slider over the opposite-field wall, still do seemingly anything. Tigers players didn’t call it the “Miggy load” for nothing. But McCann’s swing fell apart when he tried to mimic Cabrera’s style.

“Everyone has to be their own way,” said Martinez, a third-time All-Star and now a leading member of the Red Sox. “I think James kind of learned that the hard way when he was [in Detroit].”

When McCann wasn’t in Miggy Light mode in 2018, he was even more adrift as a hitter. Walking into the cage for batting practice repeatedly gave him a back-to-the-drawing-board feel. And his superstitious nature (McCann calls it OCD, though he hasn’t been diagnosed) ran amok; if anything worked during a given game, McCann tried to remember every last detail that led up to it and repeat it the next time out.

It became overwhelming.

“There were times when — and I don’t like to put it this way, but — I was beaten before the game,” he said. “Maybe it was because I didn’t get my stretching exactly right, or I didn’t take the exact same number of warm-up swings. I would drive myself nuts.”

First, McCann had to learn who he wasn’t.

“I was blessed to come up with some really special hitters around me,” the 29-year-old said at All-Star media day, one day before his debut on the Midsummer Classic stage. “But I’m not them. I can’t do the things that they do.”

The next step — the really big one — was for McCann to rediscover who he was and embrace the possibilities that offered.

“People want to know what the biggest change has been for me,” he said. “And I know it sounds cliché, I know it it sounds stupid, but the biggest change has been that I figured out who James McCann is.

“I got back a little closer to who I was when I broke into the league. If that means taking a single the other way when those guys may hit the same ball out of the ballpark, so be it. I have to be content with who I am.”

And who is that? A former standout collegian who arrived at Arkansas as an infielder but was turned into a catcher. An assistant coach and former longtime minor league catcher named Chris Curry taught McCann the position. Curry was hard on McCann from Day 1. Demanding. Unforgiving.

“Because I saw a future big-league player,” said Curry, now the head coach at Arkansas-Little Rock.

McCann, a deferential sort, took to it naturally. It’s that same side of McCann that, Curry believes, led him to emulate others in the majors rather than trust and develop his own offensive ability.

But McCann had an offseason epiphany — to crawl out of his own head — and thus far his improvement has been dramatic. He’s hitting .316 with nine homers, 16 doubles and 30 RBI and is on track for career bests in most every other category. And his 2.8 WAR in 63 games with the Sox equals his total over 452 games with the Tigers.

Opening his stance and starting his hands closer to launch position were key reversions to his old ways.

“In hindsight,” he said, “going back to that seems so obvious.”

He still allows himself a couple of “obsessions” — a peanut butter and jelly sandwich before batting practice, and a shower after it — but other than that, he’s staying out of his own way. This has enabled his defensive skills to shine and his leadership ability to blossom.

The Sox have been thrilled with McCann’s work with young pitchers, his game planning, how he controls a game and how he comports himself in the clubhouse. General manager Rick Hahn has been sold on his signing of McCann since staff ace Lucas Giolito’s first side session at the start of spring training.

“Afterward, he came up to us and he was like, ‘Hey, something’s different here. I’ve faced this kid in the past. This is different,’ ” Hahn said. “And he broke down a couple things, specifically what he saw — sort of the transformation of Lucas. That was a great conversation to have.”

And now, McCann is an All-Star. He hopes it isn’t for the last time. He’d love to get back to future games as a representative of the Sox.

Who in the heck does McCann think he is?

“I’ve got to be me,” he said.

It’s just crazy enough to work.