HOUSTON — The Yankees traded Carlos Beltran and Brian McCann in 2016 to get younger and make room for other players. The Astros acquired each veteran to add some leadership to an up-and-coming team.

Not many would have predicted the two organizations were going to meet a year later in the for the American League pennant.

“I’m surprised, but it’s good to watch,” Beltran said Thursday of the Yankees’ unexpected appearance in the ALCS that starts Friday at Minute Maid Park. “It’s refreshing.”

Of course, it’s probably more refreshing since Beltran is there, as well, after signing with Houston last offseason following his trade to the Rangers at last year’s trade deadline.

Beltran and McCann were signed by the Yankees before the 2014 season, with hopes of bringing similar success to The Bronx.

That didn’t work out, but their departure opened the door for new players such as Gary Sanchez and even Aaron Judge.

“We’re kind of in a similar situation to where the Yankees are,” Beltran said. “Every position, you see guys that, if they stay healthy, can be impact players for a long time to come. It’s a fun clubhouse. I’m the oldest guy in the clubhouse, but I’m trying to keep up with them.”

And he’s trying to get to his second World Series (he went and lost with the Cardinals in 2013), coming off perhaps the worst season of his career. He finished with a .666 OPS and ended it with just one homer in his last 41 games. Beltran has one of the most storied postseason careers, with a 1.078 OPS — which began during his remarkable run with the Astros in 2004 — when he nearly got them to the World Series by himself.

He has had other seasons in which he’s nearly made it, including with the Mets in 2006 — and at 40 years old, he knows this could be his last best opportunity to get there.

“That’s a motivation for me and all of us,” Beltran said. “This team was very close to the World Series a couple years ago. They’re hungry. When you get to this point, everyone is hungry.’’

“We’re rooting for [Beltran] to be a World Series champion,” Houston manager A.J. Hinch said. “Now, some of that is for him, but most of it is for us. We want to be champions.”

They will have to get through a Yankees’ team that they are both familiar with.

“I’ll know certain tendencies, but it all comes down to execution,” said McCann, who added he saw the Yankees’ rise coming.

“I really did,” McCann said. “It’s a little crazy, but I was behind the scenes and got to see those guys play. The way Sanchez came up last year and what I had seen from Judge, they just had to put it all together.”

And McCann insisted the matchup won’t be uncomfortable.

“I think it worked out for both teams,” the catcher said when asked if he wanted to prove the Yankees wrong for trading him for prospects. “I don’t look at it like that. Right now, it’s about who wins four games first. And we like where we’re at.”