The Sharks announced Sunday they acquired the defenseman from Detroit for forward Andrew Murray and a conditional 2014 draft pick.
Stuart is eligible to become an unrestricted free agent July 1. Sharks general manager Doug Wilson says he is hopeful he can sign Stuart to a new contract later this month.
Stuart was drafted third overall by San Jose in 1998 before being traded to Boston in 2005 as part of a package for Joe Thornton. Stuart later played for Calgary, Los Angeles and Detroit, winning a Stanley Cup with the Red Wings in 2008.
The 32-year-old Stuart had six goals and 15 assists in 81 games last season.