On the last day of summer, Annie does not have the heart to tell Leo of his departure to the storybook called Sherlock Holmes. Although Annie and Leo are having fun playing the whole day, Annie is unable to tell Leo where she's going, and leaves him with the advice, "You're braver then you believe, stronger then you seem, and smarter then you think." The next morning, Leo discovers a toy with an attached note - however, he cannot read it himself. As he goes around to his friends June, Quincy and Rocket, it's clear that the group needs Annie's help and advice with their own obstacles, and none of them are able to read it. Quincy "deciphers" the writing on the note, and reports that Annie has been kidnapped by Professor Ratigan and was taken to London. Leo, June, Quincy and Rocket decided to head to London, Leo can save his little sister.
In London, circa 1897, a young Scottish mouse named Olivia Flaversham is celebrating her birthday with her Toymaker father, Hiram. Suddenly, Fidget, a crippled bat with a peg leg, kidnaps Hiram. Fidget takes Hiram to Professor Ratigan who commands him to create a clockwork robot which mimics the Queen of the Mice so Ratigan can rule England and have Annie as bait. Hiram and Annie refuse to take part in the scheme, whereupon Ratigan orders Fidget to capture Olivia and Leo so he can feed them to his pet cat, Felicia.
Olivia searches to find Basil of Baker Street, a world-famous detective and Ratigan's archnemesis. Returning to London after a tour of duty in Afghanistan, Dr. David Q. Dawson stumbles upon Olivia and Leo, Quincy and June, and helps her find Basil's residence. At first, Basil is reluctant, but when Olivia mentions Fidget, Basil realizes his chance to capture Ratigan. Basil and Dawson take Toby, Sherlock Holmes's pet dog, to track Fidget's scent, where they find him in a toyshop stealing clockwork mechanisms and toy soldiers' uniforms. Fidget later traps Olivia and Leo by ambushing them from inside a toy cradle. Basil, Dawson, June, Quincy, and Rocket pursue Fidget, but become entangled and fall behind. While searching the shop, Dawson discovers Fidget's checklist, to which Basil does some chemical tests to discover the list came from the riverfront near the Thames. Basil, Dawson, June, Quincy and Rocket disguise themselves as sailors and go into a tavern called the "Rat Trap" and follow Fidget to Ratigan's headquarters. They along with the others are caught, and Ratigan ties them to a spring-loaded mousetrap connected with a Rube Goldberg machine. Ratigan sets out for Buckingham Palace, where Fidget and his accomplices kidnap the queen. Basil, Dawson, and the others deduces the trap's weakness and escape just in time.
Back at Buckingham Palace, Ratigan forces Hiram to operate the toy Queen, while the real Queen is taken to be fed to Felicia. The toy Queen declares Ratigan the ruler of all Mousedom, and he announces his tyrannical plans for his new "subjects". Just then, Basil, Dawson, Olivia, and Leo and his friends save Hiram, Annie, and the real Queen, and apprehend Fidget (along with Ratigan's other henchmen). Basil forces the mechanical queen to denounce Ratigan as an impostor and tyrant while breaking into pieces. The crowd, enraged by Ratigan's treason, start climbing onto him and defeating his shanty guards. Ratigan frees himself and escapes on his dirigible with Fidget, holding Olivia and Leo hostage. Basil, Dawson, Hiram, June, Quincy, Annie and Rocket create their own craft with a matchbox and some small helium-filled balloons, held under the Union Jack. Ratigan throws Fidget (who can't fly) into the Thames River, and then attempts to drive the dirigible himself. Basil and Annie jump on to the dirigible to confront Ratigan, causing him to crash straight into the Big Ben. Inside the clock, Basil and Annie rescue Olivia and Leo safely delivers her to Hiram. Ratigan fights Basil and Annie until the clock bell tolls and Ratigan plunges, taking Basil with him. However, Basil manages to save himself just in time.
Back at Baker Street, Basil, Dawson, and Little Einsteins recount their adventures, as well as the queen's gratitude for saving her life. Afterwards, the Flavershams leave to catch their train. As Dawson tries to leave, a distraught new client persuades both Basil and Dawson to help her. Finally, Basil proclaims Dawson to be his "trusted associate, Doctor Dawson, with whom I do all my cases".