McGee has averaged 8.4 points, 5.5 rebounds and 1.8 blocks in his seven NBA seasons. The 7-footer has played 382 games with Washington, Denver and Philadelphia.
The Mavericks announced the signing Thursday.
McGee was waived in March by Philadelphia, two weeks after he had been acquired in a trade from the Nuggets. He averaged 4.6 points and 2.7 rebounds in his 23 combined games last season for the two teams.
Washington selected McGee 18th overall in 2008 after he declared for early entry in the draft after his sophomore season at Nevada.
McGee's father, George Montgomery, was a second-round draft pick of the Portland Trail Blazers in 1985. His mother, Pamela McGee, played in the WNBA.