We present a mean-field model for the phase diagram of a community of micro-organisms, interacting through their metabolism so that they are, in effect, engaging in a cooperative social game. We show that as a function of the concentration of the nutrients glucose and histidine, the community undergoes a phase transition separating a state in which one strain is dominant to a state which is characterized by coexisting populations. Our results are in good agreement with recent experimental results, correctly reproducing quantitative trends and predicting the phase diagram.