Orchestrating WASM-based MCP Tool Runtimes for AI Agents across Edge-Cloud Continuum
Moohyun Song, Hayoung Kim, Kyoohyun Lee, Jae Gi Son, Kyungyong Lee
The 26th IEEE/ACM International Symposium on Cluster, Cloud and Internet Computing (CCGrid 2026)
Scheduling middleware that dynamically selects execution locations (DEVICE/EDGE/CLOUD) for MCP tool calls in LangChain.
The system consists of three layers:
- LLM Agent Layer: LangChain-based cognitive agent. Aware only of logical tools, operating independently of underlying infrastructure details.
- Agent Tool Dispatcher: Control plane that intercepts logical tool calls and resolves them to optimal physical instances. Composed of RequestProxy, Tool Registry, Constraint Filter, and Pluggable Scheduler.
- Unified Execution Layer: Consistent execution environment across Device/Edge/Cloud. Hosts physical tools via containers or the WasmMCP runtime.
- Transparent Relaying (RequestProxy): Exposes invocation stubs generated from the Tool Registry to the LLM, masking the complexity of distributed infrastructure so the agent interacts through a single logical interface.
- Metadata Management (Tool Registry): Maps tools to multiple physical endpoints (DEVICE/EDGE/CLOUD). The Profiler continuously collects runtime metrics such as startup latency, I/O throughput, and network overhead to refine profiles.
- Constraint-First Filtering: Immediately prunes nodes that violate hard constraints such as data locality and privacy level, reducing the search space before scheduling.
- Pluggable Scheduler: Determines the final execution tier for filtered candidates. Extensible interface supporting various scheduling algorithms.
EdgeAgent/
├── edgeagent/ # Core package
│ ├── types.py Location, SchedulingResult, ChainSchedulingResult type definitions
│ ├── profiles.py Tool characteristic profiles + YAML loading
│ ├── registry.py Endpoint config + tool-server mapping management
│ ├── middleware.py MCP client connection, routing, session management
│ ├── request_proxy.py ProxyTool exposed to LLM (Agent mode only)
│ ├── runner.py Scenario execution framework (Agent mode only)
│ ├── scheduler/
│ │ ├── schedulers.py Scheduler implementations (constraint filtering + location decision)
│ │ └── scoring.py Cost function calculation
│ └── metrics/
│ ├── metrics.py Metrics collection
│ ├── callbacks.py LLM inference latency tracking (Agent mode callbacks)
│ └── validation.py Scenario result validation
├── config/ # Per-server config YAMLs
├── scripts/scenarios/ # Scenario execution scripts
├── infra/ # Infrastructure code
│ ├── cloud/ AWS IaC (Terraform)
│ ├── edge/ Edge environment setup scripts (K3S)
│ └── k8s/ Kubernetes manifests (Knative)
└── wasm_mcp/ # [Submodule] WASM MCP server framework
├── wasm_server/ Rust WASM project
│ ├── wasmmcp/ MCP framework core
│ ├── servers/ Rust WASM server implementations (9 servers)
│ └── shared/ Shared utilities
├── servers/ Python MCP server implementations
├── docker/ Docker configurations
└── deploy/ Image build/deploy scripts
- Python >= 3.13.9
- Node.js >= 18.0
- Docker & Docker Compose
- OpenAI API key
git clone --recurse-submodules https://github.com/ddps-lab/EdgeAgent.git
cd EdgeAgent
pip install -e . # editable install (or: pip install -r requirements.txt)
pip install -e ".[scenarios]" # optional: image processing dependencies (Pillow, imagehash)# Node.js official MCP servers
npm install -g @modelcontextprotocol/server-filesystem@2025.11.25
npm install -g @modelcontextprotocol/server-sequential-thinking@2025.3.20
# Python official MCP servers + wasm_mcp server dependencies
pip install mcp-server-git>=0.6.0
pip install mcp-server-time>=0.6.0
pip install -r wasm_mcp/requirements.txtcp .env.example .env
# Edit .env and set your OpenAI API key# Generate test data locally (fast, no network required)
python scripts/scenarios/setup_test_data.py --generate
# Or download public datasets (requires network)
python scripts/scenarios/setup_test_data.pyRun a scenario in script mode (predefined tool chain):
python scripts/scenarios/run_scenario1_script.py --scheduler brute_forceRun a scenario in agent mode (LLM selects tools autonomously):
python scripts/scenarios/run_scenario1_agent.py --scheduler brute_force| Mode | Description |
|---|---|
| Agent | LLM selects tools autonomously; the scheduler dynamically decides location at each invocation |
| Script | Fixed tool list per scenario; the scheduler determines entire placement before execution |
python scripts/scenarios/run_scenario1_agent.py # Agent, default: brute_force
python scripts/scenarios/run_scenario1_script.py # Script, default: brute_force
python scripts/scenarios/run_scenario1_script.py --scheduler all_device # specify scheduler| Scheduler | Description |
|---|---|
brute_force |
Exhaustive search over all location combinations to minimize total cost (default) |
static |
Uses pre-defined tool-location mappings from YAML config |
all_device |
Places all tools on DEVICE |
all_edge |
Places all tools on EDGE |
all_cloud |
Places all tools on CLOUD |
| Scenario | Description | Script | Agent |
|---|---|---|---|
| S1 | Code Review Pipeline | run_scenario1_script.py |
run_scenario1_agent.py |
| S2 | Log Analysis Pipeline | run_scenario2_script.py |
run_scenario2_agent.py |
| S3 | Research Assistant Pipeline | run_scenario3_script.py |
run_scenario3_agent.py |
| S4 | Image Processing Pipeline | run_scenario4_script.py |
run_scenario4_agent.py |
| Constraint | Behavior |
|---|---|
requires_gpu: true |
Runs only on CLOUD |
privacy_sensitive: true |
Excludes CLOUD (DEVICE or EDGE only) |
wasi_compatible: false |
Excludes EDGE (CONTAINER runtime only) |
data_locality: local_data |
Pins location based on path prefix |
See infra/README.md for cloud (AWS EKS) and edge (K3S) deployment instructions.
This project is licensed under the Apache License 2.0. See LICENSE for details.
If you use this software in your research, please cite:
@inproceedings{song2026edgeagent,
title={Orchestrating WASM-based MCP Tool Runtimes for AI Agents across Edge-Cloud Continuum},
author={Song, Moohyun and Kim, Hayoung and Lee, Kyoohyun and Son, Jae Gi and Lee, Kyungyong},
booktitle={The 26th IEEE/ACM International Symposium on Cluster, Cloud and Internet Computing},
year={2026}
}