BackgroundThe close relationship between pain and mental health problems is well-known, and psychological intervention can provide an effective alternative to medication-based pain relief. However, previous studies on the connection between pain and psychological problems, the findings thus far have been inconclusive, limiting the potential for translating psychological interventions into clinical practice. To complement the gap, this study utilized genetic data and Mendelian randomization (MR) to examine the potential relationship between pain in different parts and common mental disorders.MethodsBased on the instrumental variables selected from the Genome-wide association study summary statistics of localized pain and mental disorders, we conducted bidirectional two-sample MR analyses to infer bidirectional causal associations between pain and mental disorders. The inverse-variance weighted MR method and MR-Egger were used as the primary statistical method according to the horizontal pleiotropy and heterogeneity level. We reported the odds ratio to infer the causal effect between pain and mental disorders.Fstatistic was calculated to measure the statistical efficacy of the analyses.ResultsInsomnia is causally related to the genetic susceptibility of multisite pain including head (OR = 1.09, 95% CI: 1.06–1.12), neck/shoulder (OR = 1.12, 95% CI: 1.07–1.16), back (OR = 1.12, 95% CI: 1.07–1.18) and hip (OR = 1.08, 95% CI: 1.05–1.10). Reversely, headache (OR = 1.14, 95% CI: 1.05–1.24), neck/shoulder pain (OR = 1.95, 95% CI: 1.03–3.68), back pain (OR = 1.40, 95% CI: 1.22–1.60), and hip pain (OR = 2.29, 95% CI: 1.18–4.45) promote the genetic liability of insomnia. Depression is strongly associated with the predisposition of multisite pain including headache (OR = 1.28, 95% CI: 1.08–1.52), neck/shoulder pain (OR = 1.32, 95% CI: 1.16–1.50), back pain (OR = 1.35, 95% CI: 1.10–1.66) and stomach/abdominal pain (OR = 1.14, 95% CI: 1.05–1.25), while headache (OR = 1.06, 95% CI: 1.03–1.08), neck/shoulder (OR = 1.09, 95% CI: 1.01–1.17), back (OR = 1.08, 95% CI: 1.03–1.14), and stomach/abdominal pain (OR = 1.19, 95% CI: 1.11–1.26) are predisposing factors for depression. Additionally, insomnia is associated with the predisposition of facial, stomach/abdominal, and knee pain, anxiety was associated with the predisposition of neck/shoulder and back pain, while the susceptibilities of hip and facial pain are influenced by depression, but these associations were unidirectional.ConclusionsOur results enhance the understanding of the complex interplay between pain and mental health and highlight the importance of a holistic approach to pain management that addresses both physical and psychological factors.Supplementary InformationThe online version contains supplementary material available at 10.1186/s10194-023-01612-2.