CLEVELAND — For a few weeks he made even the most depressed fans of the team dream. He was the best kind of story, practically out of nowhere, magical, overcoming all the negativity and bad history and management ineptitude and hate of ownership to grab New York, own the town, rise above all that was wrong.

Alas, Linsanity lasted just a few weeks bridging February and March 2012 and then Jeremy Lin was gone from the Knicks and his brush with greatness.

Now, Pete Alonso is Linsanity with legs. The Mets first baseman is at three months of soaring despite the negativity and bad history and management ineptitude and hate of ownership. The Home Run Derby title Monday night marked him more as the Mets’ Aaron Judge, not just because of the power, but also for the way he handled himself before, during and after the event.

“This year has been so special,” Alonso said. “It is almost like I am living in a fantasy.”

Except, of course, he is living in Mets world. No Fantasyland. Judge’s 2017 emergence — Derby title, 50 homers, Rookie of the Year — helped the Yankees go from lower-than-normal expectations for the franchise to ALCS Game 7. Alonso checked the Home Run Derby box. He also is on pace for 54 homers and is the current NL Rookie of the Year front-runner — though Padres wunderkind Fernando Tatis Jr. might have a say on that before it is all decided, perhaps the Braves’ Austin Riley and Mike Soroka, too.

Alonso is doing this in a familiar, dismaying, discouraging Mets world — a rose floating in sewage. General manager Brodie Van Wagenen — as opposed to the 2017 Yankees — raised expectations with an active offseason and boasts of being the team to beat and “come and get us.” All that has gone right for the Mets is Alonso and fellow All-Star Jeff McNeil. As Jacob deGrom said, “Besides those guys pretty much everyone in the clubhouse, starting with me, feels they could have been better in the first half.”

When there is a forensic detailing of this Mets period, we will remember that somehow they squandered one of the four greatest pitching seasons in Mets history by deGrom in 2018 and were unable to construct a winning roster around Alonso and McNeil when that duo was absorbing just more than $1 million of the 2019 payroll. The Mets were handed gifts. The Mets wasted gifts.

And the waste is greater. The Mets are being hailed for having Alonso on the roster from the outset of the season — a rare winning move in Van Wagenen’s first GM season is the general view. But let’s see if that is the sentiment as Alonso approaches free agency after the 2024 season rather than a year later. I hate the service manipulation, if you deserve to graduate college, you should not be held back for the university’s benefit.

But the rules on the book allow the manipulation. And it is one thing, like with Jason Heyward in 2010 when his full-season roster presence helped drive Atlanta to the playoffs. The Mets are losing a service year with Alonso to win 70-something games for the 11th time in 13 years.

Good for Alonso to make the most of the Mets’ largesse and to rise above their malfeasance. Good for him to be Lin, but more. Last year began with Alonso as an unheralded prospect whose defense even Mets officials said made him unplayable. In mid-April 2018, he was playing in the snow in New Hampshire, at Double-A, against Vladimir Guerrero Jr.

On Monday night, they met in the Home Run Derby final. Guerrero earned the biggest buzz in the tournament, particularly for outdueling the Dodgers’ Joc Pederson in triple overtime in the semifinals. Worn out, Guerrero fell to Alonso, though overall he hit more homers at the event 91-57. Guerrero won the popular vote (or popularity vote), but Alonso took the election.

“This was a blast,” Alonso said a day later. “I grew up wanting to do this, whether it was for $1 million or for free. The biggest thing for me is the bragging rights. I don’t know how much I would pay for that if I had the money.”

He took 10 percent of that $1 million and spread it to charities for veterans and first responders. He took the attention flawlessly, brandishing both his self-confidence, yet a team-natured bent. He continued to be the human oasis in the desert of a Mets season. Lin with legs.

“I wanted to do this forever,” Alonso said. “I’m just so happy that my dream came true.”