Terms of the deal were not announced, but sources told ESPN's Adrian Wojnarowski it is a one-year guaranteed minimum contract.
McGee, 35, was waived by the Dallas Mavericks on Tuesday, about a year after he signed as a free agent on a three-year contract. He started seven of the first nine games but fell out of the rotation about a month into the season and played sparingly the rest of the way.
McGee averaged 4.4 points and 2.5 rebounds in 42 games last season and has career averages of 7.8 points and 5.2 rebounds.
A 15-year veteran, McGee is a three-time NBA champion, winning twice with Golden State as a backup before starting 68 regular-season games for the Los Angeles Lakers in 2019-20. He didn't play in the NBA Finals when LA beat Miami in the playoff bubble.
Information from The Associated Press was used in this report.