Sources told ESPN.com that McRoberts will receive a four-year deal worth an estimated $23 million -- the full midlevel exception -- which includes an option to return to free agency entering the fourth season.
Granger, who played for the Indiana Pacers and Los Angeles Clippers last season, has agreed to a two-year, $4.2 million deal with the Heat, according to other sources.
McRoberts thus becomes the first player Riley can present to LeBron James as a new future teammate in Miami's quest to persuade James to re-sign with the Heat.
"From Coach [Spoelstra] to [Heat executive] Andy Elisburg to Pat to ownership, they were all really excited about Josh," agent Mike Conley of BDA Sports said in a phone interview. "They all met with Josh, came out from day one with their offer and made it clear to us that Josh is who they want.
"It was probably the toughest decision he's ever had to make, but it could be a once-in-a-career opportunity for Josh to join a great team with a great player. They're looking at Josh coming in and being a major factor."
The versatile power forward was pursued hard by eight teams and also received a strong offer from the Charlotte Hornets, who badly wanted to keep McRoberts for his passing and shooting ability. He averaged 8.5 points, 4.8 rebounds and 4.3 assists per game last season.
Granger averaged 8.2 points and 3.2 rebounds per game last season.
Both players can't officially sign with Miami until Thursday.
The Heat, in recent days, have been talking to a number of free agents in hopes of securing a verbal commitment or two to impress James and encourage him to stay in Miami in the face of the serious interest James is drawing from the likes of the Cleveland Cavaliers and Phoenix Suns.
Sources say James was made aware last week of the Heat's determination to sign McRoberts to add his playmaking and floor-spacing abilities to Miami's mix. Charlotte coach Steve Clifford was a big McRoberts fan who often ran his offense through the 6-foot-10 forward, who is regarded as one of the game's best passing big men.
Pau Gasol, Luol Deng, Marvin Williams and Anthony Morrow are among the other free agents that Riley and Spoelstra have chased, according to sources. But Miami -- provided it can successfully re-sign James, Chris Bosh and Dwyane Wade -- has limited funds available now to pursue the likes of Williams and Morrow for additional outside shooting.
"There's now a huge appreciation around the league for how Josh plays," BDA founder Bill Duffy told ESPN.com. "And this [move] may be the impetus for something bigger as the first player outside the Big Three that Miami has landed."
Ramona Shelburne of ESPN.com contributed to this report.
Josh McRoberts Commits To Heat
Tom Penn discusses the report that Josh McRoberts has committed to sign a deal with the Heat.