Background: The causal association between the gut microbiome and the development of migraine and its subtypes remains unclear. Methods: The single nucleotide polymorphisms concerning gut microbiome were retrieved from the gene-wide association study (GWAS) of the MiBioGen consortium. The summary statistics datasets of migraine, migraine with aura (MA), and migraine without aura (MO) were obtained from the GWAS meta-analysis of the International Headache Genetics Consortium (IHGC) and FinnGen consortium. Inverse variance weighting (IVW) was used as the primary method, complemented by sensitivity analyses for pleiotropy and increasing robustness. Results: In IHGC datasets, ten, five, and nine bacterial taxa were found to have a causal association with migraine, MA, and MO, respectively, (IVW, all P < 0.05). Genus.Coprococcus3 and genus.Anaerotruncus were validated in FinnGen datasets. Nine, twelve, and seven bacterial entities were identified for migraine, MA, and MO, respectively. The causal association still exists in family.Bifidobacteriaceae and order.Bifidobacteriales for migraine and MO after FDR correction. The heterogeneity and pleiotropy analyses confirmed the robustness of IVW results. Conclusion: Our study demonstrates that gut microbiomes may exert causal effects on migraine, MA, and MO. We provide novel evidence for the dysfunction of the gut-brain axis on migraine. Future study is required to verify the relationship between gut microbiome and the risk of migraine and its subtypes and illustrate the underlying mechanism between them