The Giants, who have been searching for a third baseman since Pablo Sandoval turned down a five-year, $95 million offer last month to flee to Boston in free agency, seized the opportunity to add McGehee. The reigning World Series champions sent pitchers Kendry Flores and Luis Castillo to Miami.
A right-handed batter, McGehee hasn't always matched Sandoval's production, though he has performed respectably.
After spending 2013 with the Rakuten Golden Eagles in Japan, McGehee hit .287 with four home runs and 76 RBIs in 160 games for Miami. He batted .319 with runners in scoring position, but he slumped in the season's second half, hitting .243 overall compared to .319 in the first half. He also grounded into a league-high 31 double plays.
A .264 lifetime hitter, McGehee has played for the Brewers, Pirates, Cubs and Yankees as well as the Marlins. He enjoyed his best season in 2010, when he batted .285 with 23 home runs and 104 RBIs with Milwaukee.
McGehee, who owns a .260 career average (13-for-50) in 15 games at AT&T Park, will be eligible for free agency after the 2015 season. He, Giants executives and manager Bruce Bochy were scheduled to discuss the deal on a conference call on Saturday.
Flores, ranked as the No. 16 prospect in the Giants' system by MLB.com, finished 4-6 with a 4.09 ERA in 20 starts for Class A Advanced San Jose this year. But the 23-year-old accumulated 112 strikeouts in 105 2/3 innings.
Performing for Class A Augusta this season, the 22-year-old Castillo compiled a 2-2 record with a 3.07 ERA and 10 saves after spending two years in the Dominican Summer League. He struck out 66 batters in 58 2/3 innings.
Chris Haft is a reporter for MLB.com. Read his blog, Haft-Baked Ideas, and follow him on Twitter at @sfgiantsbeat. This story was not subject to the approval of Major League Baseball or its clubs.