The 31-year-old right-hander was acquired by the New York Yankees from the Arizona Diamondbacks in July and was 7-5 with a 2.89 ERA in 14 starts after the trade. In total, he finished 10-15 with a 4.05 ERA in 2014.
In 2012, while pitching for the Oakland Athletics, he was hit in the head by a line drive off the bat of the Los Angeles Angels' Erick Aybar and needed emergency surgery to relieve pressure on his brain caused by internal bleeding. In 2013, as a member of the Diamondbacks, he suffered a seizure that doctors said was related to the head injury he suffered from the line drive.
McCarthy's injury history -- he has made as many as 30 starts just once in his career -- convinced many people that he likely wouldn't get a deal as long as four years, but McCarthy made some believers in his 90 1/3 innings pitching for the Yankees.
McCarthy, who developed an interest in advanced statistical metrics, and Dodgers general manager Farhan Zaidi were said to be friends when the two were in Oakland.
The agreement with McCarthy was part of a busy evening for the Dodgers, who shook up the third day of the winter meetings with trades with the Miami Marlins and Los Angeles Angels that involved eight players. The Dodgers also have agreed to a trade to acquire veteran shortstop Jimmy Rollins, sources told ESPN The Magazine's Buster Olney.
Information from ESPN.com's Jerry Crasnick and ESPNLosAngeles.com's Mark Saxon was used in this report.