The Miami Marlins were shoppers instead of sellers for a change at the trade deadline, and they added a starting pitcher to help make a playoff push.

Miami acquired right-hander Jarred Cosart from the Houston Astros in a six-player deal Thursday. The Marlins also acquired infielder-outfielder Kiki Hernandez and outfielder Austin Wates for third baseman Colin Moran, outfielder Jake Marisnick, right-hander Francis Martes and a 2015 compensatory draft pick.

The Marlins, often out of the race before August, were in the market to upgrade their young, thin rotation after a recent six-game winning streak put them back in the playoff picture.

The 24-year-old Cosart is 9-7 with a 4.41 ERA in 20 starts this year but has struggled lately, allowing 21 runs in 21 1/3 innings over four starts in July.

The Astros made the deal Thursday while 22 1/2 games out of first place in the AL West.

Hernandez batted .284 in 24 games for Houston this year and hit .337 in 67 games for Triple-A Oklahoma City. Wates, a third-round draft pick in 2010, batted .299 in 74 games for Oklahoma City.

Cosart and Hernandez will join the Marlins on Friday. Wates will be assigned to Triple-A New Orleans.

Moran was the sixth overall pick in last year's draft after playing at the University of North Carolina. He batted .294 with five home runs in 89 games this year at Single-A Jupiter.

Marisnick batted .277 with 10 homers in 89 games this year for Triple-A New Orleans. He has a career average of .178 in 58 major-league games.