The 23-year-old moves to McDiarmid Park from Cardiff City and could make his debut in Tuesday's Betfred Cup tie with Falkirk in Perth.
Saints boss Tommy Wright told the club website: “This is a really exciting signing and I’d like to thank the chairman for pushing this one through so quickly because there was a lot of interest being shown in Matty from other clubs. I think it's a real coup for us.”