Two people familiar with the deal told The Associated Press the Eagles have agreed to trade McCoy to the Buffalo Bills for linebacker Kiko Alonso. Both people spoke under condition of anonymity on Tuesday because the teams had not announced the deal.

ESPN first reported the trade. It can't be completed until the 2015 league season begins next Tuesday. McCoy, who played high school, college and pro football in Pennsylvania, could refuse to go to Buffalo.

Since taking full control of all personnel moves away from former general manager Howie Roseman in the offseason, Kelly has been busy reshaping a team that won 10 games in each of his first two seasons in the NFL. He released longtime starting offensive lineman Todd Herremans and third-string tight end James Casey last week. He cut starting cornerback Cary Williams hours before the McCoy trade.

Trading McCoy is a big risk for Kelly, who firmly believes players in his system are replaceable. McCoy thrived in Kelly's up-tempo offense in 2013, leading the NFL with a franchise-record 1,607 yards rushing. His production, along with the rest of the offense, slipped in 2014 and he finished with 1,319 yards. Inconsistency and injuries on the offensive line were a major factor.

It was never clear how much the 26-year-old McCoy and Kelly got along. McCoy said Kelly pushed him harder than any coach he had. ''Chip is constantly on me,'' McCoy said last August. Kelly later created a stir when he said McCoy sometimes practices ''not so great.''

Whatever the relationship, McCoy is gone. Kelly gets another player he's quite familiar with in Alonso. The injury-prone linebacker played for Kelly at Oregon. He had an outstanding rookie year after Buffalo selected him in the second round in 2013. But he tore the ACL in his left knee and missed the 2014 season. Alonso tore the ACL in his right knee at Oregon in 2010. He also had hip surgery last offseason.

Kelly could be gearing up to make a run at another one of his former players. Talk about Heisman Trophy winner Marcus Mariota coming to the Eagles has dominated conversations in Philadelphia. The Eagles would have to trade up from No. 20 in the first round of the draft to get Mariota, who is projected to go as high as No. 1 or 2.

A blockbuster deal to get Mariota was highly unlikely when Roseman was the GM because he values draft picks. But with Kelly calling the shots, anything is possible.

The Eagles currently have about $41 million available under the adjusted 2015 salary cap, so expect them to be quite active when free agency begins next week. They now need a new running back, two starting cornerbacks and plenty of defensive help.

Overall, they saved nearly $21 million under the salary cap on four moves: $7.5 million for McCoy, $6.5 million for Williams, $4 million for Casey and $2.8 million for Herremans. More money-saving cuts are expected. Releasing linebackers DeMeco Ryans ($6.9) and Trent Cole ($8.4 million) would save an additional $15.3 million.