Psilocybin has shown promise for alleviating symptoms of depression and is currently in clinical trials for the treatment of anorexia nervosa (AN), a condition that is characterised by persistent cognitive inflexibility. Considering that enhanced cognitive flexibility after psilocybin treatment is reported to occur in individuals with depression, it is plausible that psilocybin could improve symptoms of AN by breaking down cognitive inflexibility. A mechanistic understanding of the actions of psilocybin is required to tailor the clinical application of psilocybin to individuals most likely to respond with positive outcomes. This can only be achieved using incisive neurobiological approaches in animal models. Here, we use the activity-based anorexia (ABA) rat model and comprehensively assess aspects of reinforcement learning to show that psilocybin (post-acutely) improves body weight maintenance in female rats and facilitates cognitive flexibility, specifically via improved adaptation to the initial reversal of reward contingencies. Further, we reveal the involvement of signalling through the serotonin (5-HT) 1A and 5-HT2A receptor subtypes in specific aspects of learning, demonstrating that 5-HT1A antagonism negates the cognitive enhancing effects of psilocybin. Moreover, we show that psilocybin elicits a transient increase and decrease in cortical transcription of these receptors (Htr2aandHtr1a, respectively), and a further reduction in the abundance ofHtr2atranscripts in rats exposed to the ABA model. Together, these findings support the hypothesis that psilocybin could ameliorate cognitive inflexibility in the context of AN and highlight a need to better understand the therapeutic mechanisms independent of 5-HT2A receptor binding.