Serotonergic psychedelics such as LSD, psilocybin, and mescaline all produce mydriasis by agonizing to the 5-HT2A receptors in the brain. Dissociatives such as ketamine, DXM, and PCP do so as well via antagonism of the NMDA glutamate receptors. There have also been reports that the atypical psychedelic Salvia divinorum and its active constituent salvinorin A causes mydriasis. It works via agonism of the κ-opioid receptors in the brain. How the neurological changes induced by these drugs ultimately causes pupil dilation is unknown.
Drugs that increase overall serotonin levels in general are capable of causing mydriasis in the same way as the 5-HT2A-mediated psychedelics. This is because serotonin itself is naturally responsible for normal 5-HT2A stimulation. Hence, in sufficient quantities serotonin is mydriatic and can even be mildly psychedelic, though the potentially fatal serotonin syndrome usually ensues before the psychedelia becomes overly-pronounced. Examples of such drugs include MDMA (as well as other MDxx compounds), fenfluramine, chlorphentermine, stimulants (including cocaine and amphetamines), and some antidepressants (such as SSRIs, SNRIs, and MAOIs). Natural serotonin-boosting supplements such as L-Tryptophan and 5-HTP are also capable of this, but usually only in excessive doses.