Microbial communities play fundamental roles in every complex ecosystem, such as soil, sea and the human body. The stability and diversity of the microbial community depend precisely on the composition of the microbiota. Any change in the composition of these communities affects microbial functions. An important goal of studying the interactions between species is to understand the behavior of microbes and their responses to perturbations. These interactions among species are mediated by the exchange of metabolites within microbial communities. We developed a computational model for the microbial community that has a separate compartment for exchanging metabolites. This model can predict possible metabolites that cause competition, commensalism, and mutual interactions between species within a microbial community. Our constraint-based community metabolic modeling approach provides insights to elucidate the pattern of metabolic interactions for each common metabolite between two microbes. To validate our approach, we used a toy model and a syntrophic co-culture of Desulfovibrio vulgaris and Methanococcus maripaludis, as well as another in co-culture between Geobacter sulfurreducens and Rhodoferax ferrireducens. For a more general evaluation, we applied our algorithm to the honeybee gut microbiome, composed of seven species, and the epiphyte strain Pantoea eucalypti 299R. The epiphyte strain Pe299R has been previously studied and cultured with six different phyllosphere bacteria. Our algorithm successfully predicts metabolites, which imply mutualistic, competitive, or commensal interactions. In contrast to OptCom, MRO, and MICOM algorithms, our COMMA algorithm shows that the potential for competitive interactions between an epiphytic species and Pe299R is not significant. These results are consistent with the experimental measurements of population density and reproductive success of the Pe299R strain.