Labsco
yw0nam logo

A2A MCP Server

โ˜… 7

from yw0nam

A bridge server connecting Model Context Protocol (MCP) with Agent-to-Agent (A2A) protocol.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

MCP-A2A-Gateway

License smithery badge

cover_image A gateway server that bridges the Model Context Protocol (MCP) with the Agent-to-Agent (A2A) protocol, enabling MCP-compatible AI assistants (like Claude) to seamlessly interact with A2A agents.

Overview

This project serves as an integration layer between two cutting-edge AI agent protocols:

  • Model Context Protocol (MCP): Developed by Anthropic, MCP allows AI assistants to connect to external tools and data sources. It standardizes how AI applications and large language models connect to external resources in a secure, composable way.

  • Agent-to-Agent Protocol (A2A): Developed by Google, A2A enables communication and interoperability between different AI agents through a standardized JSON-RPC interface.

By bridging these protocols, this server allows MCP clients (like Claude) to discover, register, communicate with, and manage tasks on A2A agents through a unified interface.

Features

  • Agent Management

    • Register A2A agents with the bridge server
    • List all registered agents
    • Unregister agents when no longer needed
  • Communication

    • Send messages to A2A agents and receive responses
    • Asynchronous message sending for immediate server response.
    • Stream responses from A2A agents in real-time
  • Task Management

    • Track which A2A agent handles which task
    • Retrieve task results using task IDs
    • Get a list of all tasks and their statuses.
    • Cancel running tasks
  • Transport Support

    • Multiple transport types: stdio, streamable-http, SSE
    • Configure transport type using MCP_TRANSPORT environment variable

To connect github copilot

For HTTP/SSE Transport

Add below to VS Code settings.json for sse or http:

"mcpServers": {
  "mcp_a2a_gateway": {
    "url": "http://0.0.0.0:10000/mcp"
  }
}
For STDIO Transport - Using uvx (Published Package)
"mcpServers": {
  "mcp_a2a_gateway": {
    "type": "stdio",
    "command": "uvx",
    "args": ["mcp-a2a-gateway"],
    "env": {
      "MCP_TRANSPORT": "stdio",
      "MCP_DATA_DIR": "/Users/your-username/Desktop/data/Copilot/a2a_gateway/"
    }
  }
}
For STDIO Transport - Using uvx (Local Development)
"mcpServers": {
  "mcp_a2a_gateway": {
    "type": "stdio",
    "command": "uvx",
    "args": ["--from", "/path/to/MCP-A2A-Gateway", "mcp-a2a-gateway"],
    "env": {
      "MCP_TRANSPORT": "stdio",
      "MCP_DATA_DIR": "/Users/your-username/Desktop/data/Copilot/a2a_gateway/"
    }
  }
}
For STDIO Transport - Using uv (Local Development)
"mcpServers": {
  "mcp_a2a_gateway": {
    "type": "stdio",
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/MCP-A2A-Gateway",
      "run",
      "mcp-a2a-gateway"
    ],
    "env": {
      "MCP_TRANSPORT": "stdio",
      "MCP_DATA_DIR": "/Users/your-username/Desktop/data/Copilot/a2a_gateway/"
    }
  }
}

To Connect claude desktop

Using uvx (Published Package)

Add this to claude_config.json

"mcpServers": {
  "mcp_a2a_gateway": {
    "command": "uvx",
    "args": ["mcp-a2a-gateway"],
    "env": {
      "MCP_TRANSPORT": "stdio",
      "MCP_DATA_DIR": "/Users/your-username/Desktop/data/Claude/a2a_gateway/"
    }
  }
}
Using uvx (Local Development)

Add this to claude_config.json

"mcpServers": {
  "mcp_a2a_gateway": {
    "command": "uvx",
    "args": ["--from", "/path/to/MCP-A2A-Gateway", "mcp-a2a-gateway"],
    "env": {
      "MCP_TRANSPORT": "stdio",
      "MCP_DATA_DIR": "/Users/your-username/Desktop/data/Claude/a2a_gateway/"
    }
  }
}
Using uv (Local Development)

Add this to claude_config.json

"mcpServers": {
  "mcp_a2a_gateway": {
    "command": "uv",
    "args": ["--directory", "/path/to/MCP-A2A-Gateway", "run", "mcp-a2a-gateway"],
    "env": {
      "MCP_TRANSPORT": "stdio",
      "MCP_DATA_DIR": "/Users/your-username/Desktop/data/Claude/a2a_gateway/"
    }
  }
}

Available MCP Tools

The server exposes the following MCP tools for integration with LLMs like Claude:

Agent Management

  • register_agent: Register an A2A agent with the bridge server

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

    {
      "name": "list_agents",
      "arguments": {"dummy": "" }
    }
  • unregister_agent: Remove an A2A agent from the bridge server

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

Message Processing

  • send_message: Send a message to an agent and get a task_id for the response

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

Task Management

  • get_task_result: Retrieve a task's result using its ID

    {
      "name": "get_task_result",
      "arguments": {
        "task_id": "b30f3297-e7ab-4dd9-8ff1-877bd7cfb6b1",
      }
    }
  • get_task_list: Get a list of all tasks and their statuses.

    {
        "name": "get_task_list",
        "arguments": {}
    }

Roadmap & How to Contribute

We are actively developing and improving the gateway! We welcome contributions of all kinds. Here is our current development roadmap, focusing on creating a rock-solid foundation first.

Core Stability & Developer Experience (Help Wanted! ๐Ÿ‘)

This is our current focus. Our goal is to make the gateway as stable and easy to use as possible.

  • Implement Streaming Responses: Full support for streaming responses from A2A agents.
  • Enhance Error Handling: Provide clearer error messages and proper HTTP status codes for all scenarios.
  • Input Validation: Sanitize and validate agent URLs during registration for better security.
  • Add Health Check Endpoint: A simple /health endpoint to monitor the server's status.
  • Configuration Validation: Check for necessary environment variables at startup.
  • Comprehensive Integration Tests: Increase test coverage to ensure reliability.
  • Cancel Task: Implement task cancellation
  • Implement Streaming Update: Implement streaming task update. So that user check the progress.

Community & Distribution

  • Easy Installation: Add support for uvx
  • Docker Support: Provide a Docker Compose setup for easy deployment.
  • Better Documentation: Create a dedicated documentation site or expand the Wiki.

Want to contribute? Check out the issues tab or feel free to open a new one to discuss your ideas!

Automated Publishing & Releases

This project uses automated publishing through GitHub Actions for seamless releases.

Automated Release Process

# Patch release (0.1.6 โ†’ 0.1.7)
./release.sh patch

# Minor release (0.1.6 โ†’ 0.2.0)  
./release.sh minor

# Major release (0.1.6 โ†’ 1.0.0)
./release.sh major

The script will:

  1. โœ… Check you're on the main branch with clean working directory
  2. ๐Ÿ“ˆ Automatically bump the version in pyproject.toml
  3. ๐Ÿ”จ Build and test the package locally
  4. ๐Ÿ“ค Commit the version change and create a git tag
  5. ๐Ÿš€ Push to GitHub, triggering automated PyPI publishing

Option 2: Manual Tag Creation

# Update version in pyproject.toml manually
# Then create and push a tag
git add pyproject.toml
git commit -m "chore: bump version to 0.1.7"
git tag v0.1.7
git push origin main
git push origin v0.1.7

Option 3: GitHub Releases

  1. Go to https://github.com/yw0nam/MCP-A2A-Gateway/releases
  2. Click "Create a new release"
  3. Choose or create a tag (e.g., v0.1.7)
  4. Fill in release notes
  5. Publish the release

Setting Up Automated Publishing

To enable automated publishing, add your PyPI API token to GitHub Secrets:

  1. Get PyPI API Token:

  2. Add to GitHub Secrets:

    • Go to your repository โ†’ Settings โ†’ Secrets and variables โ†’ Actions
    • Add a new repository secret:
      • Name: PYPI_API_TOKEN
      • Value: Your PyPI token
  3. Test the Workflow:

    • Push a tag or create a release
    • Check the Actions tab for publishing status

Manual Publishing

For emergency releases or local testing:

# Build and get manual publish instructions
./publish.sh

# Or publish directly (with credentials configured)
uv build
uv publish