Major histocompatibility complex (MHC) genes play a central role for pathogen recognition by the adaptive immune system. The MHC genes are often duplicated and tightly linked within a small genomic region. This structural organization suggests that natural selection acts on the combined property of multiple MHC gene copies in segregating haplotypes, rather than on single MHC genes. This may have important implications for analyses of patterns of selection on MHC genes. Here, we present a computer-assisted protocol to infer segregating MHC haplotypes from family data, based on functions in the R package MHCtools. We employed this method to identify 107 unique MHC class I (MHC-I) haplotypes in 116 families of wild great reed warblers (Acrocephalus arundinaceus). In our data, the MHC-I genes were tightly linked in haplotypes and inherited as single units, with only two observed recombination events among 334 offspring. We found substantial variation in the number of different MHC-I alleles per haplotype, and the divergence between alleles in MHC-I haplotypes was significantly higher than between randomly assigned alleles in simulated haplotypes. This suggests that selection has favored non-random associations of divergent MHC-I alleles in haplotypes to increase the range of pathogens that can be recognized by the adaptive immune system. Further studies of selection on MHC haplotypes in natural populations is an interesting avenue for future research. Moreover, inference and analysis of MHC haplotypes offers important insights into the structural organization of MHC genes, and may improve the accuracy of the MHC region in de novo genome assemblies.