Sociability is crucial for survival, whereas social avoidance is a feature of disorders such as Rett syndrome, which is caused by loss-of-function mutations in MECP2. To understand how a preference for social interactions is encoded, we used in vivo calcium imaging to compare medial prefrontal cortex (mPFC) activity in female wild-type and Mecp2-heterozygous mice during three-chamber tests. This evidence concerns the gene MECP2 and Rett syndrome.