The human microbiome plays a key role in human health and is associated with numerous diseases. Metagenomic-based studies are now generating valuable information about the composition of the microbiome in health and in disease, demonstrating nonneutral assembly processes and complex co-occurrence patterns. However, the underlying ecological forces that structure the microbiome are still unclear. Specifically, compositional studies alone with no information about mechanisms of interaction, potential competition, or syntrophy, cannot clearly distinguish habitat-filtering and species assortment assembly processes. To address this challenge, we introduce a computational framework, integrating metagenomic-based compositional data with genome-scale metabolic modeling of species interaction. We use in silico metabolic network models to predict levels of competition and complementarity among 154 microbiome species and compare predicted interaction measures to species co-occurrence. Applying this approach to two large-scale datasets describing the composition of the gut microbiome, we find that species tend to co-occur across individuals more frequently with species with which they strongly compete, suggesting that microbiome assembly is dominated by habitat filtering. Moreover, species' partners and excluders exhibit distinct metabolic interaction levels. Importantly, we show that these trends cannot be explained by phylogeny alone and hold across multiple taxonomic levels. Interestingly, controlling for host health does not change the observed patterns, indicating that the axes along which species are filtered are not fully defined by macroecological host states. The approach presented here lays the foundation for a reverse-ecology framework for addressing key questions concerning the assembly of host-associated communities and for informing clinical efforts to manipulate the microbiome.