This paper proposes a new framework m-P@gent for describing environment-aware mobile agents that can run even on resource-limited devices and appliances. In the framework, a mobile agent is divided into a two parts: a core and add-on functional modules. The runtime system dynamically collects add-on modules necessary for a new environment, and links them with the core component. This feature allows us to describe an application seamless against changes of computing environment. We have implemented mobile agent systems based on this framework on actual PC environments, small PDA devices, embedded computer devices and networked appliances. Our system makes two contributions. One is that it shows a possibility for expanding the field of mobile agent to resource-limited devices. Another is it reduces the cost of an agent migration and provides cooperative resource consumption control by agents and runtime systems. The framework will be a core software infrastructure for controlling networked appliances and building ubiquitous computing environment.