The 24-year-old was released by the Saddlers in May after 19 appearances in three years and has now joined their League One rivals.
"My main aim is to rectify what happened at Walsall," MacGillivray told the Shrews' official website.
"I didn't play as many times as I wanted to and that's what I want to do here, playing as many times as I can."
MacGillivray, who has also played for Stalybridge Celtic and Harrogate Town, is Paul Hurst's seventh signing of the summer.
Defender Zak Jules, midfielders Jon Nolan and Ebou Adams, winger Daniel James and forwards Arthur Gnahoua and Lenell John-Lewis have also been added to the squad.
Find all the latest football transfers on our dedicated page.
Shrewsbury Town have signed former Walsall goalkeeper Craig MacGillivray on a one-year deal.