The Mets received minor league catcher Austin Bossart in the deal, and the Phillies could get a boost to a starting rotation that has struggled throughout the season.
The Phillies also received cash considerations. Vargas is owed $2,666,667 of his $8 million salary for the remainder of this season, and his contract includes an $8 million club option for 2020 with a $2 million buyout.
Vargas, 36, is 6-5 with a 4.01 ERA in 19 games (18 starts) this season. The 14-year veteran got off to a terrible start but has fared better over the past two months, going 5-3 with a 3.34 ERA in his 12 most recent starts.
"Jason Vargas is battle-tested and has been relatively effective for the better part of a decade now,'' Phillies general manager Matt Klentak said. "He gives his team a chance to win the game every time he takes the ball. I like the fact it's a different look. He's a soft-tossing lefty. We have a lot of hard-throwing righties. He's a good complement to our pitching staff.''
The Phillies (55-50) are six games behind the first-place Atlanta Braves (62-45) in the National League East despite entering Monday with a 4.59 combined ERA for starting pitchers, the fifth-worst mark in the league.
Vargas' ERA would be second to that of Aaron Nola on Philadelphia's staff, and his WHIP (1.27) would rank first. Opponents are batting .228 against Vargas despite a fastball that averages 85 mph.
The Phillies added a starting pitcher last week when they signed lefty Drew Smyly after he opted out of a minor league deal with Milwaukee. Smyly allowed one run in six innings in a 2-1 win at Pittsburgh on July 21 in his first start and takes the mound Tuesday against the Giants.
Vargas made headlines earlier this season when he threatened to fight a reporter during a testy postgame exchange in the clubhouse.
"My first thought was that was so out of character for Jason to be involved in anything like that,'' Klentak said. "The guy I knew in Anaheim, it's just not who he is. He's not an overbearing personality at all like that. He's very popular in the clubhouse with everybody. He's very likable. On the mound, he's a very hard worker and good teammate. It just didn't add up."
ESPN's Jeff Passan and The Associated Press contributed to this report.