The 23-year-old moves in the opposite direction to the club's first summer signing Jonny Howson.
He departs Boro for an undisclosed fee after making eight appearances during his three years with the club, including one in each of the last two seasons. His final appearance was his Premier League debut, at Hull in April.
The former Doncaster defender, unable to dislodge George Friend as the club's first choice left-back, has spent much of his Boro career on loan elsewhere.
He figured prominently for both Fulham and Huddersfield during loan spells and was only denied the opportunity of another loan move last term when a summer injury ruled him out of the bulk of pre-season and ensured he was sidelined when the transfer window closed.
James leaves with the best wishes of everyone connected with MFC.