The 27-year-old has agreed a two-and-a-half year contract at The Den.
The transfer is subject to the formalities being completed and Football League clearance.
Dons manager Karl Robinson admits that it will be hard to replace Williams, who was named both MK Dons Player of the Year and Players’ Player of the Year last season.
“(Shaun) is going to be a big loss to the Football Club. His contract was due to run out at the end of the season and although we offered him a new deal, he’s decided to move on and we’ve got to respect that," he told the club's official website.
“I’m just extremely grateful and thankful to Shaun for all he’s done for me and the Football Club and I wish him all the best in this new chapter of his career.
"He’ll always be welcome back at Stadium MK whether that be as a fan or as a player."
More top news
Keiran Sandwell is walking 5000 miles around the coast with his new heart hoping to raise £100,000 for the British Heart Foundation
A woman from Cambridge says her council has gone too far after it fined her for leaving rubbish next to a recycling bin which was full.
Thomas Eastwood, 22, has been sent to prison for 10 years after throwing a corrosive liquid at a man who broke up a fight in Essex.