"This deal is about putting a team together, players who can help us now and in the future," general manager Daryl Morey said. "We're excited about how this sets us up for now and especially in the next year."
Houston also has the right to swap first-round picks with New York in 2011, and the Rockets also get New York's 2012 first-round pick.
A source close to the negotiations told ESPN NBA Insider Chad Ford that the Knicks' 2011 pick is top-1 protected, and the 2012 pick is top-5 protected.
Depending on where the 2010-11 salary cap is set, the Knicks could have enough room to make maximum offers to two free agents, which was the lofty goal team president Donnie Walsh set for himself upon taking over nearly two years ago. The Knicks have not been below the salary cap since 1996, when they signed free agents Allan Houston and Chris Childs.
The Rockets and Kings agreed on a McGrady trade late Wednesday night, and the Knicks -- who had been in detailed discussions with the Rockets for weeks -- came in as the third team with basically the same package they were originally offering to Houston.
"I have tremendous respect for [owner] Leslie Alexander and have enjoyed playing for the Rockets over the last six years," McGrady wrote. "It has definitely been the most profound part of my career. I've learned a lot about myself from various situations, both good and bad that have occurred here. It was my hope when I came to Houston that I wouldn't leave, but I do understand this is the business side of basketball."
Senior writer Marc Stein and ESPN Insider's Chris Sheridan cover the NBA for ESPN.com. Information from the Associated Press was used in this report.