McGrady played for the Magic from 2000 to 2004, making the All-Star Game all four seasons.
The team said the 38-year-old McGrady will be available to the players and coaches on and off the court, will assist and advise the executive team in several areas and will help with promotion, marketing and community relations activities for the Lakeland Magic of the NBA G League.
"Having Tracy McGrady, a perennial All-Star and a Hall-of-Famer, on our staff is tremendous for our entire organization," Martins said in a statement. "Whether it will be on the court with the team or in the Central Florida community, Tracy's knowledge, experience and stature will be an incredible asset for our players and our organization. We are extremely excited to bring him back home."
McGrady played in 295 games (294 starts) during his four seasons with the Magic, averaging 28.1 points, 7.0 rebounds, 5.2 assists and 1.53 steals.
While with Orlando, McGrady was a two-time All-NBA first-team selection (2001-02, 2002-03), a two-time All-NBA second-team selection (2000-01, 2003-04) in addition to being four-time All-Star (2001-04).
McGrady led the NBA in scoring twice (2002-03 with a 32.1-point average and 2003-04 with a 28.0-point average). He and was named the NBA's Most Improved Player in 2000-01.
"I am thrilled to be back where I truly made a name for myself -- with the Orlando Magic," McGrady said. "The DeVos family and the entire organization have always done everything in a first-class manner and I am excited to be able to help them with whatever they may need."
McGrady, who played 15 seasons in the NBA, was inducted into the Naismith Memorial Basketball Hall of Fame in September. He retired after the 2011-12 season.