The veteran switch-hitter gives the Mets even more depth in a crowded infield. He could be a backup option at shortstop behind Amed Rosario.
Espinosa spent last season in Triple-A with three organizations: the Blue Jays, Dodgers and Phillies. He was released by Philadelphia in August.
The 31-year-old is a .221 career hitter with 98 homers and 316 RBIs in 872 major league games over eight seasons with the Nationals, Angels, Mariners and Rays. He has mostly played second base but was Washington's everyday shortstop in 2016, when he batted .209 with a career-high 24 home runs and 72 RBIs.
Espinosa also has played third base, first base and left field in the big leagues.