Optogenetics is now a widely accepted tool for spatiotemporal manipulation of neuronal activity. However, a majority of optogenetic approaches use binary on/off control schemes. Here, we extend the optogenetic toolset by developing a neuromodulatory approach using a rationale-based design to generate a Gi-coupled, optically sensitive, mu-opioid-like receptor, which we term opto-MOR. We demonstrate that opto-MOR engages canonical mu-opioid signaling through inhibition of adenylyl cyclase, activation of MAPK and G protein-gated inward rectifying potassium (GIRK) channels and internalizes with kinetics similar to that of the mu-opioid receptor. To assess in vivo utility, we expressed a Cre-dependent viral opto-MOR in RMTg/VTA GABAergic neurons, which led to a real-time place preference. In contrast, expression of opto-MOR in GABAergic neurons of the ventral pallidum hedonic cold spot led to real-time place aversion. This tool has generalizable application for spatiotemporal control of opioid signaling and, furthermore, can be used broadly for mimicking endogenous neuronal inhibition pathways.