The 35-year-old, who spent a loan spell at Sixfields in 2011/12, has penned a two-year contract with effect from July 1.
"Matt was always our number one keeping target this summer and I am delighted we have got him," Cobblers boss Aidy Boothroyd told the club's official website.
"I am really pleased that in each of the last two seasons we have got our top goalkeeping targets.
"We have done well to get Matt. We wanted an experienced keeper and Matt fits the bill perfectly.
"We know he will settle in quickly as he knows the club and he knows the staff and I think he will be another excellent addition to the squad."