The 21-year-old, who can play at right-back, centre-back or in midfield, made his first-team debut for Boro against Chelsea in October 2008.
He spent time on loan with Tranmere last season.
Cobblers caretaker boss Ian Sampson: "John is a tough lad with a very good attitude and we are pleased to have him here.
"He is a very good footballer and a player who I think will improve the squad.
"He jumped at the chance to come here and that is important. He is keen to come here, get stuck in and do well for us."
The club is struggling in League Two, fourth from bottom with only two wins in eight league outings.