An Ekomille rat trap is displayed as Brooklyn Borough President Eric Adams announces the results of a pilot program.

Rats all, folks.

Brooklyn Borough President Eric Adams on Thursday unveiled what he hopes will be the city’s new secret weapon in the war on rats — plus the furry carcasses of 21 of its creepy captors.

“Not only am I the BP, I’m the pied piper,” crowed Adams at a demonstration of the Rat Trap, a gizmo that its same-named manufacturer gave Adams to test out around rodent-rife Borough Hall.

Over the course of a month between August and September, four Rat Traps around the building hauled in 107 vermin victims — the corpses of which a surely underpaid Rat Trap worker scooped out of one trap in front of shrieking onlookers and reporters.

Here’s how the Rat Trap works: Designed to fit in between public trash receptacles, the trap lures critters inside and up a rat-sized ladder with an enticing bait of sunflower seeds and nuts.

Once the rats reach a platform inside, they trigger a trap-door that sends them plunging into a vat filled with a vinegar-alcohol solution that quickly rendering them unconscious as they drown in the drink.

The odor-free traps can hold 30 to 40 rats at a time, enough space that they only have to be emptied once a month — but that is surely a day on the calendar to be dreaded. Using what looked like a white plastic ladle, a worker scooped the dripping rat carcasses out of one bucket of the rat-atouille contraption Thursday in a stomach-churning proof of concept.

The grisly output notwithstanding, Adams said that he was sold on the Rat Trap being the key to New York winning the rat race.

“We spent hundreds of millions of dollars on this. It’s candy for rats,” said Adams, holding up a bag of rat poison. “To rats, this is a joke. To us, this is a continued expense.”

Adams said that despite the city pumping millions into trying to control the rat population through more-traditional methods, it’s still booming in Brooklyn, particularly around Bedford-Stuyvesant, Prospect Heights and Bushwick.

The Rat Traps, conversely, cost about $300 to $400 each, run on just one 9-volt battery — to operate the trap door — and require very little maintenance, said Adams.

He plans to take his findings to the Department of Sanitation and City Council in a quest for budgetary backing and support in an eventual pitch to City Hall.

“We’re dealing with crisis,” said Adams, who had no problem squaring his veganism with his rat crackdown. “I would be irresponsible to allow my personal feelings about being a vegan to get in the way of the trauma of our families and what they’re experiencing.”