On June 29, 2004, McGrady, Juwan Howard, Tyronn Lue, and Reece Gaines were traded to the Houston Rockets as part of a seven-player deal that sent Steve Francis, Cuttino Mobley, and Kelvin Cato to the Magic.
In response to the trade, McGrady stated that he was happy with the situation and expressed excitement over the prospect of playing alongside Rocket All-Star center Yao Ming.
Shortly after arriving in Houston, McGrady signed a three-year, $63 million contract extension with the team.

The Rockets struggled to begin the 2004–05 season, posting a losing record of 16–17 through their first 33 games.
In December, McGrady had one of the most memorable performances of his career, scoring 13 points in the final 35 seconds against the San Antonio Spurs to secure a comeback victory.
The sequence included four consecutive three-pointers, one of which was part of a four-point play and the last of which was a game-winner in the final two seconds.
After the All-Star break, Houston rebounded from their slow start, finishing the season with 51 wins and the third-best record in the West.
McGrady's final averages were 25.7 points, 6.2 rebounds, and 5.7 assists per game.
In Game 2 of the first round of the postseason, he had another signature performance, completing a "thunderous" dunk over 7'6" Dallas Mavericks center Shawn Bradley and hitting a game-winner for a 113–111 victory.
The series would go to a decisive Game 7, where McGrady came out cold, missing his first seven shots en route to a 40-point loss.

The 2005–06 season was a disappointing one for the Rockets, as McGrady appeared in only 47 games due to injury.
At various points during the year, he missed time due to back spasms, including a moment in January where he had to be carried off the court in a stretcher due to a severe flare up.
Despite his health concerns, McGrady was able to play in that year's All-Star Game in front of his home crowd in Houston, exploding for 36 points in just 27 minutes.
For the season, he averaged 24.4 points and 6.5 rebounds per game.
Due in part to his frequent absences, the Rockets failed to qualify for the playoffs.

Early in the 2006–07 season, McGrady missed seven games, again because of back spasms, eventually deciding to visit a doctor and receive treatment for the injury as he felt that it was affecting his speed and explosiveness.
His health issues and the ascension of Yao Ming, who was having a breakout season, resulted in McGrady temporarily becoming the team's second scoring option.
His final averages were 24.6 points, 5.3 rebounds, and 6.5 assists per game.
To open the playoffs, the Rockets were matched up the Utah Jazz.
By this time, pressure had started to mount on McGrady to lead the team deep into the postseason, to which he responded, "If we don’t get out of the first round, it’s on me!"
Houston would eventually lose the series in seven games, and at his postgame press conference following the Game 7 defeat, McGrady, still visibly emotional from the loss, said "I tried, man, I tried."

In 2007–08, the Rockets went on a 22-game winning streak, the then-second longest in NBA history, despite missing Yao Ming during that stretch.
During their run, McGrady expressed optimism over the team's roster, admitting, "I haven't had this kind of trust in my teammates before."
Houston finished the season as the West's fifth seed, earning them a rematch with the Jazz in the first round.
By the time the playoffs arrived, McGrady was nursing shoulder and knee injuries, at times requiring him to receive pain-killing injections and have fluid drained from both his shoulder and knee in order for him to be able to play.
The Jazz again eliminated the Rockets, this time in six games, despite a strong 40-point and 10-rebound performance from McGrady in the decisive Game 6.

Following Houston's loss to Utah, McGrady underwent arthroscopic surgery on both his left shoulder and left knee.
Early in the 2008–09 season, he missed 18 games, including a two-week stretch in January as his knee was not fully healed from his offseason surgery.
On February 24, he had
On June 29, 2004, McGrady, Juwan Howard, Tyronn Lue, and Reece Gaines were traded to the Houston Rockets as part of a seven-player deal that sent Steve Francis, Cuttino Mobley, and Kelvin Cato to the Magic. In response to the trade, McGrady stated that he was happy with the situation and expressed excitement over the prospect of playing alongside Rocket All-Star center Yao Ming. Shortly after arriving in Houston, McGrady signed a three-year, $63 million contract extension with the team.
The Rockets struggled to begin the 2004–05 season, posting a losing record of 16–17 through their first 33 games. In December, McGrady had one of the most memorable performances of his career, scoring 13 points in the final 35 seconds against the San Antonio Spurs to secure a comeback victory. The sequence included four consecutive three-pointers, one of which was part of a four-point play and the last of which was a game-winner in the final two seconds. After the All-Star break, Houston rebounded from their slow start, finishing the season with 51 wins and the third-best record in the West. McGrady's final averages were 25.7 points, 6.2 rebounds, and 5.7 assists per game. In Game 2 of the first round of the postseason, he had another signature performance, completing a "thunderous" dunk over 7'6" Dallas Mavericks center Shawn Bradley and hitting a game-winner for a 113–111 victory. The series would go to a decisive Game 7, where McGrady came out cold, missing his first seven shots en route to a 40-point loss.
The 2005–06 season was a disappointing one for the Rockets, as McGrady appeared in only 47 games due to injury. At various points during the year, he missed time due to back spasms, including a moment in January where he had to be carried off the court in a stretcher due to a severe flare up. Despite his health concerns, McGrady was able to play in that year's All-Star Game in front of his home crowd in Houston, exploding for 36 points in just 27 minutes. For the season, he averaged 24.4 points and 6.5 rebounds per game. Due in part to his frequent absences, the Rockets failed to qualify for the playoffs.
Early in the 2006–07 season, McGrady missed seven games, again because of back spasms, eventually deciding to visit a doctor and receive treatment for the injury as he felt that it was affecting his speed and explosiveness. His health issues and the ascension of Yao Ming, who was having a breakout season, resulted in McGrady temporarily becoming the team's second scoring option. His final averages were 24.6 points, 5.3 rebounds, and 6.5 assists per game. To open the playoffs, the Rockets were matched up the Utah Jazz. By this time, pressure had started to mount on McGrady to lead the team deep into the postseason, to which he responded, "If we don’t get out of the first round, it’s on me!" Houston would eventually lose the series in seven games, and at his postgame press conference following the Game 7 defeat, McGrady, still visibly emotional from the loss, said "I tried, man, I tried."
In 2007–08, the Rockets went on a 22-game winning streak, the then-second longest in NBA history, despite missing Yao Ming during that stretch. During their run, McGrady expressed optimism over the team's roster, admitting, "I haven't had this kind of trust in my teammates before." Houston finished the season as the West's fifth seed, earning them a rematch with the Jazz in the first round. By the time the playoffs arrived, McGrady was nursing shoulder and knee injuries, at times requiring him to receive pain-killing injections and have fluid drained from both his shoulder and knee in order for him to be able to play. The Jazz again eliminated the Rockets, this time in six games, despite a strong 40-point and 10-rebound performance from McGrady in the decisive Game 6.
Following Houston's loss to Utah, McGrady underwent arthroscopic surgery on both his left shoulder and left knee. Early in the 2008–09 season, he missed 18 games, including a two-week stretch in January as his knee was not fully healed from his offseason surgery. On February 24, he had
Tracy McGrady