We use mathematical modelling to examine how microbial strain communities are structured by the host specialisation traits and antigenic relationships of their members. The model is quite general and broadly applicable, but we focus on Borrelia burgdorferi, the Lyme disease bacterium, transmitted by ticks to mice and birds. In this system, host specialisation driven by the evasion of innate immunity has been linked to multiple niche polymorphism, while antigenic differentiation driven by the evasion of adaptive immunity has been linked to negative frequency dependence. Our model is composed of two host species, one vector, and multiple co-circulating pathogen strains that vary in their host specificity and their antigenic distances from one another. We explore the conditions required to maintain pathogen diversity. We show that the combination of host specificity and antigenic differentiation creates an intricate niche structure. Unequivocal rules that relate the stability of a strain community directly to the trait composition of its members are elusive. However, broad patterns are evident. When antigenic differentiation is weak, stable communities are typically composed entirely of generalists that can exploit either host species equally well. As antigenic differentiation increases, more diverse stable communities emerge, typically around trait compositions of generalists, generalists and very similar specialists, and specialists roughly balanced between the two host species.