The X-linked transcriptional repressor methyl CpG binding protein 2 (MeCP2), known for its role in the neurodevelopmental disorder Rett syndrome, is emerging as an important regulator of neuroplasticity in postmitotic neurons. Cocaine addiction is commonly viewed as a disorder of neuroplasticity, but the potential involvement of MeCP2 has not been explored. Here we identify a key role for MeCP2 in the dorsal striatum in the escalating cocaine intake seen in rats with extended access to the drug, a process that mimics the increasingly uncontrolled cocaine use seen in addicted humans. MeCP2 regulates cocaine intake through homeostatic interactions with microRNA-212 (miR-212) to control the effects of cocaine on striatal brain-derived neurotrophic factor (BDNF) levels. These data suggest that homeostatic interactions between MeCP2 and miR-212 in dorsal striatum may be important in regulating vulnerability to cocaine addiction.