@agent-dispatch/mcp-server

@agent-dispatch/mcp-server

Enables AI assistants to spawn and manage long-running cloud agents via MCP, offloading tasks to AWS Bedrock AgentCore.

Category
Visit Server

README

@agent-dispatch/mcp-server

<h3 align="center">Spawn cloud agents from your AI.</h3>

<p align="center"> Claude Code, Codex, OpenClaw, and Hermes are strong local orchestrators. Long-running jobs need a separate execution plane.<br/> <code>@agent-dispatch/mcp-server</code> hands them a managed cloud runtime — one MCP call, durable status, results when they land. </p>

<p align="center"> <a href="#quick-start"><strong>Quick start</strong></a> · <a href="#what-it-does">What it does</a> · <a href="#supported-clients-and-frameworks">Clients & frameworks</a> · <a href="#configuration">Config</a> · <a href="https://github.com/agent-dispatch">The rest of AgentDispatch</a> </p>

<p align="center"> <a href="https://www.npmjs.com/package/@agent-dispatch/mcp-server"><img alt="npm" src="https://img.shields.io/npm/v/@agent-dispatch/mcp-server?color=7C3AED&label=npm&style=flat-square"></a> <img alt="MCP" src="https://img.shields.io/badge/MCP-1.x-06B6D4?style=flat-square"> <img alt="AWS Bedrock AgentCore" src="https://img.shields.io/badge/AWS-Bedrock%20AgentCore-FF9900?style=flat-square"> <img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-0EA5E9?style=flat-square"> <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square"> </p>


Why this exists

Local AI assistants are effective planners. They hit operational limits when work becomes long-running:

  • A deep-research sweep across fifty pages of docs.
  • An account-wide audit that has to touch every service.
  • A multi-hour job that has no business sitting in your IDE's context window.

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.

  • ☁️ Cloud execution plane. AWS Bedrock AgentCore today; new clouds plug in through one small adapter contract.
  • ⏱️ Built for long-running work. Sessions for stateful runs. Runtime mode for provisioned per-task resources. Same MCP contract.
  • 🔭 Full visibility. Status, paginated logs, results, cancellation — over MCP, the SDK, or the CLI.
  • 🪶 Simple defaults. SQLite state. stdio transport. Zero hidden services. Runs locally, in CI, or on a server.

What it does

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.

Agent-facing contract

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.

Supported clients and frameworks

Anything that speaks MCP works. The common clients today:

  • Claude Code — add it to ~/.claude/mcp_settings.json or your project's MCP config.
  • Codex — add this server as a local MCP server for cloud handoff tasks.
  • OpenClaw — call spawn_cloud_agent from inside any task that should leave the local runtime.
  • Hermes — move long-running reasoning and tool-rich runs to managed cloud infrastructure.
  • Claude Desktop, Cursor, Continue, Goose, Zed — same JSON, different config file.

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.

Quick start

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.

How it works

   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    │
                 └──────────────────────────────────┘
  1. Local assistant issues spawn_cloud_agent over MCP.
  2. MCP server validates input, hydrates defaults from a runtime profile, calls the core runtime.
  3. Core picks the capability and adapter, persists the task, dispatches.
  4. Adapter invokes the worker in your cloud.
  5. Worker runs an agent framework on managed cloud infrastructure.
  6. Status, logs, results, and optional cloudAgent metadata flow back through the same path.

Configuration

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

Interaction model

spawn_cloud_agent is the control-plane call. After spawn, the lead agent can:

  • Poll via get_task_status, get_task_logs, and get_task_result.
  • Continue native subagent interaction with returned cloudAgent protocol metadata.
  • Use A2A JSON-RPC message/send when the runtime protocol is a2a.
  • Cancel through AgentDispatch so provider references remain durable.

Real-world use cases

  • Deep research from chat. Codex or Claude Code spawns a cloud agent: "Read the last 90 days of CloudTrail anomalies and propose detection rules."
  • Parallel codebase audits. A lead agent fans out a dozen spawn_cloud_agent calls, one per service, then aggregates reports.
  • Long-running OpenClaw runs. OpenClaw plans locally, then dispatches multi-hour execution to a managed AgentCore worker.
  • Tool-rich Hermes jobs. Hermes uses cloud-side tools that are not available to the local process.

The rest of AgentDispatch

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

Development

npm install
npm run typecheck
npm test
npm run build

Contributing

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.

License

Apache-2.0. See LICENSE.

<p align="center"> <sub>Built by the AgentDispatch contributors · <a href="https://github.com/agent-dispatch">github.com/agent-dispatch</a></sub> </p>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured