Yorkshire reacted to the move by claiming McGrath, who has three years left on his current deal at Headingley, was in breach of contract and threatening legal action.
McGrath, 31, said he was leaving after failing to resolve unspecified differences with the club.
His exit comes as Yorkshire (Tykes) are attempting to find a new director of cricket, a position which former South Africa pace bowler Allan Donald is reportedly interested in.
McGrath was offered the captaincy in the wake of a last-minute decision by Chris Adams, who had been offered the position at the end of last year, to stay at Sussex.
Yorkshire had announced that Adams would combine the captaincy with the director of cricket role before being stumped by his change of heart.