Major histocompatibility complex (MHC) genes encode proteins involved in the recognition of parasite-derived antigens. Their extreme polymorphism is presumed to be driven by co-evolution with parasites. Host–parasite co-evolution was also hypothesized to optimize within-individual MHC diversity at the intermediate level. Here, we use unique data on lifetime reproductive success (LRS) of female collared flycatchers to test whether LRS is associated with within-individual MHC class II diversity. We also examined the association between MHC and infection with avian malaria. Using 454 sequencing, we found that individual flycatchers carry between 3 and 23 functional MHC class II B alleles. Predictions of the optimality hypothesis were not confirmed by our data as the prevalence of blood parasites decreased with functional MHC diversity. Furthermore, we did not find evidence for an association between MHC diversity and LRS.