Polycystic ovary syndrome (PCOS) is the most prevalent endocrine disorder in women of childbearing age. Numerous studies have indicated a significantly elevated incidence of depression and anxiety in women affected by PCOS, often attributed to dysbiosis of gut microbiota resulting from poor sleep quality. However, the intricate relationship between sleep disorders, gut microbiota, and depression/anxiety in PCOS remains unclear. In this study, we aimed to elucidate the effects of sleep deprivation on the anxiety and depression of PCOS mice through an investigation of the gut-brain axis in order to understand the potential microbial-host interactions contributing to the occurrence of these psychological disorders. We found that sleep deprivation induced symptoms of depression and anxiety in PCOS mice and exacerbated PCOS-like pathology. Moreover, sleep deprivation altered the gut microbiota composition by suppressing beneficial bacteria such as Lactobacillus, and Ruminococcus species. Additionally, sleep deprivation upregulated intestinal tryptophan-kynurenine metabolism, increased intestinal wall permeability, promoted systemic inflammation, and compromised blood-brain barrier integrity. Furthermore, the hippocampal metabolomic analysis indicated that sleep deprivation affected the metabolism of fatty acid and oxylipins, upregulated the tryptophan-kynurenine metabolic pathway and exhibited a significant correlation with anxiety and depressive behaviours. Overall, this study suggests that sleep deprivation plays a pivotal role in the pathological mechanism of depression and anxiety in PCOS mice by modulating tryptophan and lipid metabolism through the gut-brain axis.