The 27-year-old, who spent last season on loan at Bloomfield Road, has put pen to paper on a two-year deal with an option of a further year.
"It's good to have it all tied up now and be able to focus on the new season," MacKenzie told the club's official website. "I'm just looking forward to getting out on the training pitch with the boys again and planning for the start of the season.
"I enjoyed my time here last season and the three months that I had here were pretty good. It gave me a wee taste of Championship football and it kind of made my mind up of where I wanted to try and play. I've been given the opportunity to come here and do that so hopefully I can do well."
MacKenzie made 12 appearances for the club last season.