Hats off to the sequel that begins with poking fun at its inherent shortcomings – in a musical number, no less – then proceeds to surpass its predecessor in nearly every way. “Muppets Most Wanted” has a plot that will challenge the kids without boring their parents, better songs (by a country mile), and a healthy dose of self-awareness. The main appeal of the Jason Segel-scripted “The Muppets” was its innocence and a longing for a less cynical time, but for the franchise to remain so naïve to the real world would have been disastrous. “Muppets Most Wanted” finds that ideal middle ground between their world and ours.

The story begins, in a behind-the-curtain manner, at the very end of the previous film, as the first of many cameos calls a wrap on the first film and the Muppets are left pondering what to do next. In steps agent Dominic Badguy (Ricky Gervais, and he insists it’s pronounced ‘Badgie’), who suggests that the Muppets do a European tour. What the Muppets don’t know is that Badguy is a world-class thief, as well as the right-hand man to Constantine, the world’s most dangerous criminal mastermind and a dead ringer for Kermit the Frog. Constantine escapes from his Siberian prison, while Dominic sets up Kermit to be mistaken for recent escapee Constantine. Kermit is sent to Siberia, and Dominic and Constantine revolve the Muppets’ European tour around the locations of the artifacts that will enable them to pull off the ultimate heist. Strangely, no one suspects that Kermit has been replaced, though certain members of the group smelled a rat from the beginning. Why doesn’t anyone listen to the drummer?

Speaking as a parent, one of the great things about “Muppets Most Wanted” is how it shows kids the dark side of always getting what they want, which is that it comes at the expense of getting what they need. Kermit has always been a father figure to the members of his troupe, and that role is magnified here when he’s replaced with a cold careerist who wins them over by indulging their egos. The plot may mandate that the rest of the Muppets cannot tell right away that Constantine isn’t Kermit, but in their hearts, they know that this newfound freedom and lack of discipline is wrong. Parental win!

With any luck, the movie’s songs, written by Flight of the Conchords alumnus and style parodist extraordinaire Bret McKenzie, will get studios to start giving a damn about putting good, original songs in their movies again. McKenzie wrote several songs for “The Muppets” as well, but his work here is more Conchordian, looser and much funnier. His genre targets range from Paul Williams-esque Vaudeville (the opening number “We’re Doing a Sequel”), to late ‘70s soft rock (“I’ll Get You What You Want”), to doo wop (“The Big House”), to “Chicago”-style Broadway, only better (“The Interrogation Song”). Each one of these is a showstopper, to the point where they eclipse the movie’s intended showstopper (“Something So Right”). There is also a nice “Rainbow Connection” moment that your kids will be quoting for weeks.

Gervais looked like a risky choice on paper to play any role in a Muppet movie, but his performance is subdued and bone-dry, which is exactly what the role required. Tina Fey has less to work with as the main guard of the Siberian prison, though she does get a few choice jokes, as well as the movie’s best line (make sure you’re paying attention when she’s saying good night to the prisoners). Ty Burrell gets to exploit every cheap joke ever written about the French, and gets away scot-free. As for the cameos, we can only say that it’s an impressive collection, though if we had our way, a certain rapper would have been swapped out for Pharrell Williams.

It’s nice to see a movie like “Muppets Most Wanted” stick to its guns and do what the Muppets have always done best: deliver highbrow comedy of a more traditional style with a wink to present-day pop culture (mainly, the cameos). One of the smartest things Jim Henson did when he started “The Muppet Show” was to ground its sensibilities outside of anything trendy, which gave the show the freedom to acknowledge or ignore anything they wanted going forward. That spirit is alive and well here, and the end result is the best Muppet sequel to date. Granted, I have not yet seen “Muppets from Space,” but I feel confident that this is better.