A2A协议网关
STDIO允许LLM与A2A代理交互的MCP服务器
允许LLM与A2A代理交互的MCP服务器
An MCP server that acts as a client to the Agent-to-Agent (A2A) protocol, allowing LLMs to interact with A2A agents through the Model Context Protocol (MCP).
# Install globally npm install -g a2a-client-mcp-server # Or run directly with npx npx a2a-client-mcp-server
A2A_ENDPOINT_URL
: URL of the A2A agent to connect to (default: "http://localhost:41241")Add this to your claude_desktop_config.json
:
npm run build npm link
{ "mcpServers": { "a2a-client": { "command": "npx", "args": ["-y", "a2a-client-mcp-server"], "env": { "A2A_ENDPOINT_URL": "http://localhost:41241" } } } }
Build the Docker image:
docker build -t a2a-client-mcp-server .
Configure Claude Desktop:
{ "mcpServers": { "a2a-client": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "A2A_ENDPOINT_URL", "a2a-client-mcp-server" ], "env": { "A2A_ENDPOINT_URL": "http://localhost:41241" } } } }
Send a task to an A2A agent
message
(string): Message to send to the agenttaskId
(string, optional): Task ID (generated if not provided)Get the current state of a task
taskId
(string): ID of the task to retrieveCancel a running task
taskId
(string): ID of the task to cancelSend a task and subscribe to updates (streaming)
message
(string): Message to send to the agenttaskId
(string, optional): Task ID (generated if not provided)maxUpdates
(number, optional): Maximum updates to receive (default: 10)Get information about the connected A2A agent
The server provides access to two MCP resources:
a2a://agent-card
: Information about the connected A2A agenta2a://tasks
: List of recent A2A tasksThis example shows how to use A2A Client MCP Server to interact with a Coder Agent:
First, let me explore what A2A agent we're connected to.
I'll use the a2a_agent_info tool to check the agent details.
The agent provides a coding service that can generate files based on natural language instructions. Let's create a simple Python script.
I'll use the a2a_send_task tool to send a request:
Task: "Create a Python function that calculates the Fibonacci sequence"
Now I can check the task status using a2a_get_task with the task ID from the previous response.
The agent has created the requested Python code. I can now retrieve and use this code in my project.
# Install dependencies npm install # Build the project npm run build # Run in development mode npm run watch
MIT