A2A协议MCP服务器
MCP(模型上下文协议)和谷歌之间的桥梁 代理2代理(A2A)协议 --实现代理发现、任务委托和代理间通信。
A2A是什么?
这个 Agent2代理协议 由谷歌于2025年4月推出,作为人工智能代理相互通信的开放标准。它现在正在标准化 Linux基金会 以确保供应商中立的治理。
关键概念:
- 代理卡 --宣传代理能力、技能和端点的JSON描述符
- 任务生命周期 --具有状态(已提交、正在工作、已完成、失败)的结构化任务委派
- 发现 --代理可以通过能力找到彼此
此服务器如何桥接MCP和A2A
MCP提供了AI模型和工具之间的接口。A2A提供代理之间的接口。此服务器结合了以下两种功能:
- MCP工具 将A2A操作暴露给任何与MCP兼容的AI代理
- 代理商可以 注册自己, 发现其他代理,以及 委派任务
- 本地注册表位于
~/.a2a-agents/存储代理卡和任务
工具
| 工具 | 说明 |
|---|---|
create_agent_card | 使用技能和端点创建与A2A兼容的代理卡 |
register_agent | 在本地A2A目录中注册代理 |
discover_agents | 按能力搜索代理 |
send_task | 按照A2A协议格式创建任务请求 |
get_task_status | 检查委派任务的状态 |
list_registered_agents | 列出所有具有功能的注册代理 |
安装
pip install a2a-protocol-mcp-server或与 uvx:
uvx a2a-protocol-mcp-server配置
克劳德桌面
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"a2a-protocol": {
"command": "uvx",
"args": ["a2a-protocol-mcp-server"]
}
}
}光标/风帆
{
"mcpServers": {
"a2a-protocol": {
"command": "uvx",
"args": ["a2a-protocol-mcp-server"]
}
}
}用法示例
1. Create an Agent Card for your agent:
create_agent_card("MyBot", "Translates text", ["translation", "german", "english"], "http://localhost:8000")
2. Register it:
register_agent()
3. Discover agents:
discover_agents("translation")
4. Send a task:
send_task("MyBot", "Translate 'Hello World' to German")
5. Check status:
get_task_status("")数据存储
代理卡和任务存储在本地 ~/.a2a-agents/:
agents.json--注册代理卡tasks.json--任务历史和状态
为什么选择A2A+MCP?
| MCP | A2A | |
|---|---|---|
| 目的 | 型号↔ 工具界面 | 代理↔ 代理接口 |
| 聚焦 | 工具访问、上下文 | 发现、委派 |
| 标准 | 人类学 | 谷歌→ Linux基金会 |
它们共同创建了一个完整的代理通信栈:MCP处理垂直(模型到工具),A2A处理水平(代理到代理)。
______________________________________________________________________
AiAgentKarl提供的更多MCP服务器
| 类别 | 服务器 |
|---|---|
| 🔗 区块链 | 索拉纳 |
许可证
麻省理工学院
