December 16, 2014, McCarthy and the Los Angeles Dodgers signed a four-year contract worth $48 million. However, on April 27, 2015, McCarthy was placed on the disabled list after he felt tightness in his right elbow in a start against the San Diego Padres and was diagnosed with a torn UCL. He underwent season-ending Tommy John surgery on April 30. In four starts before his injury, he was 3–0 with a 5.87 ERA. After a lengthy recovery and a few rehab starts in the minors, McCarthy rejoined the Dodgers on July 3, 2016, making his season debut in a 4–1 win against the Colorado Rockies. In his first four starts he went 5 or more innings, won two games and pitched fairly effectively however on July 27 he allowed three runs in four innings and his next three starts after that he couldn't get past the fourth inning and walked five batters in each game, including five in innings on August 13. On August 14, he was placed on the 15-day disabled list with stiffness in his right hip. He thought his career might be in jeopardy but he rejoined the team on September 25 and allowed only two runs in innings against the Colorado Rockies. His last appearance of the season was a relief appearance against the San Francisco Giants on September 30. He allowed six runs on five hits and one walk without retiring a single batter. He appeared in a total of 10 games for the Dodgers in 2016 (with nine starts), and was 2–3 with a 4.95 ERA. In 2017, McCarthy started the season in the rotation and won five of his first six decisions. However, his season was beset with issues, he was placed on the disabled list in May after suffering a dislocated left shoulder while weight-lifting, battled the yips in June which led to another lengthy stint on the disabled list. He pitched out of the bullpen at the end of the season. Overall, in 2017, he was 6–4 with a 3.98 ERA in innings over 19 games (16 starts). After being left off the roster for the first two rounds of the playoffs, the Dodgers added him to the active roster for the 2017 World Series. His only appearance in the series was in the 11th inning of Game Two. He allowed a two-run home run to George Springer of the Houston