Climate change will strongly impact aquatic ecosystems particularly in arid and semi-arid regions. Fish-parasite interactions will also be affected by predicted altered flow and temperature regimes, and other environmental stressors. Hence, identifying environmental and genetic factors associated with maintaining diversity at immune genes is critical for understanding species' adaptive capacity. Here, we combine genetic (MHC class IIβ and microsatellites), parasitological and ecological data to explore the relationship between these factors in the remnant wild Rio Grande silvery minnow (Hybognathus amarus) population, an endangered species found in the southwestern United States. Infections with multiple parasites on the gills were observed and there was spatio-temporal variation in parasite communities and patterns of infection among individuals. Despite its highly endangered status and chronically low genetic effective size, Rio Grande silvery minnow had high allelic diversity at MHC class IIβ with more alleles recognized at the presumptive DAB1 locus compared to the DAB3 locus. We identified significant associations between specific parasites and MHC alleles against a backdrop of generalist parasite prevalence. We also found that individuals with higher individual neutral heterozygosity and higher amino acid divergence between MHC alleles had lower parasite abundance and diversity. Taken together, these results suggest a role for fluctuating selection imposed by spatio-temporal variation in pathogen communities and divergent allele advantage in maintenance of high MHC polymorphism. Understanding the complex interaction of habitat, pathogens and immunity in protected species will require integrated experimental, genetic and field studies.