Optogenetics is now a widely accepted tool for spatiotemporal manipulation of neuronal activity. However, a majority of optogenetic approaches usebinary 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 invivo 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. Siuda etal. develop a photosensitive mu-opioid-like receptor (opto-MOR) that triggers cAMP inhibition and MAP kinase activation, couples to GIRK currents, and internalizes like the mu-opioid receptor. Photostimulation of opto-MOR within discrete GABAergic nuclei induces real-time preference or aversion.