Token导航 LogoToken导航TokenDH.com
A2A MCP Server logo
运维云端未说明官方级别未说明来源级核验

A2A MCP Server

MCP Server

一个实现A2A协议的MCP服务器,用于连接和向A2A服务器发送消息。

工具数

6

提示词数

0

GitHub Stars

13

资源数

0
PythonClaude云端部署Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

a2anet

提供方

a2anet

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

A2A MCP服务器

MCP服务器 实现了一个 A2A客户端 为了 A2A协议. 服务器可用于连接A2A服务器(远程代理)并向其发送消息。

服务器需要用一个或多个初始化 代理卡 URL,每个URL都可以有用于身份验证、配置等的自定义标头。

所有代理(名称和描述)都可以通过以下方式查看 get_agents 工具,可以使用查看代理的技能(名称和描述) get_agent 工具,消息可以通过以下方式发送给代理 send_message 工具,可以使用轮询长时间运行的任务 get_task,以及 人工制品 可以通过以下方式查看 view_text_artifactview_data_artifact 工具。

✨ 特性

  • 6个MCP工具get_agents, get_agent, send_message, get_task, view_text_artifact,以及 view_data_artifact 用于与A2A代理通信
  • 简单消息发送 --通过ID向任何A2A代理发送消息;代理卡提取、标头和非阻塞流式传输都是自动处理的
  • 多回合对话 --使用以下命令跨多条消息继续对话 context_id
  • 长期运行任务支持 --如果 send_message 超时,使用 get_task 监视任务,直到它达到终端状态
  • 自动伪影最小化 --LLM上下文窗口的大型文本和数据工件会自动最小化,并使用专用工具进行详细导航
  • 任务和文件存储 --任务和文件工件保存在本地 ~/.a2a-mcp/ 默认情况下
  • 自定义标头和身份验证 -为API密钥和其他凭据配置per-agent自定义标头
  • 可配置的超时和限制 --通过环境变量自定义超时、轮询间隔和字符限制

📋 需求

要运行服务器,如果还没有安装uv,则需要安装uv。

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

窗户:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

🚀 快速开始

  1. 下载 Claude桌面版
  2. 将以下内容添加到您的Claude Desktop配置中(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
  "mcpServers": {
    "a2a": {
      "command": "uvx",
      "args": ["a2anet-mcp"],
      "env": {
        "A2A_MCP_AGENT_CARDS": "{\"tweet-search\": {\"url\": \"https://example.com/.well-known/agent-card.json\"}}"
      }
    }
  }
}
提示: 如果您没有代理卡URL,请参阅: A2A网络演示

⚙️ 配置

所有配置都是通过前缀为的环境变量进行的 A2A_MCP_.

A2A_MCP_AGENT_CARDS (必填)

JSON对象将代理ID映射到其配置。每个代理都必须有一个 url 带有代理卡完整路径的密钥。它可以选择具有 custom_headers 表单中带有对象的键 {"header": "value"}:

export A2A_MCP_AGENT_CARDS='{
  "tweet-search": {
    "url": "https://example.com/.well-known/agent-card.json",
    "custom_headers": {"X-API-Key": "your-key"}
  }
}'

可选设置

环境变量默认值描述
A2A_MCP_TASK_STOREtrue通过以下方式实现任务持久性 JSONTaskStore
A2A_MCP_FILE_STOREtrue通过以下方式启用文件工件存储 LocalFileStore
A2A_MCP_SEND_MESSAGE_CHARACTER_LIMIT50000伪影最小化的字符限制 send_message
A2A_MCP_MINIMIZED_OBJECT_STRING_LENGTH5000最小化对象时的最大字符串长度
A2A_MCP_VIEW_ARTIFACT_CHARACTER_LIMIT50000字符限制 view_text_artifact / view_data_artifact
A2A_MCP_AGENT_CARD_TIMEOUT15提取代理卡的超时时间(秒)
A2A_MCP_SEND_MESSAGE_TIMEOUT60超时时间(秒) send_message
A2A_MCP_GET_TASK_TIMEOUT60超时时间(秒) get_task
A2A_MCP_GET_TASK_POLL_INTERVAL5间隔(秒) get_task 民意调查

🛠️ 工具

get_agents

获取所有代理名称和描述。

get_agent

获取代理的名称、描述以及技能名称和描述。

参数必填说明
agent_id代理ID

send_message

向代理发送消息。

参数必填说明
agent_id来自的代理ID get_agents
message您的消息或请求
context_id继续现有对话
task_idinput_required流的任务ID
timeout覆盖HTTP超时(秒)

get_task

获取任务的当前状态。监控直到终端/可操作状态或超时。超时时,返回当前任务状态(可能仍然是非终端状态)。

参数必填说明
agent_id拥有该任务的代理ID
task_id以前的任务ID send_message
timeout覆盖监控超时(秒)
poll_interval覆盖轮询之间的间隔(秒)

view_text_artifact

通过可选的行或字符范围选择查看工件中的文本内容。

参数必填说明
agent_id生成工件的代理ID
task_id包含工件的任务ID
artifact_id要查看的工件
line_start起始行号(从1开始,包括1)
line_end结束行号(从1开始,含1)
character_start起始字符索引(从0开始)
character_end结束字符索引(从0开始)

view_data_artifact

通过可选的过滤从工件中查看结构化数据。

参数必填说明
agent_id生成工件的代理ID
task_id包含工件的任务ID
artifact_id要查看的工件
json_path提取特定字段的点分隔路径
rows行选择(索引、列表、范围字符串或“全部”)
columns列选择(名称、列表或“全部”)

📖 例子

列表代理

get_agents({})
{
  "tweet-search": {
    "name": "Tweet Search",
    "description": "Find and analyze tweets by keyword, URL, author, list, or thread. Filter by language, media type, engagement, date range, or location. Get a clean table of tweets with authors, links, media, and counts; then refine the table and generate new columns with AI."
  }
}

获取代理详细信息

get_agent({
  "agent_id": "tweet-search"
})
{
  "name": "Tweet Search",
  "description": "Find and analyze tweets by keyword, URL, author, list, or thread. Filter by language, media type, engagement, date range, or location. Get a clean table of tweets with authors, links, media, and counts; then refine the table and generate new columns with AI.",
  "skills": [
    {
      "name": "Search Tweets",
      "description": "Search X by keywords, URLs, handles, or conversation IDs. Filter by engagement (retweets/favorites/replies), dates, language, location, media type (images/videos/quotes), user verification status, and author/reply/mention relationships. Sort by Top or Latest. Return 1-10,000 results."
    },
    ...,
    {
      "name": "Generate Table",
      "description": "Generate a new table from any table with AI. Explain what table you want to generate from, what columns you want to keep, and what new columns you want to generate."
    }
  ]
}

发送消息

send_message({
  "agent_id": "tweet-search",
  "message": "Find tweets about AI from today (January 12, 2026)"
})
{
  "id": "tsk-123",
  "context_id": "ctx-123",
  "kind": "task",
  "status": {
    "state": "completed",
    "message": {
      "context_id": "ctx-123",
      "kind": "message",
      "parts": [
        {
          "kind": "text",
          "text": "I found 10 tweets about \"AI\" posted on January 12, 2026. The search parameters used were:\n\n- Search Terms: AI\n- Start Date: 2026-01-12\n- End Date: 2026-01-13\n- Maximum Items: 10\n\nWould you like to see more tweets, or do you want a summary or analysis of these results?"
        }
      ]
    }
  },
  "artifacts": [
    {
      "artifact_id": "art-123",
      "description": "Tweets about AI posted on January 12, 2026.",
      "name": "AI Tweets from January 12, 2026",
      "parts": [
        {
          "kind": "data",
          "data": {
            "records": {
              "_total_rows": 10,
              "_columns": [
                {
                  "count": 1,
                  "unique_count": 1,
                  "types": [
                    {
                      "name": "int",
                      "count": 1,
                      "percentage": 100.0,
                      "sample_value": 213,
                      "minimum": 213,
                      "maximum": 213,
                      "average": 213
                    }
                  ],
                  "name": "quote.author.mediaCount"
                },
                ...,
                {
                  "count": 10,
                  "unique_count": 1,
                  "types": [
                    {
                      "name": "bool",
                      "count": 10,
                      "percentage": 100.0,
                      "sample_value": false
                    }
                  ],
                  "name": "isPinned"
                }
              ]
            },
            "_tip": "Data was minimized. Call view_data_artifact() to navigate to specific data."
          }
        }
      ]
    }
  ]
}

处理长时间运行的任务

如果远程代理需要的时间超过 A2A_MCP_SEND_MESSAGE_TIMEOUT (默认值:60秒), send_message 返回当前状态的任务:

send_message({
  "agent_id": "tweet-search",
  "message": "Find tweets about AI from today (January 12, 2026)"
})
{
  "id": "tsk-123",
  "context_id": "ctx-123",
  "kind": "task",
  "status": {
    "state": "working",
    "message": null
  },
  "artifacts": []
}

使用 get_task 检查进度:

get_task({
  "agent_id": "tweet-search",
  "task_id": "tsk-123"
})

完成后,响应将与中显示的格式匹配 发送消息。如果仍在工作,请致电 get_task 再次继续监测。

多回合对话

使用 context_id 要继续对话,请执行以下操作:

send_message({
  "agent_id": "tweet-search",
  "message": "Can you summarize each of the 10 tweets in the table in 3-5 words each? Just give me a simple list with the author name and summary.",
  "context_id": "ctx-123"
})
{
  "id": "tsk-456",
  "context_id": "ctx-123",
  "kind": "task",
  "status": {
    "state": "completed",
    "message": {
      "context_id": "ctx-123",
      "kind": "message",
      "parts": [
        {
          "kind": "text",
          "text": "Here is a simple list of each tweet's author and a 3-5 word summary:\n\n1. alienofeth – Real-time STT intent detection\n2. UnderdogEth_ – AI ownership discussion thread\n3. Count_Down_000 – Learning new vocabulary word\n4. ThaJonseBoy – AI and market predictions\n5. Evelyn852422353 – AI model comparison debate\n6. SyrilTchouta – Language learning with AI\n7. cx. – AI in marketing insights\n8. Halosznn_ – Graphic design course shared\n9. xmaquina – AI smarter models discussion\n10. Flagm8_ – AI and business strategy\n\nLet me know if you want more details or a different format!"
        }
      ]
    }
  },
  "artifacts": [
    {
      "artifact_id": "art-456",
      "description": "A simple list of each tweet's author and a 3-5 word summary of the tweet content.",
      "name": "AI Tweet Summaries 3-5 Words",
      "parts": [
        {
          "kind": "data",
          "data": {
            "records": [
              {
                "author.userName": "ai_q2_",
                "summary": "Possibly understand"
              },
              ...,
              {
                "author.userName": "CallStackTech",
                "summary": "Real-time STT intent detection"
              }
            ]
          }
        }
      ]
    }
  ]
}

查看数据工件

view_data_artifact({
  "agent_id": "tweet-search",
  "task_id": "tsk-123",
  "artifact_id": "art-123",
  "json_path": "records",
  "rows": "all",
  "columns": ["author.userName", "text"]
})
{
  "artifact_id": "art-123",
  "description": "Tweets about AI posted on January 12, 2026.",
  "name": "AI Tweets from January 12, 2026",
  "parts": [
    {
      "kind": "data",
      "data": [
        {
          "author.userName": "ai_q2_",
          "text": "@nyank_x わかるかもしれない"
        },
        ...,
        {
          "author.userName": "CallStackTech",
          "text": "Just built a real-time STT pipeline that detects intent faster than you can say \"Hello!\" 🎤✨ Discover how I used Deepgram to achieve su...\n\n🔗 https://t.co/dgbvdlATZ0\n\n#VoiceAI #AI #BuildInPublic"
        }
      ]
    }
  ]
}

💾 数据存储

任务和文件工件在本地持久化 ~/.a2a-mcp/:

  • 任务: ~/.a2a-mcp/tasks/
  • 文件: ~/.a2a-mcp/files/

两者都可以通过环境变量禁用(A2A_MCP_TASK_STORE=false, A2A_MCP_FILE_STORE=false).

🔧 发展

Claude桌面设置

对于当地发展:

  1. 克隆存储库: git clone https://github.com/a2anet/a2a-mcp.git
  2. 下载 Claude桌面版.
  3. 添加到下面的Claude Desktop配置中(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
  "mcpServers": {
    "a2a": {
      "command": "uv",
      "args": ["--directory", "/path/to/a2a-mcp", "run", "a2anet-mcp"],
      "env": {
        "A2A_MCP_AGENT_CARDS": "{\"tweet-search\": {\"url\": \"https://example.com/.well-known/agent-card.json\"}}"
      }
    }
  }
}

📄 许可证

a2anet 根据《 阿帕奇-2.0 许可证。

🤝 加入A2A网络社区

A2A-Net是一个寻找和分享人工智能代理和开源社区的网站。加入我们,分享您的A2A代理,提出问题,了解最新的A2A新闻,成为第一个了解开源版本、教程等的人!

目录标签

目录标签

PythonClaude云端部署A2A协议本地部署MCP服务器消息传递任务管理多轮对话

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP