Speaking of dangerous substances, the episode seems to take for granted that McCoy would have a supply of Klingon nerve gas on hand to play around with.
The idea of replicating any substance from scratch mostly came in with TNG. You could argue the precious gems in "Catspaw" ("We could manufacture a ton of these"), but TOS wasn't explicit about the idea of replicators, and "The Tholian Web" with its theragen certainly wasn't. It's more likely the TOS-era thought process was that McCoy looked up how to make theragen from common ingredients.