Mr. Mackey is based on Trey Parker's school counselor.
In the DVD commentary on Season 1, Trey Parker stated that Mr. Mackey is based on his school counselor, Mr. Lackey.