The mu-opioid receptor (MOR) is a major target for the treatment of pain. However, opioids are prone to side effects which limit their effectiveness as analgesics and can lead to opioid use disorders or, even, lethal overdose. The systemic administration of opioid agonists makes it both very difficult to decipher their underlying circuit mechanisms of action and to limit drug action to specific receptor subpopulations to isolate therapeutic effects from adverse side effects. Here we design, synthesize, and characterize a reversibly photoswitchable morphinan agonist termed "azo-morphine-3" (