Agatha Heterodyne And The Sleeping City by Phil Foglio

A plucky young inventor discovers she's more than she seems and is drawn into the hazards of a dormant, gear-driven metropolis where rival Sparks, political factions, and clockwork horrors vie for control; using quick wits, improvisational engineering, and unexpected allies she uncovers conspiracies buried beneath the city's slumber and fights to keep its dangerous technology from tearing the world apart.