BackgroundThe consumption of cheese and fish has been linked to the onset of depression. However, the connection between consuming cheese, consuming fish, experiencing depression, and the pathways that mediate this relationship remains unclear. The purpose of this research was to investigate the potential association between the consumption of cheese and fish and the occurrence of depression. Moreover, it is important to identify any metabolites that might be involved and understand their respective roles and functions.MethodsA two-step, two-sample Mendelian randomization (MR) study was conducted using genome-wide association study (GWAS) data on cheese, non-oily fish, and oily fish consumption and depression, along with 12 alternate mediators. The study included a total of 451,486 participants in the cheese consumption group, 460,880 in the non-oily fish consumption group, 460,443 in the oily fish consumption group, and 322,580 with a diagnosis of depression. The single nucleotide polymorphism (SNP) estimates were pooled using inverse-variance weighted, weighted median, MR-Egger, simple mode, and weighted mode.ResultsThe data we collected suggested that consuming more cheese correlated with a lower likelihood of experiencing depression (OR: 0.95; 95% CI: 0.92 to 0.98). Neither non-oily fish nor oily fish consumption was directly linked to depression onset (p = 0.08, p = 0.78, respectively). Although there was a direct causal relationship with depression, the mediating relationship of triglycerides (TG), total cholesterol in large HDL, cholesterol to total lipids ratio in large HDL, free cholesterol to total lipids ratio in large HDL, glycine, and phospholipids to total lipids ratio in very large HDL of cheese intake on depression risk were − 0.002 (95% CI: −0.023 - 0.020), −0.002 (95% CI: −0.049 - 0.045), −0.001 (95% CI: −0.033 - 0.031), −0.001 (95% CI: −0.018 - 0.015), 0.001 (95% CI: −0.035 - 0.037), and − 0.001 (95% CI: −0.024 - 0.021), respectively. The mediating relationship of uridine, free cholesterol to total lipids ratio in large HDL, total cholesterol in large HDL, acetoacetate, and 3-hydroxybutyrate (3-HB) between non-oily fish consumption and depression risk were 0.016 (95% CI: −0.008 - 0.040), 0.011 (95% CI: −1.269 - 1.290), 0.010 (95% CI: −1.316 - 1.335), 0.011 (95% CI: −0.089 - 0.110), and 0.008 (95% CI: −0.051 - 0.068), respectively. The mediation effect of uridine and free cholesterol to total lipids ratio in large HDL between intake of oily fish and the risk of depression was found to be 0.006 (95% CI: −0.015 - 0.028) and − 0.002 (95% CI: −0.020 - 0.017), respectively. The correlation between eating cheese and experiencing depression persisted even when adjusting for other variables like Indian snacks, mango consumption, sushi consumption, and unsalted peanuts using multivariable MR.ConclusionThe consumption of cheese and fish influenced the likelihood of experiencing depression, and this may be mediated by certain metabolites in the body. Our study provided a new perspective on the clinical treatment of depression.