There's a scene where Jenkins is listing the historical magical artifacts that can transmute matter, and he mentions the scepter of Korob. This is a reference to Catspaw (1967), where aliens Korob and Sylvia use a transmuter in the form of a scepter to capture and hold members of the crew.
The episode has several references to Ray Bradbury's novel "Something Wicked This Way Comes," which is about a supernatural carnival that grants people their deepest desires at the price of their souls. The book has a character named Charles Halloway, the episode has Charlotte Halloway. The book and episode both takes place somewhere named Green Town. And in the book, Charles Halloway is the town's librarian who defeats the evil leader of the carnival.
Ezekiel refers to the carnival clowns as an insane clown posse. This is in reference to the rap duo Insane Clown Posse, or I.C.P., formed in Detroit in the late 1980's, known for dressing up in horror clown makeup and followers called Juggalos.
Guest star Sean Astin is the son of John Astin, who played Buddy Ryan on Night Court (1984), as Judge Harry Stone's father, which John Larroquette (Jenkins) co-starred in as ADA Dan Fielding. Harry Stone was also a magician.
When the Librarians exit the clown car dressed as clowns, they are performing a parody of O-Ren Ishii and her guards arriving at "The House of Blue Leaves" in Kill Bill: Vol. 1 (2003), the music being not dissimilar to the song: "Battle Without Honor or Humanity" by Hotei Tomoyasu, which is used in the 2003 film.