A2A Bridge MCP server

Bridges Google's Agent-to-Agent protocol with MCP, enabling agent discovery, registration, message sending, and task management through protocol translation between A2A's JSON-RPC messaging and MCP's tool-based interface.
Back to servers
Setup instructions
Provider
gongrzhe
Release date
May 28, 2025
Language
Go
Stats
50 stars

The A2A MCP Server bridges the Model Context Protocol with the Agent-to-Agent protocol, enabling AI assistants like Claude to seamlessly connect with A2A agents. This integration layer allows MCP clients to discover, register, and communicate with A2A agents through a unified interface.

Installation Options

Via Smithery

npx -y @smithery/cli install @GongRzhe/A2A-MCP-Server --client claude

From PyPI

pip install a2a-mcp-server

Local Installation

git clone https://github.com/GongRzhe/A2A-MCP-Server.git
cd A2A-MCP-Server
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

Configuration

Environment Variables

Configure the server using these environment variables:

# Transport type: stdio, streamable-http, or sse
export MCP_TRANSPORT="streamable-http"

# Host for the MCP server
export MCP_HOST="0.0.0.0"

# Port for the MCP server (when using HTTP transports)
export MCP_PORT="8000"

# Path for the MCP server endpoint (when using HTTP transports)
export MCP_PATH="/mcp"

# Path for SSE endpoint (when using SSE transport)
export MCP_SSE_PATH="/sse"

# Enable debug logging
export MCP_DEBUG="true"

Transport Types

The server supports multiple transport methods:

  • stdio (default): Uses standard input/output for communication

    • Required for Claude Desktop
    • No HTTP server is started
  • streamable-http: HTTP transport with streaming support

    • Recommended for web clients and production deployments
    • Starts an HTTP server to handle MCP requests
  • sse: Server-Sent Events transport

    • Provides real-time event streaming

Running the Server

# Using default settings (stdio transport)
uvx a2a-mcp-server

# Using HTTP transport on specific host and port
MCP_TRANSPORT=streamable-http MCP_HOST=127.0.0.1 MCP_PORT=8080 uvx a2a-mcp-server

Configuring in Claude Desktop

Add the server to your claude_desktop_config.json file, located at:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Using PyPI Installation (Recommended)

"a2a": {
  "command": "uvx",
  "args": [
    "a2a-mcp-server"
  ]
}

Using Local Installation

"a2a": {
  "command": "C:\\path\\to\\python.exe",
  "args": [
    "C:\\path\\to\\A2A-MCP-Server\\a2a_mcp_server.py"
  ],
  "env": {
    "MCP_TRANSPORT": "stdio",
    "PYTHONPATH": "C:\\path\\to\\A2A-MCP-Server"
  }
}

Using the Config Creator

# If using local installation
python config_creator.py

Using with MCP Clients

Claude Web

  1. Start the MCP server with HTTP transport:

    MCP_TRANSPORT=streamable-http MCP_HOST=127.0.0.1 MCP_PORT=8000 uvx a2a-mcp-server
    
  2. In Claude web interface, enable the MCP URL connection in Tools menu with http://127.0.0.1:8000/mcp

Claude Desktop

Add the configuration to your claude_desktop_config.json file as described above.

Cursor IDE

  1. Run the server with HTTP transport
  2. In Cursor IDE, go to Settings > AI > MCP Servers
    • Add a new MCP Server with URL: http://127.0.0.1:8000/mcp

Windsurf Browser

  1. Run the server with HTTP transport
  2. In Windsurf browser, go to Settings > MCP Connections
    • Add a new MCP connection with URL: http://127.0.0.1:8000/mcp

Available MCP Tools

Agent Management

  • register_agent: Register an A2A agent

    {
      "name": "register_agent",
      "arguments": {
        "url": "http://localhost:41242"
      }
    }
    
  • list_agents: Get registered agents

    {
      "name": "list_agents",
      "arguments": {}
    }
    
  • unregister_agent: Remove an agent

    {
      "name": "unregister_agent",
      "arguments": {
        "url": "http://localhost:41242"
      }
    }
    

Message Processing

  • send_message: Send a message to an agent

    {
      "name": "send_message",
      "arguments": {
        "agent_url": "http://localhost:41242",
        "message": "What's the exchange rate from USD to EUR?",
        "session_id": "optional-session-id"
      }
    }
    
  • send_message_stream: Send a message and stream response

    {
      "name": "send_message_stream",
      "arguments": {
        "agent_url": "http://localhost:41242",
        "message": "Tell me a story about AI agents.",
        "session_id": "optional-session-id"
      }
    }
    

Task Management

  • get_task_result: Retrieve a task's result

    {
      "name": "get_task_result",
      "arguments": {
        "task_id": "b30f3297-e7ab-4dd9-8ff1-877bd7cfb6b1",
        "history_length": null
      }
    }
    
  • cancel_task: Cancel a running task

    {
      "name": "cancel_task",
      "arguments": {
        "task_id": "b30f3297-e7ab-4dd9-8ff1-877bd7cfb6b1"
      }
    }
    

Usage Examples

Basic Workflow

  1. Register an A2A agent
  2. Send a message to the agent (get task_id)
  3. Retrieve the task result using task_id

Example with Claude

User: Register an agent at http://localhost:41242

Claude uses: register_agent(url="http://localhost:41242")
Claude: Successfully registered agent: ReimbursementAgent

User: Ask the agent what it can do

Claude uses: send_message(agent_url="http://localhost:41242", message="What can you do?")
Claude: I've sent your message. Here's the task_id: b30f3297-e7ab-4dd9-8ff1-877bd7cfb6b1

User: Get the answer to my question

Claude uses: get_task_result(task_id="b30f3297-e7ab-4dd9-8ff1-877bd7cfb6b1")
Claude: The agent replied: "I can help you process reimbursement requests. Just tell me what you need to be reimbursed for, including the date, amount, and purpose."

Troubleshooting

Agent Registration Issues

  • Verify the agent URL is correct and accessible
  • Check if the agent has a proper agent card at /.well-known/agent.json

Message Delivery Problems

  • Ensure the agent is registered (use list_agents)
  • Verify the agent is running and accessible

Task Result Retrieval Issues

  • Make sure you're using the correct task_id
  • Check if too much time has passed (some agents might discard old tasks)

Transport Issues

  • stdio issues: Ensure input/output streams are not redirected
  • streamable-http issues: Check if the port is available and not blocked
  • sse issues: Verify the client supports Server-Sent Events

Claude Desktop Configuration Issues

  • Check paths in your claude_desktop_config.json
  • Verify Python is in your PATH if using "command": "python"
  • Ensure MCP_TRANSPORT is set to "stdio" in the env section
  • Use the config_creator.py script for automatic configuration

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "a2a" '{"command":"uvx","args":["a2a-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "a2a": {
            "command": "uvx",
            "args": [
                "a2a-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "a2a": {
            "command": "uvx",
            "args": [
                "a2a-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later