— The maturing domain of ad hoc networking still holds some major challenges on its way to commercial exploitation. The dynamic and decentralized nature of ad hoc networks calls for new paradigms in the design of distributed applications. Most notably, there is a need for self-organization mechanisms in the middleware layer to enable medium-scale and large-scale distributed applications. In this paper we present MESHMdl, a middleware platform for ad hoc networks that is built on mobile agents and tuple space technology. MESHMdl provides basic building blocks for the implementation of selforganizing distributed applications for ad hoc networks. Unlike other middleware platforms, MESHMdl puts a high emphasis on mobility awareness, decoupling and bio-inspired coordination primitives. We discuss the aspects of ad hoc networking and self-organization and derive the basic architecture of MESHMdl before we present our prototype implementation.