Psilocybin mushrooms, popularly known as magic mushrooms, are famous as psychedelic purveyors of trippy epiphanies and cathartic giggle fits.

But beyond its recreational uses, psilocybin—the psychoactive compound in these fungi—is being increasingly recognized by scientists as a promising potential treatment for conditions such as addiction, depression, and post-traumatic stress disorder.

Now, researchers have engineered bacteria that creates psilocybin in higher quantities that can be harvested from magic mushrooms. The findings represent “a significant step towards demonstrating the feasibility of industrial production of biologically-derived psilocybin,” the team said in a new study published in the journal Metabolic Engineering.

Led by Alexandra Adams, a junior chemical engineering major at Miami University in Ohio, the team produced special strains of E. coli bacteria by introducing DNA from the Psilocybe cubensis mushroom.

Microbes can be genetically engineered to make all sorts of useful materials such as insulin, biofuels, and spider silk. But the new bacterial strain, which the researchers called pPsilo16, is the first reported demonstration of psilocybin production inside of a single-celled host. It can also yield more of the compound than any genetically modified organism to date: 1.16 grams of psilocybin per litre.

“This is 1.16 grams of psilocybin per liter of culture media,” said co-author Andrew Jones, an assistant professor of chemical and biological engineering at Miami University, in an email.

“The E. coli grows in a water-based growth media that contains all chemicals necessary for the cells to survive and grow,” he explained. “The bacteria does not need the psilocybin to grow and prosper, so in that sense it is a by/waste-product and it is excreted from the bacteria into the culture media.”

Psilocybin is currently being tested as a pharmaceutical in clinical trials, and is still classified as a Schedule 1 substance by the US Food and Drug Administration. It will likely be years before it is available as a treatment to patients suffering from mental health conditions. But the Miami University researchers, and their colleagues, are hastening the process.

“We expect there is a lot of room for further enhancement of the organism and production process,” Jones said. “We are currently working to improve the genetic background of our E. coli strain to make it a more stable and efficient host for the biosynthesis.”