Terms of the deals were not disclosed.
"It's great to be here," Matthews told the team's website. "I'm looking forward to a new opportunity and a new chapter in my life."
The Vikings are in the market for a new starting middle linebacker after Jasper Brinkley signed a two-year deal with the Dallas Cowboys earlier this month. Matthews has more NFL starting experience at an inside linebacker position than anyone else on the Vikings' current roster, and figures to be in the hunt for playing time in the middle.
Matthews, 26, started 10 games for the Philadelphia Eagles in 2014, more than he had in his previous three seasons combined. The former fourth-round pick had been a backup middle linebacker and special teams player during his first couple seasons in the league.
Matthews moved to one of the inside linebacker spots when the Eagles switched to a 3-4 scheme in 2013. He didn't start any games that season, as DeMeco Ryans and Mychal Kendricks played in all 16 regular-season games.
But Kendricks missed time early in 2014, and Ryans tore his Achilles tendon in Week 9. Matthews started three games in place of Kendricks and then seven games in Ryans' spot. He was credited with 59 tackles and 1.5 sacks.
Mays, 27, played three seasons for Vikings coach Mike Zimmer while he was the Cincinnati Bengals' defensive coordinator.
The Vikings were in the market for an upgrade at safety, and while Mays wasn't a starter for Zimmer in Cincinnati, he bring some depth to the team's defensive backfield and is a player who already knows Zimmer's defense. He saw his largest amount of playing time for the Bengals in 2012, when he played all 16 games and started three.
ESPN.com Vikings reporter Ben Goessling and Eagles reporter Phil Sheridan contributed to this report.