—This paper proposes a mobile-agent-based data gathering system (called TinyBee) in wireless sensor networks. Most existing mobile-agent-based systems consider only static sinks/servers. In this paper, we consider both mobile servers and lightweight mobile agents. We aim to design a data gathering system using a special kind of mobile agent called TinyBee to collect data all over a network. TinyBee migrates from node to node after being dispatched from a mobile server in order to collect data so that physical movement of mobile servers is greatly reduced. Mobile-agent-based approaches outperform traditional client/server paradigms in terms of execution time and power consumption. Extensive simulation results demonstrate that our proposed schemes achieve significant performance gains.