The 26-year-old joins the Stags following the expiration of his contract at MK Dons.
A product of the Crystal Palace Academy, the London-born player won the club’s Academy Player of the Year in 2013-14 and Development Player of the Year in 2015-16.
Spells on loan at Crawley, Plymouth, Bristol Rovers and Northampton followed before he left the Eagles to join Exeter City on a permanent basis in 2017.
Boateng made 76 appearances in his two seasons in Devon and left to join MK Dons in Sky Bet League One.
In 2020, a loan spell at Cambridge United saw Boateng help steer the club into League One as he recorded 27 appearances for the U’s, who finished second in Sky Bet League Two.
Boateng’s spell at his previous club, MK Dons, saw him enjoy three seasons at Stadium MK, scoring five goals in 65 appearances.
His final appearance for the club came in a 1-0 victory over Wycombe Wanderers in the Sky Bet League One play-off semi-final second leg.
Speaking to iFollow Stags after putting pen to paper at the club, Boateng said: “I’m delighted to be here. I’m delighted to get it over the line, and I can’t wait to get going.
“The manager has really sold it [the move] to me and showed me the plans for where the club is trying to be.
“I think I’m the kind of player that can try and help get the club to where I feel like it belongs.
“I would say I’m a box-to-box midfield player, someone that’s going to give 100% all the time and give a lot of energy.
“I’m someone who knows the league well and knows what it takes to get out of this division which can be difficult.
“I want to be a part of a team that’s going to be successful and part of a team that’s winning.”