The 25-year-old will complete the move on 1 July and is Boro’s second summer signing after former Northampton forward Louis Appere.
Kemp began last season on loan at Swindon Town, where he scored 16 goals in 27 appearances, before returning to Stadium: MK in January.
He then played a further 21 games for the Dons, scoring three goals, as they reached the League Two play-offs before losing to Crawley.
“The last 18 months have probably been the best football of my career,” Kemp told BBC Three Counties Radio.
“The manager wants me to be a key player for the group, someone that can help produce quality moments in the final third which is what I’m good at.”
Kemp began his career in the youth set-ups at Chelsea and West Ham and had a loan spell at Stevenage in 2020, scoring once in six appearances.