The importance of climate, habitat structure, and higher trophic levels on microbial diversity is only beginning to be understood. Here, we examined the influence of climate variables, plant morphology, and the abundance of aquatic invertebrates on the microbial biodiversity of the northern pitcher plant Sarracenia purpurea. The plant's cup-shaped leaves fill with rainwater and support a miniature, yet full-fledged, ecosystem with a diverse microbiome that decomposes captured prey and a small network of shredding and filter-feeding aquatic invertebrates that feed on microbes. We characterized pitcher microbiomes of 108 plants sampled at 36 sites from Florida to Quebec. Structural equation models revealed that annual precipitation and temperature, plant size, and midge abundance had direct effects on microbiome taxonomic and phylogenetic diversity. Climate variables also exerted indirect effects through plant size and midge abundance. Further, spatial structure and climate influenced taxonomic composition, but not phylogenetic composition. Our results suggest that direct effects of midge abundance and climate and indirect effects of climate through its effect on plant-associated factors lead to greater richness of microbial phylotypes in warmer, wetter sites.