接入路径

接入 Moras

这里既有 builder snippets,也有 merchant-agent workflow 示例。逐段复制即可;公开 discovery 面无需 API key。

还没安装或配置这些宿主?先看官方文档:

先选最适合你渠道的接法

大多数团队只需要先接一层。先选你已经在用的宿主或协议,复制第一段即可;只有在需要 merchant-side negotiation 时,再往更深的 workflow 走。

Skill 宿主

适合 Cursor、Claude Code 的技能目录。OpenClaw 与 Hermes 一起在「本地 Agent 宿主」分区,每张卡片最上面是先装宿主的一键命令。

打开 Skill 宿主

OpenAPI 应用

适合 ChatGPT 和 Gemini。贴一个 manifest URL,就能在托管工具体系里直接调用网关。

打开 OpenAPI 应用

MCP 宿主

适合 Codex 和 Claude Desktop。加一段 `mcpServers` 配置,就能把 Moras 当本地工具调用。

打开 MCP 配置

Hermes / A2A 客户端

Hermes 与 OpenClaw 同在「本地 Agent 宿主」分区。若只要裸 REST,装完宿主后可再翻到文末「Anything else」。

打开 Hermes / A2A 流程

通用入口

这一页所有渠道化指南,背后共用的都是下面这些入口。

https://a2a.moras.ai/openapi.json
https://a2a.moras.ai/.well-known/agent-card.json
https://a2a.moras.ai/skills/install.sh
https://a2a.moras.ai/v1

本地 Agent 宿主(OpenClaw · Hermes)

OpenClaw

一行 curl 把 Moras shop 技能丢进 OpenClaw。新会话即用。

协议
SKILL

可直接复制的片段

先安装 OpenClaw(一键)
来自 openclaw.ai 的官方安装脚本。若已能运行 `openclaw --version` 可跳过。
curl -fsSL https://openclaw.ai/install.sh | bash

# Already have Node 22+? Alternative:
# npm install -g openclaw@latest
安装技能(一行命令)
会把 SKILL.md 装到各 Agent 技能目录(含 OpenClaw / Cursor / Claude / Codex)。`curl … | bash` 在 fish、zsh、bash 下均可使用。
curl -fsSL https://a2a.moras.ai/skills/install.sh | bash
或手动复制技能文件
如果团队不允许把 curl 直接管道给 bash,把文件存到技能目录即可。
mkdir -p ~/.openclaw/skills/moras-shop && \
  curl -fsSL https://a2a.moras.ai/skills/moras-shop/SKILL.md \
  -o ~/.openclaw/skills/moras-shop/SKILL.md
验证可用
在 OpenClaw 里开一段新对话,试试下面的 prompt。第一次显式点名技能来强制激活;后续购物类 prompt 应该会自动触发。
use the moras-shop skill: recommend a small birthday gift for a 5 year old kid

Hermes

与 OpenClaw「丢一份 SKILL.md」不同,Hermes 走 A2A:用 Agent Card URL 把 Moras 登记为远程 Agent,再调 message/send 并在 metadata 里带 skill_id;若不想接 JSON-RPC,也可像普通 HTTP 客户端一样直接 GET /v1/recommend。

协议
A2ASSE

可直接复制的片段

先安装 Hermes Agent(一键)
NousResearch 官方一键脚本。若 `hermes --version` 已可用可跳过。Windows 请用 WSL2。
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
在 Hermes 里启用 Moras(不是装 SKILL 文件)
下面的 curl 用来验收协议。Hermes 侧请把「Agent Card URL」配成远程 A2A Agent 的发现地址(菜单位置以 NousResearch 文档为准),运行时就能读到 skill id;之后由你的编排/CLI 发与 curl 相同的 JSON-RPC。
1) Register — In Hermes (or your CrewAI / AutoGen / LangGraph setup), add the Agent Card URL below as the Moras agent discovery endpoint. Exact setting name is in NousResearch docs; it is not a file path like ~/.openclaw/skills/.

2) Discover — Hermes fetches the JSON; shopping uses skill_id "recommend_products" (see "skills" in that file).

3) Invoke — POST https://a2a.moras.ai/a2a with jsonrpc "message/send" and message.metadata.skill_id (example in the next block). For async tasks, poll SSE as in the final block.

Shortcut — Same gateway: GET https://a2a.moras.ai/v1/recommend?intent=...&channel=hermes (no JSON-RPC).
Agent Card URL(发现入口)
https://a2a.moras.ai/.well-known/agent-card.json
启动异步推荐任务(JSON-RPC 2.0)
它和 /v1/recommend 走的是同一条 recommend_products 主链路,只是通过 A2A task runtime 触发。
curl -X POST https://a2a.moras.ai/a2a \
  -H "Content-Type: application/json" \
  -H "X-Channel: hermes" \
  -d '{
    "jsonrpc":"2.0",
    "id":"req-1",
    "method":"message/send",
    "params":{
      "message":{
        "role":"user",
        "parts":[{"kind":"text","text":"recommend a small birthday gift for a 5 year old kid"}],
        "metadata":{"skill_id":"recommend_products","async":true,"limit":3}
      }
    }
  }'
通过 SSE 订阅 task 事件
把 TASK_ID 替换成 message/send 返回的 task id。
curl -N https://a2a.moras.ai/a2a/tasks/TASK_ID/events

Skill 宿主

Cursor

Cursor 从 ~/.cursor/skills 加载 Agent 技能。与 OpenClaw 使用同一行命令。

协议
SKILL

可直接复制的片段

安装技能
与 OpenClaw 区块相同的一键脚本,会写入所有已支持 Agent 的技能目录。
curl -fsSL https://a2a.moras.ai/skills/install.sh | bash
在对话框里试一下
> use the moras-shop skill — find me a portable blender

Claude Code

Claude Code 技能位于 ~/.claude/skills。相同安装脚本,目标目录不同。

协议
SKILL

可直接复制的片段

安装技能
与 OpenClaw 区块相同的一键脚本,会写入所有已支持 Agent 的技能目录。
curl -fsSL https://a2a.moras.ai/skills/install.sh | bash
试一下
recommend trending pet products on TikTok Shop

OpenAPI 应用

ChatGPT (Apps SDK / Custom GPT)

ChatGPT 直接吃 OpenAPI 3.0 manifest。把这个 URL 贴进 Custom GPT 或 Apps SDK 的配置即可。

协议
OPENAPIREST

可直接复制的片段

OpenAPI manifest URL
在 ChatGPT → Configure → Actions → Import from URL 里粘贴。
https://a2a.moras.ai/openapi.json
鉴权
无。/v1/* 全部开放接口。建议带上 X-Channel: chatgpt 用于归因。
Authentication type: None
建议的 system instructions
When the user asks for a product recommendation, gift idea, or "what should I buy",
call recommendProducts with the user's intent paraphrased into one short English line.
Return each card's cta.primary.url verbatim — never rewrite the buy link.

Gemini Extension

Gemini Extension / Gems 也支持 OpenAPI。同一个 manifest URL,无需鉴权。

协议
OPENAPIREST

可直接复制的片段

OpenAPI manifest URL
https://a2a.moras.ai/openapi.json
在 Gemini AI Studio 里测试
Tools → Function Calling → Import OpenAPI → 粘贴上面的 URL。
recommend a small birthday gift for a 5 year old

MCP 宿主

Codex / Claude Desktop (MCP)

Codex 和 Claude Desktop 可以把我们的 MCP 包装当作 stdio 子进程拉起。把下面这段加到 MCP 配置里。

协议
MCP

可直接复制的片段

mcpServers 配置项
加到 ~/.codex/config.json 或 claude_desktop_config.json 的 "mcpServers" 段。
{
  "mcpServers": {
    "moras-shop": {
      "command": "npx",
      "args": ["-y", "moras-a2a-mcp@latest"],
      "env": {
        "MORAS_A2A_BASE_URL": "https://a2a.moras.ai",
        "MORAS_A2A_CHANNEL": "codex"
      }
    }
  }
}
或者从克隆的仓库里直接跑
Use your own deployment path instead of a public clone URL.
cd /path/to/moras-A2A && npm install
MORAS_A2A_BASE_URL=https://a2a.moras.ai node bin/mcp.js

原生 Workflow

Anything else (raw REST)

可以直接调 REST:既覆盖买方 discovery,也覆盖商家侧的 exchange 对象。

协议
RESTA2A

可直接复制的片段

按意图推荐
curl 'https://a2a.moras.ai/v1/recommend?intent=birthday%20gift%20for%205%20year%20old&limit=3' \
  -H 'X-Channel: my-agent'
创建一等 Intent
curl -X POST https://a2a.moras.ai/v1/intents \
  -H 'Content-Type: application/json' \
  -H 'X-Channel: my-agent' \
  -d '{"raw_query":"birthday gift for a 5 year old","region":"US","audience":"parent","budget_range":{"max":35,"currency":"USD"}}'
注册 Merchant Agent(持久化 + token 保护)
保存返回的 registration_token;后续 heartbeat、更新和提交 proposal 都要用到它。
curl -X POST https://a2a.moras.ai/v1/merchant/register \
  -H 'Content-Type: application/json' \
  -H 'X-Channel: merchant-onboarding' \
  -d '{"merchant_id":"mch_demo","agent_endpoint":"https://example.com/webhook","subscription_tags":["outdoor"],"capabilities":["stock_check"],"regions":["US"]}'
提交 Merchant Proposal
需要携带注册时返回的 X-Merchant-Token。
curl -X POST https://a2a.moras.ai/v1/proposals \
  -H 'Content-Type: application/json' \
  -H 'X-Merchant-Token: mrt_xxx' \
  -d '{"merchant_agent_id":"mch_demo","intent_id":"int_xxx","product_id":"123456789","offer_title":"Trail-ready lantern bundle","price":29.99,"inventory_status":"in_stock","shipping_commitment":{"eta_days":3}}'
用 intent + proposals 创建 Match Session
curl -X POST https://a2a.moras.ai/v1/match \
  -H 'Content-Type: application/json' \
  -H 'X-Channel: my-agent' \
  -d '{"intent_id":"int_xxx","proposal_ids":["prp_xxx","prp_yyy"],"limit":3}'
接受 Proposal 并铸造 Match Token
curl -X POST https://a2a.moras.ai/v1/match/mch_xxx/accept \
  -H 'Content-Type: application/json' \
  -H 'X-Channel: my-agent' \
  -d '{"proposal_id":"prp_xxx"}'
按 id 获取 Match Token
curl https://a2a.moras.ai/v1/match-tokens/mtk_xxx
按 recId 查卡
curl https://a2a.moras.ai/v1/cards/rec_xxxxxxxx
获取达人 showcase
curl 'https://a2a.moras.ai/v1/creators/eva_creator/showcase?limit=6'
提示 — 带上 X-Channel 用于归因
给你的 Agent 起个短 slug 即可。带 channel-key 时配额 5 倍,不带也能正常用 1 倍。
X-Channel: <your-agent-slug>