Major depressive disorder (MDD) and bipolar disorder (BD) are two of the most prevalent mood disorders that seriously jeopardize both physical and mental health. The current diagnosis of MDD and BD relies primarily on clinical symptoms. However, correctly differentiating between MDD and BD during depressive episode states remains a substantial clinical challenge. The human gut hosts a large and diverse microbiota, which plays a pivotal role in various physiological processes. Emerging evidence suggests that the gut microbiota (GM) exerts beneficial effects on mental health disorders, including MDD, BD, and schizophrenia, through the microbe-gut-brain axis (MGBA). In recent years, the relationship between GM and mood disorders has garnered considerable attention, leading to intensive research in this area. The MGBA is a bidirectional communication system between the gut and the brain. Growing evidence indicates that the brain can influence the GM, which in turn may modulate the brain through this axis. This review aims to explore the changes in the GM of patients with MDD and BD and evaluate the effects of different treatments on their GM, including medication, probiotic, prebiotic and synbiotic interventions, and fecal microbiota transplantation (FMT). By doing so, we seek to identify potential disease-specific biomarkers, improve differential diagnosis, and offer novel therapeutic avenues for these disorders.