A growing number of studies have implicated that gut microbiota abundance is associated with myasthenia gravis (MG). However, the causal relationship underlying the associations is still unclear. Here, we aim to investigate the causal effect of gut microbiota on MG using Mendelian randomization (MR) method. Publicly available Genome-wide association study (GWAS) summary-level data for gut microbiota and for MG were extracted. Inverse variance weighted was used as the main method to analyze causality. The robustness of the results was validated with sensitivity analyses. Our results indicated that genetically predicted increased phylum Lentisphaerae (OR = 1.319, p = 0.026), class Lentisphaerae (OR = 1.306, p = 0.044), order Victivallales (OR = 1.306, p = 0.044), order Mollicutes (OR = 1.424, p = 0.041), and genus Faecalibacterium (OR = 1.763, p = 0.002) were potentially associated with a higher risk of MG; while phylum Actinobacteria (OR = 0.602, p = 0.0124), class Gammaproteobacteria (OR = 0.587, p = 0.036), family Defluviitaleaceae (OR = 0.695, p = 0.047), family Peptococcaceae (OR = 0.698, p = 0.029), and family Family XIII (OR = 0.614, p = 0.017) were related to a lower risk of MG. The present study provides genetic evidence for the causal associations between gut microbiota and MG, thus suggesting novel insights into the gut microbiota-neuromuscular junction axis in the pathogenesis of MG.