Cleveland is acquiring a 2027 unprotected second-round pick and a 2023 second-round pick protected through No. 46, sources told Wojnarowski.
McGee, 33, is averaging 8.0 points and 5.2 rebounds this season. He is expected to serve as a backup to All-Star Nuggets center Nikola Jokic.
It's the second time the Nuggets have acquired McGee in a trade-deadline deal. They also picked him up from the Washington Wizards as part of a three-team exchange in 2012.
Hartenstein, 22, is averaging 3.5 points and 2.8 rebounds this season.
This may be the start of a busy trade-deadline day for the Nuggets, who made it to the Western Conference finals inside the NBA bubble last season before being eliminated by the champion Lakers. The Nuggets are 26-18 and in fifth place in the West.
McGee has been invaluable to the Cavs this season, serving not only as a backup but mentor to the team's young core. He also was their "hype man," leading their pregame huddles and often waving to fans as the Cavs took the floor for warm-ups.
The 7-footer has been a source of energy and optimism for Cleveland, which started well before going into a slide. The Cavs are still hoping to make it into the play-in.
With trade talks picking up, the team chose to rest McGee on Wednesday night in Cleveland's win at Chicago.
Information from The Associated Press was used in this report.