According to the game's lore, it was Professor Von Drake who accidentally invited the Cogs. He was actually trying to make them good, but he pulled the wrong lever in the process—and that mistake is what let the Cogs loose in Toontown.