Scientists have managed to tweak the bacteria Escherichia coli (E. coli) to produce psilocybin, the first time this has ever been done from a prokaryotic host.
In a study published in Metabolic Engineering, scientists were able to successfully create psilocybin from E. coli.  The researchers engineered the bacteria to produce psilocybin, then improved the production by assessing multiple gene optimization strategies.
The end result was a 32-fold optimization in psilocybin concentration to 1.16 g/L, the highest psilocybin titer to have ever been achieved from a recombinant organism.
The process involved expressing psilocybin production genes (namely psiD, psiK, and psiM) from Psilocybe cubensis mushrooms in E. coli. To promote their expression, the researchers employed the T7 promoter system. They arranged the genes on different plasmids and T7 promoters, narrowing down the highest-producing mutant strain to pPsilo16.
They optimized fermentation conditions, identifying ideal temperature as 37 ºC and ideal carbon source as Andrew’s Magic Media and glucose. Supplementing the bacteria with methionine, serine, and 4-hydroxyindole boosted psilocybin production (feeding the psilocybin production pathway). Finally, the researchers successfully scaled up the technique, “demonstrating the feasibility of industrial production of biologically-derived psilocybin.” 
Psilocybin is a hallucinogenic substance contained within certain types of mushrooms commonly referred to as “magic mushrooms.” Although classified as a Schedule I controlled substance, psilocybin was legalized as of 2020 in Oregon, the first state to legalize the compound.
Consumption of psilocybin can cause hallucinations and distortions on how objects and people are perceived. Psilocybin works by activating serotonin receptors, predominantly in the prefrontal cortex of the brain that impacts mood and cognition.  The effects usually last for several hours. 
Psilocybin may have a role to play in medicine. It has been shown to help treat addiction, depression, and post-traumatic stress disorder (PTSD) in clinical trials.  The U.S. Food & Drug Administration has approved phase II clinical trials for treatment-resistant depression and major depression. The ability to produce psilocybin from an engineerable microbe offers great promise for the advancement of rapid bioproduction of psilocybin to be used in ongoing research.
Currently, clinical trials use synthetic psilocybin, which can be difficult and costly to produce. With this new biosynthetic production pathway, scientists may have a more efficient and less expensive way to create psilocybin for clinical trials. 
There are also many other naturally occurring compounds in magic mushrooms in addition to psilocybin, such as norpsilocin and baeocystin to name a few. We may soon see other formulations with different properties by continuing to study these compounds and how they work together.
Image source: Ervin Gjata from Pixabay
1- Adams AM, et al. In vivo production of psilocybin in E. coli. Metabolic Engineering. 2019;56:111-119. [Impact Factor: 9.783; Times Cited: 8 (Semantic Scholar)]
2- Gill H, et al. The emerging role of psilocybin and MDMA in the treatment of mental illness. Expert Review of Neurotherapeutics. 2020;20(12):1263-1273. DOI: 10.1080/14737175.2020.1826931. [Impact Factor: 3.949; Times Cited: n/a]