Objective To analyze the causal relation between major depression and constipation by using bidirectional Mendelian randomization (MR) method. Methods Genome⁃wide association study data related to major depression and constipation were obtained from the IEU OpenGWAS database. Major depression and constipation were used as each other's exposure and outcome variables, and single nucleotide polymorphisms associated with major depression and constipation were used as instrumental variables. After screening instrumental variables, MR analysis was performed by using inverse variance weighting (IVW), MR⁃Egger, maximum likelihood (ML) and MR⁃PRESSO methods. The Cochran's Q test was used to assess heterogeneity, MR⁃Egger regression and MR⁃PRESSO test were used to assess horizontal pleiotropy, MR Steiger directional test was used to assess reverse causality, and the leave⁃one⁃out test was used to validate stability. Results In the forward MR analysis, the results of IVW method revealed that major depression was a risk factor for the onset risk of constipation (P<0.05). Except for MR⁃Egger method, the analytical results of ML, MR⁃PRESSO and IVW methods were consistent. Cochran's Q test results indicated no heterogeneity (P>0.05), MR⁃Egger regression and MR⁃PRESSO test results exhibited no horizontal pleiotropy (P>0.05), MR Steiger directional test did not find reverse causality, and the leave⁃one⁃out method revealed that the causal relation was stable and reliable. In the reverse MR analysis, the results of IVW method, MR⁃Egger method, ML method and MR⁃PRESSO method all implied that there was no reverse causality between major depression and constipation (P>0.05). Conclusion Major depression is a risk factor for the onset of constipation.