Neuroinflammation caused by COVID‐19 negatively impacts brain metabolism and function, while pre‐existing brain pathology may contribute to individuals' vulnerability to the adverse consequences of COVID‐19. We used summary statistics from genome‐wide association studies (GWAS) to perform Mendelian randomization (MR) analyses, thus assessing potential associations between multiple sclerosis (MS) and two COVID‐19 outcomes (severe acute respiratory syndrome coronavirus 2 [SARS‐CoV‐2] infection and COVID‐19 hospitalization). Genome‐wide risk genes were compared between the GWAS datasets on hospitalized COVID‐19 and MS. Literature‐based analysis was conducted to construct molecular pathways connecting MS and COVID‐19. We found that genetic liability to MS confers a causal effect on hospitalized COVID‐19 (odd ratio [OR]: 1.09, 95% confidence interval: 1.03−1.16) but not on SARS‐CoV‐2 infection (1.03, 1.00−1.05). Genetic liability to hospitalized COVID‐19 confers a causal effect on MS (1.15, 1.02−1.30). Hospitalized COVID‐19 and MS share five risk genes within two loci, including TNFAIP8, HSD17B4, CDC37, PDE4A, and KEAP1. Pathway analysis identified a panel of immunity‐related genes that may mediate the links between MS and COVID‐19. Our study suggests that MS was associated with a 9% increased risk for COVID‐19 hospitalization, while hospitalized COVID‐19 was associated with a 15% increased risk for MS. Immunity‐related pathways may underlie the link between MS on COVID‐19.