The Cardinals also placed catcher Jason LaRue on the 60-day disabled list. LaRue sustained a concussion in a fracas with the Reds earlier this month.
Felipe Lopez has been starting at third base since David Freese was sidelined by injuries in June. He's slumped at the plate and in the field lately, committing two errors on Wednesday, prompting the Cardinals to go after the 35-year-old Feliz.
He started for the Phillies' 2008 World Series team, and has played 97 games for the Astros while batting .221 with four homers and 31 RBI. Feliz also has the second-best fielding percentage among third baseman since 2007 at .967.
He's made 60 starts at third base and 10 at first base for Houston.
"It's been a tough year for him, and with the changes that we've made, his playing time would continued to be limited," Astros general manager Ed Wade said. "This deal puts him back into a pennant race and his veteran presence should help the Cardinals."
Carpenter was 5-3 with a 2.36 ERA and 20 saves at Class-A Palm Beach.
"We've acquired a power arm for our system and we'll give him every chance to develop into a major leaguer," Wade said.
The Astros also reinstated infielder Tommy Manzella from the disabled list. Manzella hit .366 (15 for 41) in 11 games during a rehab stint from a fractured left index finger. He was batting .212 in 59 games with Houston, with one homer and 16 RBI.