一个MCP服务器,作为代理对代理(A2A)协议的客户端,允许大型语言模型通过模型上下文协议(MCP)与A2A代理交互。
概览
一个MCP服务器,作为代理对代理(A2A)协议的客户端,允许大型语言模型通过模型上下文协议(MCP)与A2A代理交互。 - 连接任何兼容 A2A 的代理 - 发送和接收消息 - 跟踪和管理任务 - 支持流式响应 - 查询代理能力和元数据 - A2A_ENDPOINT_URL:要连接的A2A代理的URL(默认:“http://localhost:41241") 把这点记到你的claude_desktop_config.json里: 向A2A代理发送任务 - 消息(字符串):发送给代理的消息 - taskId(字符串,可选):任务ID(若未提供则生成) 获取任务当前状态- taskId(字符串):要检索任务的ID 取消正在运行的任务 - taskId(字符串):要取消任务的ID 发送任务并订阅更新(流式)- 消息(字符串):发送给代理的消息 - taskId(字符串,可选):任务ID(未提供则生成)- maxUpdates(编号,可选):接收的最大更新数(默认:10)
概述(AI 翻译)
一个MCP服务器,作为代理对代理(A2A)协议的客户端,允许大型语言模型通过模型上下文协议(MCP)与A2A代理交互。
特色
- 连接到任何兼容A2A的代理
- 发送和接收消息
- 跟踪和管理任务
- 支持流式响应
- 查询代理能力和元数据
安装
配置
环境变量
A2A_ENDPOINT_URL:连接的A2A代理的URL(默认:“http://localhost:41241")
使用 Claude Desktop
把这个加到你的claude_desktop_config.json上:
NPX
Docker
构建 Docker 镜像:
配置Claude Desktop:
可用工具
a2a_send_task
将任务发送给A2A代理
message(字符串):发送给代理的消息taskId(字符串,可选):任务ID(未提供则生成)
a2a_get_task
获取任务当前状态
taskId(字符串):要检索任务的ID
a2a_cancel_task
取消正在运行的任务
taskId(字符串):要取消任务的ID
a2a_send_task_subscribe
发送任务并订阅更新(直播)
message(字符串):发送给代理的消息
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
A2A Client MCP Server
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).
Features
- Connect to any A2A-compatible agent
- Send and receive messages
- Track and manage tasks
- Support for streaming responses
- Query agent capabilities and metadata
Installation
# Install globally
npm install -g a2a-client-mcp-server
# Or run directly with npx
npx a2a-client-mcp-server
Configuration
Environment Variables
A2A_ENDPOINT_URL: URL of the A2A agent to connect to (default: “http://localhost:41241”)
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
NPX
npm run build
npm link
{
"mcpServers": {
"a2a-client": {
"command": "npx",
"args": ["-y", "a2a-client-mcp-server"],
"env": {
"A2A_ENDPOINT_URL": "http://localhost:41241"
}
}
}
}
Docker
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"
}
}
}
}
Available Tools
a2a_send_task
Send a task to an A2A agent
message(string): Message to send to the agenttaskId(string, optional): Task ID (generated if not provided)
a2a_get_task
Get the current state of a task
taskId(string): ID of the task to retrieve
a2a_cancel_task
Cancel a running task
taskId(string): ID of the task to cancel
a2a_send_task_subscribe
Send 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)
a2a_agent_info
Get information about the connected A2A agent
- No parameters required
Resources
The server provides access to two MCP resources:
a2a://agent-card: Information about the connected A2A agenta2a://tasks: List of recent A2A tasks
Example Usage
This 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.
安装
npx -y a2a-client-mcp-server配置
{
"mcpServers": {
"a2a-client": {
"command": "npx",
"args": ["-y", "a2a-client-mcp-server"],
"env": {
"A2A_ENDPOINT_URL": "http://localhost:41241"
}
}
}
}