Updated

For a pitcher who just fell short of qualifying for a victory, James McDonald sounded pretty satisfied.

The Pittsburgh Pirates right-hander made his first start in nearly a month in a 3-2 loss to the St. Louis Cardinals on Tuesday night. McDonald didn't allow a hit the first three innings but departed after giving up Albert Pujols' sacrifice fly that tied it at 2 with two outs in the fifth.

"It's progress. I got into some situations, I got myself out of jams," McDonald said. "I didn't have my great stuff today, but I had enough stuff to compete and keep my team in the game. So I was happy."

Allen Craig had an RBI single in the fourth as Cardinals caught up with McDonald, who made his last official spring training start on March 11 due to soreness in his left side. McDonald worked twice against minor leaguers in the last week of March.

McDonald was most disappointed about his four walks. He threw 87 pitches, 51 for strikes.

"Arm strong, threw some good breaking balls, command a little iffy right now," manager Clint Hurdle said. "But he battled to almost get through five.

"He needs to get in front of hitters a little more."

Pujols had the tying and go-ahead RBIs and Kyle McClellan rebounded from a shaky beginning to pitch well in his first career start for the Cardinals. Pujols hasn't seemed comfortable at the plate in the opening homestand, grounding into three double plays in one game and entering 2 for 16 with a solo homer.

The three-time NL MVP didn't exactly bust out against the Pirates but came through with a sacrifice fly to tie it at 2 in the fifth and bounced a go-ahead single through the left side off Scott Olsen (0-1) in the seventh.

McClellan, in the rotation because of a season-ending injury to Adam Wainwright, gave up two runs and six hits in six innings. He struck out seven and walked one.

Ryan Franklin worked the ninth for his first save in two chances, allowing a two-out hit to pinch-hitter Ryan Doumit before striking out pinch-hitter Steven Pearce. The 38-year-old closer gave up a tying home run to the Padres' Cameron Maybin with two outs in the ninth of an extra-inning loss in the season opener on Thursday.

The Pittsburgh hitters were quiet after Lyle Overbay's 421-foot, two-run homer in the first.

Neil Walker and Pedro Alvarez each went 0 for 4 and struck out three times — Alvarez also hit into a double play. Pirates hitters fanned 11 times overall.

The Cardinals have yet to score more than three runs during a 2-3 start, the other victory coming on Jaime Garcia's four-hit shutout over the Padres on Sunday.

McClellan struck out three in the first inning yet left the mound trailing after hanging a 1-2 curveball on Overbay's shot into the Cardinals bullpen in right.

The former setup man took Wainwright's spot after going 4-0 with an 0.78 ERA in a sterling spring. He blanked the Pirates on five hits the next five innings and threw 95 pitches in his first start since he was with Class A Palm Beach in 2007.

Miguel Batista (1-0) followed McClellan and gave up a hit and a walk in 1 2-3 innings in his first appearance of the season.

NOTES: McClellan led the Cardinals with 68 appearances last year, none longer than two innings. ... The Cardinals hit into two double plays for a five-game total of nine. ... Backup catcher Gerald Laird made his first start for St. Louis and was 0 for 4 with a popup, two strikeouts and a double-play ball.