Mobile cloud-based learning is a novel trend that allows collaborative learning to happen among distributed learners, but it still lacks of mechanisms to enhance teamwork performance. Combining the features of the cloud, we have identified a learning flow based on Kolb team learning experience, executed by cloud-hosting learning management systems in conjunction with our newly designed system, 'Teamwork as a Service (TaaS)'. Each of TaaS's five web services aims to organize a certain type of learning activities, providing learners with an introduction, a 'jigsaw classroom', schedule planning, and mutual supervision during the whole collaborative learning process. In particular, enabling a rational group mechanism realized by the simulated annealing method, TaaS is able to allocate learners to their appropriate tasks in order to give their best performance. We also introduce details of the implementation of TaaS over the Amazon cloud.