The trade was announced Thursday before Kansas City played the finale of a four-game series against the Baltimore Orioles.
The 26-year-old Anderson hit .242 with 16 RBIs and 13 stolen bases in 74 games with Detroit this year. He was designated for assignment by the Tigers on July 24 when Carlos Guillen was activated from the disabled list.
Anderson is a career .283 hitter with three homers and 39 RBIs with Houston, Atlanta and Detroit. He is expected to join the Royals on Friday in Tampa.