McRae will join the Cherry and Whites once he has fulfilled commitments with his Sydney-based club Randwick.
McRae replaces French fly-half Ludovic Mercier, who has moved to Grenoble. McRae spent a season with Saracens before returning to Australia, where he played for the NSW Super 12 side.
"We know that McRae is a player of real quality, and we are excited about what he can do in a Gloucester shirt," said Gloucester rugby director Nigel Melville.
"He knows the Zurich Premiership and the Super 12 competitions, and has been around for a while, which will help the young players we have in the squad to develop around him."
McRae is best known to British & Irish fans for repeatedly punching Ronan O'Gara during a match on the Lions tour of Australia in 2001, an incident for which he was sent off and given a lengthy ban.