Royals general manager Dayton Moore said Matheny will work in the scouting and player development areas.
"This is a great opportunity to have Mike become a member of our organization," Moore in a statement. "It's always been our policy to hire the best baseball people we can and this is a perfect example of that."
A former catcher, Matheny spent 13 seasons in the major leagues, playing for Milwaukee, Toronto, San Francisco and St. Louis from 1994 to 2006. After retirement, he went to work in the Cardinals' front office and was named manager after the 2011 season, replacing Tony La Russa.
Matheny led the Cardinals to the postseason in each of his first four seasons as manager and won the National League pennant in 2013, when Boston defeated St. Louis in the World Series in six games.
The Cardinals fired Matheny is mid-July when St. Louis was 47-46 and 7 1/2 games behind the Chicago Cubs in the National League Central.
"I'm excited about the opportunity to join the Royals in this capacity," Matheny, 48, said in a statement. "I've long respected the accomplishments of Dayton and his staff while developing a winning culture in Kansas City. This is a great chance for me to contribute in a variety of areas that will include player development and scouting. After being in uniform for the majority of my professional career, this is a unique opportunity that I could not pass up."
Royals manager Ned Yost, another former major league catcher, signed a one-year contract in September to continue managing the Royals in 2019. He has managed the team since May 2010.
The Royals finished with a 58-104 record in 2018, last in the American League Central.
--Field Level Media