The deal includes nearly $16 million in guaranteed money, according to a source.
McPhee, 26, emerged as one of the top under-the-radar pass rushers last season with 7.5 sacks despite playing behind Pro Bowl outside linebackers Terrell Suggs and Elvis Dumervil. McPhee played roughly half of the Ravens' defensive snaps.
McPhee was considered a luxury that the Ravens couldn't afford to retain as his four-year, $2.2 million rookie contract expired. The Ravens are dealing with a tight salary cap situation and have pressing needs at other positions.
This is not an unfamilar situation for the Ravens, who have regularly developed young defensive players, only to lose them in free agency.
It happened last year, when defensive tackle Arthur Jones was signed by the Indianapolis Colts to a five-year, $33 million contract with $16 million guaranteed. Two years ago, Ravens linebackers Paul Kruger (five years, $40.5 million, $13 million guaranteed) and Dannell Ellerbe (five years, $35 million, $14 million guaranteed) signed with the Cleveland Browns and Miami Dolphins, respectively.
McPhee had 64 quarterback pressures last season and 24 quarterback hits while lining up everywhere from nose tackle to defensive end. A fifth-round draft pick in 2011 out of Mississippi State, the 6-foot-3, 280-pound McPhee has a versatility and combination of size and mobility that makes him attractive to NFL teams.
And in 2014, unlike in previous season, McPhee remained healthy all year.
McPhee acknowledged in December that leaving the Ravens was a possibility.
"I would love to be here," McPhee said. "It's a business. I hope they'll want me back. I hope so, man. I don't know if they're talking, but I hope so. This is where I was born in the NFL, and I wouldn't mind continuing to live here and keep it going."
He cannot officially sign until free agency begins Tuesday.