PDDUNPDDUN · 开发者网关 开发者中心首页
← 返回上一页 前端托管已上线

A2A Agent Card 与 MCP 接入示例

本页说明其他AI智能体如何通过开放标准发现并调用“墩墩AI店长”能力。A2A负责智能体与智能体协作,MCP负责智能体与工具/数据连接,二者互补。

1. Agent Card(能力名片,已托管)

标准 A2A Agent Card 已静态托管于 https://pddun.net/.well-known/agent.json,任何智能体均可拉取以发现能力:

{
  "protocolVersion": "0.2.0",
  "name": "墩墩AI店长",
  "description": "提供门店AI方案、县域赋能官政策、智能体目录查询",
  "url": "https://pddun.net/mcp",
  "capabilities": {
    "streaming": false,
    "pushNotifications": false
  },
  "skills": [
    {
      "id": "query_store_ai",
      "name": "查询门店AI方案",
      "examples": [
        "餐饮店AI方案",
        "门店AI多少钱"
      ]
    },
    {
      "id": "get_county_policy",
      "name": "查询县域赋能官政策",
      "examples": [
        "县域赋能官怎么加盟"
      ]
    },
    {
      "id": "list_agents",
      "name": "列出智能体目录",
      "examples": [
        "有哪些客服智能体"
      ]
    }
  ]
}

拉取命令:curl https://pddun.net/.well-known/agent.json

2. MCP 工具定义(get_county_policy)

县域赋能官政策查询工具的输入契约如下(后端 MCP Server 实现后即可被标准客户端调用):

{
  "name": "get_county_policy",
  "description": "返回墩墩县域赋能官加盟政策与分润",
  "inputSchema": {
    "type": "object",
    "properties": {
      "county_level": {
        "type": "string",
        "enum": [
          "百强县",
          "普通县",
          "乡镇"
        ]
      }
    },
    "required": [
      "county_level"
    ]
  }
}

3. 前端调用示例(fetch)

// 发现能力
const card = await fetch('https://pddun.net/.well-known/agent.json').then(r=>r.json());
console.log(card.skills);

// 调用 MCP 工具(需 /mcp 后端上线)
const res = await fetch('https://pddun.net/mcp', {
  method:'POST', headers:{'Content-Type':'application/json'},
  body: JSON.stringify({{ jsonrpc:'2.0', id:1, method:'tools/call',
    params:{{ name:'get_county_policy', arguments:{{ county_level:'普通县' }} }} }})
});
console.log(await res.json());

4. 上线状态(如实说明)

交付项状态责任方
Agent Card 静态托管 /.well-known/agent.json已上线可访问前端
本接入示例页已上线前端
MCP Server /mcp 握手与真实数据后端开发中,暂不可握手后端 @华道

说明:在 /mcp 后端上线前,Agent Card 仅作能力声明与发现,技能调用尚不能返回真实数据;后端完成并通过标准客户端握手验证后,此处状态将更新。参考:A2A官方 · MCP官方

集团站点与备案信息

共 11 个站点 · 每个备案号均可点击前往工信部核验中枢管理后台 →
智能体互联
pddun.net本站 智能体 API 网关
粤ICP备2025499756号-12 公安备案中
集团生态