This study aimed to evaluate the association between vegetable intake and major depressive disorder (MDD) through cross-sectional analysis and bidirectional two-sample Mendelian randomisation (MR). Cross-sectional analysis was conducted on National Health and Nutrition Examination Survey (NHANES) data from 2005 to 2018 and the corresponding Food Patterns Equivalents Database (FPED). Genome-wide association study (GWAS) data were obtained from UK Biobank and Psychiatric Genomics Consortium (PGC) dataset. Logistic regression analysis was performed after calculating the weights of the samples. Inverse variance weighted, MR-Egger and weighted median methods were used to evaluate the causal effects. A Patient Health Questionnaire-9 score ≥ 10 was considered to indicate MDD. Low vegetable intake was defined as < 2 cups of vegetables per day. 30 861 U.S. adults from NHANES. The GWAS data sample size related to vegetable intake were comprised 448 651 and 435 435 cases respectively, while the GWAS data sample size associated with MDD encompassed 500 199 cases. There were 23 249 (75·33 %) participants with low vegetable intake. The relationship between vegetable intake and MDD was nonlinear. In the multivariate model adjusted for sex, age, education, marital status, poverty income ratio, ethnicity and BMI, participants with low vegetable intake were associated with an increased risk of MDD (OR = 1·53, 95 % CI (1·32, 1·77), P < 0·001). Bidirectional MR showed no causal effects between vegetable intake and MDD. Cross-sectional analysis identified a significant relationship between vegetable intake and MDD, whereas the results from bidirectional two-sample MR did not support a causal role.