A2

A2A MCP Server for Claude and A2A Agents

Connect MCP-compatible assistants like Claude with A2A agents using an MCP server that bridges MCP and A2A protocols.

Quick Install
npx -y @GongRzhe/A2A-MCP-Server

Overview

A2A MCP Server is a lightweight bridge that connects MCP-compatible assistants (for example, Anthropic Claude running with an MCP integration) to A2A agents and tools. It translates Model Context Protocol (MCP) actions and events into the A2A agent protocol and vice versa, allowing an assistant to call, monitor, and receive results from external A2A-enabled tooling and services.

This server is useful when you need to enable multimodal workflows or tool use from an MCP-enabled assistant without changing the assistant itself. By exposing a consistent HTTP/webhook interface on both sides, the server centralizes routing, authorization, and simple message translation so developers can register tools, inspect traffic for debugging, and orchestrate agents during development or production deployments.

Features

  • Bidirectional bridge between MCP and A2A protocols
  • Simple HTTP webhook endpoints for registering agents and receiving assistant events
  • Pluggable authorization via bearer tokens or API keys
  • Message translation: converts MCP tool calls/events into A2A invocations and maps responses back
  • Docker and local development support
  • Logging and basic observability for message flows

Installation / Configuration

Clone and run locally or via Docker. Example commands:

Clone repository:

git clone https://github.com/GongRzhe/A2A-MCP-Server.git
cd A2A-MCP-Server

Run with Node (example):

# install dependencies
npm install

# environment variables (example)
export MCP_PORT=8080
export A2A_PORT=9090
export MCP_AUTH_TOKEN="your-mcp-token"
export A2A_AUTH_TOKEN="your-a2a-token"

# start dev server
npm run dev

Run with Docker:

# build image
docker build -t a2a-mcp-server .

# run container
docker run -d \
  -p 8080:8080 \
  -e MCP_PORT=8080 \
  -e A2A_PORT=9090 \
  -e MCP_AUTH_TOKEN="mcp-secret" \
  -e A2A_AUTH_TOKEN="a2a-secret" \
  --name a2a-mcp a2a-mcp-server

Example docker-compose.yml:

version: "3.8"
services:
  a2a-mcp:
    image: a2a-mcp-server:latest
    ports:
      - "8080:8080"
    environment:
      MCP_PORT: 8080
      A2A_PORT: 9090
      MCP_AUTH_TOKEN: "mcp-secret"
      A2A_AUTH_TOKEN: "a2a-secret"

Configuration options (common env vars):

  • MCP_PORT: HTTP port to expose MCP endpoints (default: 8080)
  • A2A_PORT: HTTP port for A2A endpoints or internal agent callbacks
  • MCP_AUTH_TOKEN / A2A_AUTH_TOKEN: static bearer tokens used to authorize incoming requests
  • LOG_LEVEL: debug|info|warn|error

Available Resources

API endpoints (typical):

EndpointMethodPurpose
/mcp/eventsPOSTReceive MCP assistant events (tool calls, responses, lifecycle events)
/mcp/connectPOSTRegister or handshake an MCP-compatible assistant
/a2a/registerPOSTRegister an A2A agent/tool with the bridge
/a2a/invokePOSTInternally invoked to trigger a registered A2A agent
/healthGETHealth and readiness check

Example: register an A2A tool

curl -X POST http://localhost:8080/a2a/register \
  -H "Authorization: Bearer a2a-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "weather-service",
    "endpoint": "http://internal-agent:9200/invoke",
    "capabilities": ["getWeather"]
  }'

Example: MCP event forwarded to A2A

curl -X POST http://localhost:8080/mcp/events \
  -H "Authorization: Bearer mcp-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "tool_call",
    "tool": "weather-service",
    "input": {"location": "San Francisco, CA"},
    "request_id": "req_123"
  }'

The bridge will call the registered A2A tool endpoint, await a response (or stream results back if configured), then POST a corresponding result back to the MCP assistant webhook.

Use Cases

  • Connect Claude (or another MCP-enabled assistant) to internal automation agents: let the assistant call internal services (deployment, CI checks, data lookup) via A2A agents without exposing those services directly to the assistant provider.
  • Orchestrate multi-agent workflows: use the server to coordinate calls among multiple A2A agents triggered by assistant prompts, aggregating results and returning them to the assistant in context.
  • Local testing and development: emulate an A2A environment locally while developing MCP-driven assistant experiences. The bridge makes it easy to stub agents and inspect translated messages.
  • Audit and debugging: centralize logs of assistant tool calls and agent responses for troubleshooting model-tool interactions.

Notes and Next Steps

  • Secure deployment: use HTTPS and strong tokens or mutual TLS for production; rotate keys regularly.
  • Scalability: the server is intended as a lightweight bridge. For high throughput, deploy behind load balancers and scale agent backends independently.
  • Extensibility: add custom adapters to translate specific A2A agent payloads or to support streaming responses.

GitHub repository: https://github.com/GongRzhe/A2A-MCP-Server — consult the repo for the latest code examples, issues, and contribution guidelines.