Myasthenia gravis (MG), a rare autoimmune disorder, presents a complex pathogenesis involving various immune molecules. The modification of N6-methyladenosine (m6A) regulates diverse immune metabolic and immunopathological processes; however, its role in MG remains unclear. We downloaded dataset GSE85452 from the GEO database to identify differentially expressed genes regulated by m6A. The Random Forest (RF) method was utilized to identify pivotal regulatory genes associated with m6A modification. Subsequently, a prognostic model was crafted and confirmed using this gene set. Patients with MG were stratified according to the expression levels of these key regulatory genes. Additionally, MG-specific immune signatures were delineated by examining immune cell infiltration patterns and their correlations. Further functional annotation, protein-protein interaction mapping, and molecular docking analyses were performed on these immune biomarkers, leading to the discovery of three genes that exhibited significant differential expression within the dataset: RBM15, CBLL1, and YTHDF1.The random forest algorithm confirmed these as key regulatory genes of m6A in MG, validated by constructing a clinical prediction model. Based on key regulatory gene expression, we divided MG patients into two groups, revealing two distinct m6A modification patterns with varying immune cell abundances. We also discovered 61 genes associated with the m6A phenotype and conducted an in-depth exploration of their biological roles. RBM15, CBLL1, and YTHDF1 were found positively correlated with CD56dim natural killer cells, natural killer T cells, and type 1 helper T cells. These genes were stable diagnostic m6A-related markers in both discovery and validation cohorts. Our findings suggest RBM15, CBLL1, and YTHDF1 as immune markers for MG. Further analysis of these genes may elucidate their roles in the immune microenvironment of MG.