Right-hander Paul Clemens was optioned to Triple-A Oklahoma City following Friday's game.
Farnsworth, 38, had three saves and a 3.18 ERA in 19 Major League games with the Mets this season. He was given his release on Wednesday, just two days after earning a save for the Mets in their 9-7 win over the Yankees at Yankee Stadium.
The veteran reliever made his first appearance as an Astro on Saturday, but struggled. Farnsworth came into the game in the eighth inning with the score 6-3, and allowed two runs on two hits and two walks. He was pulled with two men on for Darin Downs, who recorded the final out with no further damage.
"It's a good opportunity to come here and help this team win, and help the guys out in the bullpen and try to turn this thing around and have a little fun," he said.
Farnsworth, who still throws in the mid-90s, will likely serve as Porter's set-up man to Chad Qualls, who has settled into the closer role.
"You're talking about a guy who has experience as a closer, he's pitched high-leverage innings the last 10 years of his career and he's been here, he's done it," Porter said.
Porter said he spoke to Farnsworth on the phone prior to his signing in an effort to help improve the Astros bullpen. Houston relievers entered Saturday with a 5.56 ERA, which was the highest in the Major Leagues, though they've pitched better lately.
"We brought in some veteran guys we needed to shore up our bullpen and we've had injuries that have taken a couple of guys out of the mix, and he became available," Porter said. "We saw it as an upgrade, and it was something we acted swiftly on because he had other teams that [were in interested in] acquiring his services as well. I had a good conversation with him, and he's excited to be here and do everything he can to help us win some ballgames."
Farnsworth has other connections to the Astros, as well. He was managed by Astros bench coach Dave Trembley in 1998 at Double-A West Tenn and in 2000 at Triple-A Iowa.
A veteran of 16 Major League seasons, Farnsworth has appeared in 877 career games with the Cubs (1999-2004), Tigers (2005, 2008), Braves (2005, 2010), Yankees (2006-08), Royals (2009-10), Rays (2011-13), Pirates (2013) and Mets (2014).
Clemens, 26, has made eight appearances for the Astros this season, posting a 4.08 ERA. He pitched Friday against the White Sox, tossing 2 1/3 innings. With the addition of Farnsworth, the Astros 40-man roster is now full at 40.
The Astros haven't been shy about finding bullpen help. Two weeks ago, they signed veteran lefty Tony Sipp, who has set a franchise record by not allowing a baserunner in his first four relief appearances, retiring the first 17 batters he faced.