In return, the Bills will send linebacker Kiko Alonso to the Eagles, the source said.
The trade cannot be made official until the new league year begins Tuesday at 4 p.m. ET.
McCoy has the NFL's third-most rushing yards (6,792) and fourth-most rushing touchdowns (44) since the Eagles drafted him in the second round in 2009. He finished last season with 1,319 rushing yards, third-most in the NFL.
A source familiar with McCoy's thinking told ESPN's Josina Anderson that the veteran running back is not pleased with the move.
"He's a Pennsylvania kid. He's never played football outside of Pennsylvania -- high school, college, pro," the source said. "So of course he's not happy."
The source also told Anderson that McCoy is "frustrated" and is "not going to make it easy, that's for sure."
The Eagles will clear cap space by trading McCoy, who was set to count $11.95 million against their 2015 cap. The Bills will owe McCoy, who is signed through 2017, $10.25 million this season.
Eagles running back Darren Sproles took to Twitter to express his shock over the news of McCoy's impending departure.
Nothing surprises me in this business anymore! In total shock!— Darren Sproles (@DarrenSproles) March 4, 2015
Go do what you do @CutonDime25— Darren Sproles (@DarrenSproles) March 4, 2015
Philadelphia also released two players Tuesday -- defensive end Trent Cole, who was set to count for $11.625 million against the salary cap, and cornerback Cary Williams, who would have counted for $8.17 million -- while they take on less than $1 million in each of the next two seasons by acquiring Alonso, who will be a restricted free agent after the 2016 season.
Alonso, a second-round pick in 2013, played every defensive snap for the Bills as a rookie and ranked third in the NFL with 159 tackles. He finished second in the Associated Press' voting for defensive rookie of the year.
After tearing his ACL while training last July, Alonso was placed on the non-football injury list and missed the entire 2014 season.
A source told ESPN's Adam Caplan that Alonso's rehab has gone very well and he has increased his training activities and started running.
"I think I'm at almost 7½ months and I'm doing just about everything," Alonso told the Bills' official radio show on Feb. 25. "Obviously at a very controlled pace, just not going obviously 100 percent. I wouldn't say I'm at 100 percent yet but I'm definitely moving in the right direction and taking it slow.
"I anticipate being 100 percent before camp. By camp, I definitely feel I'll be 100 percent."
An Oregon product, Alonso will reunite with his former college coach, Chip Kelly, who will enter his third season in Philadelphia. Without Alonso, the Bills' top options at linebacker next season will be Nigel Bradham and Preston Brown. They also could re-sign Brandon Spikes or add a free agent like David Harris, who played for new Bills head coach Rex Ryan while with the Jets.
The Bills are expected to adopt a run-first approach under Ryan and offensive coordinator Greg Roman. The Bills' leading rusher last season, Fred Jackson, turned 34 last month, while C.J. Spiller will become an unrestricted free agent next week.
"Management called me and told me that they were [trading for McCoy] and pretty much giving me a 'thank you for your service,'" Spiller said during an appearance on NFL Network on Tuesday evening. "I feel still the same. Nothing's changed. The game plan is still the same. The only thing is that I won't be returning to Buffalo."
Spiller said he found out that he will not be returning to the team when he was in the studio for his NFL Network appearance. "Very few guys get to play their whole career at one team, but unfortunately that doesn't happen in this business, and I found out today it doesn't happen in this business," he said.
This is the second time in less than a year that the Bills and Eagles have made a trade involving a running back. Buffalo acquired Bryce Brown during May's draft for a conditional fourth-round pick from Philadelphia. Brown, who remains under contract with the Bills, was active for seven games, rushing for a career-low 126 yards.
That trade prompted Jackson and McCoy, then with the Eagles, to exchange jabs on Twitter.
Tuesday's news also made waves with other NFL players -- past and present -- on Twitter.
Wow Shady to Buffalo huh? Crazy!— Patrick Peterson (@RealPeterson21) March 3, 2015