The 31-year-old, who has been capped 29 times by Scotland, has agreed terms on a three-year contract with the Premier League club.
"I'm really excited to be here and I'm happy that everything is done now," McGregor told the club's official website.
"I can't wait to get started here. This is a great chance for me to play in the Premier League and I'm looking forward to the season ahead."
McGregor is expected to join his teammates for pre-season training later this week.