Methylmercury (MeHg) is a persistent environmental toxin present in seafood that can compromise the developing nervous system in humans. The effects of MeHg toxicity varies among individuals, despite similar levels of exposure, indicating that genetic differences contribute to MeHg susceptibility. To examine how genetic variation impacts MeHg tolerance, we assessed developmental tolerance to MeHg using the sequenced, inbred lines of the Drosophila melanogaster Genetic Reference Panel (DGRP). We found significant genetic variation in the effects of MeHg on development, measured by eclosion rate, giving a broad sense heritability of 0.86. To investigate the influence of dietary factors, we measured MeHg toxicity with caffeine supplementation in the DGRP lines. We found that caffeine counteracts the deleterious effects of MeHg in the majority of lines, and there is significant genetic variance in the magnitude of this effect, with a broad sense heritability of 0.80. We performed genome-wide association (GWA) analysis for both traits, and identified candidate genes that fall into several gene ontology categories, with enrichment for genes involved in muscle and neuromuscular development. Overexpression of glutamate-cysteine ligase, a MeHg protective enzyme, in a muscle-specific manner leads to a robust rescue of eclosion of flies reared on MeHg food. Conversely, mutations in kirre, a pivotal myogenic gene identified in our GWA analyses, modulate tolerance to MeHg during development in accordance with kirre expression levels. Finally, we observe disruptions of indirect flight muscle morphogenesis in MeHg-exposed pupae. Since the pathways for muscle development are evolutionarily conserved, it is likely that the effects of MeHg observed in Drosophila can be generalized across phyla, implicating muscle as an additional hitherto unrecognized target for MeHg toxicity. Furthermore, our observations that caffeine can ameliorate the toxic effects of MeHg show that nutritional factors and dietary manipulations may offer protection against the deleterious effects of MeHg exposure.