loading…
Search for a command to run...
loading…
Enables AI assistants to spawn and manage long-running cloud agents via MCP, offloading tasks to AWS Bedrock AgentCore.
Enables AI assistants to spawn and manage long-running cloud agents via MCP, offloading tasks to AWS Bedrock AgentCore.
Claude Code, Codex, OpenClaw, and Hermes are strong local orchestrators. Long-running jobs need a separate execution plane.
@agent-dispatch/mcp-server hands them a managed cloud runtime — one MCP call, durable status, results when they land.
Quick start · What it does · Clients & frameworks · Config · The rest of AgentDispatch
Local AI assistants are effective planners. They hit operational limits when work becomes long-running:
Running this inline consumes context, blocks the lead-agent session, and loses continuity when the local process stops.
AgentDispatch is the missing tool. One MCP server gives your assistant a single primitive: spawn a cloud agent with this instruction, come back later for the result. The work runs on managed cloud compute. Status, logs, and the final output flow back through the same MCP channel.
A single MCP server exposes ten tools to your assistant:
| Tool | What it does |
|---|---|
spawn_cloud_agent |
The shortcut. One instruction, defaults from a runtime profile, returns a durable taskId and optional cloudAgent metadata. |
check_cloud_agent_runtime |
Preflight a configured runtime before spawning. For AWS AgentCore, it can verify credentials and runtime/control-plane reachability. |
dispatch_task |
The escape hatch. Full control over provider, capability, backend, target, and input. |
get_task_status |
Current status for a dispatched task. |
get_task_logs |
Paginated logs, cursor-based. |
get_task_result |
Final result payload when the task completes. |
cancel_task |
Cancel an in-flight task. |
list_providers |
Providers configured in this server. |
list_capabilities |
Capabilities a provider exposes, filterable by provider. |
list_account_profiles |
Account profiles configured for dispatch. |
The model side looks like this:
check_cloud_agent_runtime({ runtime: "research-agent" })
// → { ok: true, checks: [...] }
spawn_cloud_agent({ instruction: "Audit our S3 buckets for public read and report findings." })
// → { taskId: "task_...", status: "queued", cloudAgent: { ... } }
get_task_status({ task_id: "task_..." })
get_task_logs({ task_id: "task_...", cursor: 0, limit: 200 })
get_task_result({ task_id: "task_..." })
All tool inputs are validated with Zod. See src/schemas.ts for the exact shapes.
spawn_cloud_agent is intentionally small. Runtime profiles supply the provider, account, backend, target mode, framework, model, protocol, and default tools.
Tool inputs use MCP-friendly snake_case. Responses return the same camelCase object shape as the AgentDispatch SDK and core runtime.
{
"runtime": "research-agent",
"instruction": "Run the background research task and report progress.",
"protocol": "a2a",
"context": {
"repo": "agent-dispatch",
"priority": "background"
}
}
Immediate response:
{
"taskId": "task_...",
"status": "queued",
"provider": "aws",
"accountProfile": "dev-aws",
"capability": "agent-runtime",
"backend": "aws-agentcore",
"poll": {
"statusTool": "get_task_status",
"logsTool": "get_task_logs",
"resultTool": "get_task_result"
},
"cloudAgent": {
"protocol": "a2a",
"provider": "aws",
"backend": "aws-agentcore",
"accountProfile": "dev-aws",
"sessionId": "ad-f7221e93f25499a0a1fc0160f63c7621",
"invocation": {
"type": "aws.agentcore.invoke_agent_runtime",
"runtimeUrl": "https://bedrock-agentcore.us-west-2.amazonaws.com/runtimes/.../invocations/",
"sessionHeaderName": "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id",
"payloadFormat": "a2a.jsonrpc.message-send"
},
"a2a": {
"transport": "json-rpc-2.0-http",
"messageMethod": "message/send",
"agentCardPath": "/.well-known/agent-card.json"
}
}
}
If the agent does not provide enough information, the server returns a structured clarification instead of failing late:
{
"status": "needs_clarification",
"retry_tool": "spawn_cloud_agent",
"questions": [
{ "id": "instruction", "question": "What task should the cloud subagent run?" },
{ "id": "runtimeArn", "question": "Which AWS AgentCore runtime ARN should this cloud subagent use?" }
],
"available_runtimes": []
}
The agent can answer the clarification directly on the next spawn_cloud_agent call:
{
"instruction": "Audit our S3 buckets for public read.",
"runtimeArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:agent/..."
}
Runtime-mode clarifications work the same way with ecrImageUri, executionRoleArn, and optional environmentVariables.
Anything that speaks MCP works. The common clients today:
~/.claude/mcp_settings.json or your project's MCP config.spawn_cloud_agent from inside any task that should leave the local runtime.spawn_cloud_agent and dispatch_task both accept an optional framework string, and runtime profiles carry a default. AgentDispatch does not interpret the value; the worker does. That means OpenClaw-style, Hermes-style, Strands, LangChain, or custom workers can all fit the same MCP contract as soon as your cloud worker knows how to handle the framework.
npm install \
@agent-dispatch/core \
@agent-dispatch/mcp-server \
@agent-dispatch/store-sqlite \
@agent-dispatch/adapter-aws-agentcore
npx agentdispatch-mcp --config agentdispatch.config.json --check
Wire it into your MCP client:
{
"mcpServers": {
"agentdispatch": {
"command": "npx",
"args": ["agentdispatch-mcp", "--config", "/abs/path/agentdispatch.config.json"]
}
}
}
The defaults come from your runtime profile. From the model side, spawn_cloud_agent({ instruction }) is the only call required for the common path.
Claude Code · Codex · OpenClaw · Hermes · any MCP client
│ stdio
▼
┌─────────────────────────────────────────────┐
│ @agent-dispatch/mcp-server │ ← this repo
└─────────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ @agent-dispatch/core │ ← contracts + dispatch
└──────┬──────────┬───────────────────────────┘
│ │
▼ ▼
┌──────────┐ ┌──────────────────────────────────┐
│ store │ │ adapter (AWS Bedrock AgentCore) │
│ (sqlite) │ │ ↓ │
└──────────┘ │ cloud worker — runs the task │
└──────────────────────────────────┘
spawn_cloud_agent over MCP.cloudAgent metadata flow back through the same path.Minimal AWS Bedrock AgentCore session-mode config:
{
"stateDir": ".agentdispatch",
"accounts": {
"dev-aws": {
"provider": "aws",
"region": "us-west-2",
"credentialSource": "aws-sdk-default"
}
},
"backends": {
"agentcore-dev": {
"adapter": "aws-agentcore",
"account": "dev-aws",
"details": {
"region": "us-west-2",
"runtimeArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/my-runtime",
"protocol": "a2a"
}
}
},
"runtimes": {
"research-agent": {
"provider": "aws",
"account": "dev-aws",
"capability": "agent-runtime",
"backend": "agentcore-dev",
"target": { "mode": "session" },
"protocol": "a2a",
"framework": "strands",
"runtimeTools": { "enabled": ["web-search", "code-interpreter"] }
}
},
"defaults": {
"runtime": "research-agent"
}
}
Once defaults.runtime is set, spawn_cloud_agent only needs an instruction. The framework, model, runtimeTools, and protocol values are passed through to the worker.
Validate before connecting an MCP client:
npx agentdispatch-mcp --config agentdispatch.config.json --check
spawn_cloud_agent is the control-plane call. After spawn, the lead agent can:
get_task_status, get_task_logs, and get_task_result.cloudAgent protocol metadata.message/send when the runtime protocol is a2a.spawn_cloud_agent calls, one per service, then aggregates reports.| Repo | Role |
|---|---|
| core | Runtime contracts and dispatch orchestration |
| mcp-server | You are here. MCP face for the runtime |
| sdk-js | TypeScript SDK for application code |
| cli | Command-line interface |
| store-sqlite | SQLite + filesystem state store |
| adapter-aws-agentcore | AWS Bedrock AgentCore adapter |
| worker-agentcore | Standard AgentCore worker contract |
| adapter-template | Starter for new cloud adapters |
| docs | Documentation |
| website | Static project website |
npm install
npm run typecheck
npm test
npm run build
PRs, issues, and adapter contributions are welcome. See CONTRIBUTING.md for the local workflow.
If you ship a new framework worker or a new cloud adapter, open a discussion so it can be linked from the org README.
Apache-2.0. See LICENSE.
Built by the AgentDispatch contributors · github.com/agent-dispatch
Run in your terminal:
claude mcp add agent-dispatch-mcp-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.