
Agent Services Mcp
io.github.Gareth1953由 GitHub 帳號 Gareth1953 發布v0.2.1更新於 Oct 25, 2026
MCP server: x402-paid & free tools for AI agents — provenance, quality scoring, action audit.
概覽
一個本機 MCP 伺服器,把內容來源認證、內容品質評分與代理動作稽核三項遠端服務提供給助理,回傳 Ed25519 簽章收據。
- 可以做什麼
- 認證內容來源並驗證來源收據(驗證免費,認證付費)。依公開評分標準為內容評分並驗證評分收據,讀取評分標準。將代理動作記錄為防竄改稽核收據並加以驗證。付費工具在未提供付款權杖時回傳 x402 付款要求。
- 適用情境
- 當需要讓助理取得或核驗關於內容來源、依固定標準的品質分數、或代理聲稱執行之動作的簽章收據時使用。適合問責與稽核留痕,不適合事實查核或 AI 生成偵測。
- 執行需求
- 需要 Node.js 與 npm,使用前先建置。以本機 stdio 程序執行。選用環境變數 PROVENANCE_URL、QUALITY_GATE_URL、AUDIT_URL 指定服務位址,未設定時回退到 localhost。需要能連線這些服務的網路。付費工具需要 x402 付款權杖與已儲值錢包。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Agent Services Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
agent-services-mcp
A single thin MCP (Model Context Protocol) server that exposes three existing services as discoverable tools, so AI agents and MCP-compatible clients can find and use them through one connection:
- provenance-receipts — certifies content origin; returns an Ed25519-signed receipt.
- quality-gate — scores content quality against a published rubric; returns an Ed25519-signed score receipt.
- agent-action-audit — signs a tamper-evident audit receipt for an action an agent took (agent accountability); returns an Ed25519-signed audit receipt.
It is a thin wrapper. Every tool forwards an HTTP call to the underlying Worker and returns its response verbatim. It does not reimplement signing, scoring, or payment logic — those live in the underlying services. The honesty about what each service proves carries through to the tool descriptions.
Quickstart — your first (free) call in ~2 minutes
examples/free-call.mjs runs an MCP client against this server (pointed at the live
deployments) and calls get_quality_rubric and verify_audit — both free, no
wallet needed. To wire the server into an MCP client (Claude Desktop / Claude Code
style), see Connecting an MCP client below.
Free vs paid at a glance: verify_provenance, verify_quality, verify_audit,
and get_quality_rubric are free. certify_provenance, score_quality, and
audit_action are paid (an x402 USDC micropayment on Base) — see Calling paid
tools for the two-step payment flow and a working example.
What the wrapped services prove (and do not)
- Provenance: proves the content is unmodified (SHA-256 hash) and the receipt
was issued by the service's key. The
generator_metadatais caller-attested — it proves you claimed it, not that a specific model ran. Not AI-detection, not a truth guarantee. - Quality: a reproducible score against the published rubric (clarity,
completeness, internal consistency, obvious-error freedom). Not absolute
truth, not an external standard, not a fact-check. Read the rubric via
the
get_quality_rubrictool. - Audit: proves the action record is genuine (issued by the service's key)
and unaltered since issue (tamper-evident). The
action,actor_metadata, andcontextare caller-attested — it proves you claimed this record, not that the agent's claim is true. An accountability/audit tool, not a lie-detector.
Tools
Full descriptions and Zod input/output schemas: src/tools.ts.
Each tool returns the service's raw JSON (or markdown, for the rubric) as text; the
verify_* and score_quality tools also declare an outputSchema and return
parsed structuredContent you can read directly (e.g. result.structuredContent.valid).
A non-2xx response (including a 402 Payment Required) is surfaced with
isError: true and the body preserved — for a 402 the wrapper prepends a short,
actionable note on how to pay. The three paid tools also accept an optional
x_payment input (the x402 X-PAYMENT token) to settle payment through the
wrapper — see Calling paid tools.
Configuration
The three service URLs are environment-configurable (no secrets — just base URLs):
.env.example and the client config below point at the live deployments. If
the vars are unset, the server falls back to localhost for local wrangler dev
(the Workers default to :8787, so run quality-gate on :8788 and
agent-action-audit on :8789 to avoid clashes).
Against the live services, the paid tools (
certify_provenance,score_quality,audit_action) require x402 — this wrapper forwards the request and holds no wallet, so without anX-PAYMENTthey return a402(the payment requirements) surfaced asisError. The free tools work as normal.
Calling paid tools (x402)
The three paid tools require an x402 micropayment (USDC on Base mainnet). The wrapper holds no wallet — it never spends on your behalf — so paying is a two-step flow:
- Call the tool with no
x_payment. You get back a402whose body is the x402 payment requirements (network, asset, amount,payTo). The wrapper prepends a one-line note explaining what to do next. - Build an x402
X-PAYMENTtoken from those requirements with an x402 client + a funded wallet, then call the tool again with that token in thex_paymentinput. The wrapper forwards it as theX-PAYMENTheader; the underlying service verifies, settles, and returns the signed receipt.
Easiest path to a working paid call — let an x402 client settle for you against the underlying service directly:
examples/paid-call.mjs uses x402-fetch + a throwaway Base-mainnet wallet
(holding a little real USDC) to pay for and call audit_action. ~$0.01 USDC moves
buyer → the service's payTo, gasless (the facilitator pays gas). Real money — use
a disposable key with a few cents only. The same applies to certify_provenance
and score_quality.
Quickstart (local)
scripts/test-client.mjs exercises the free tools locally; scripts/test-score.mjs
makes one real Anthropic scoring call through score_quality;
scripts/test-live.mjs points the wrapper at the deployed workers.dev URLs and
asserts the free tools work and the paid tools forward the x402 402.
Connecting an MCP client (stdio)
This server speaks MCP over stdio (stdin/stdout). Any MCP client launches it
as a subprocess. Example for a Claude Desktop / Claude Code style
mcpServers config:
- Run
npm run buildfirst sodist/index.jsexists. - The client connects, calls
tools/list(it will see the 7 tools above), and invokes them viatools/call. - The underlying services must be reachable at the configured URLs when a tool is called.
- Logs go to stderr; stdout is reserved for the MCP protocol.
Programmatically, connect with the SDK's Client + StdioClientTransport
(command: "node", args: ["dist/index.js"]) — see scripts/test-client.mjs.
x402 payments (forwarded, not handled here)
The paid endpoints (/v1/certify, /v1/score, /v1/audit) are gated by
x402 on the underlying services. This wrapper
forwards requests and does not hold a wallet. If a service has payments
enabled and no valid X-PAYMENT is supplied, it returns 402 with the payment
requirements — the wrapper surfaces that as isError with the requirements body
intact. Settling a payment (signing an x402 authorization) is the client's
responsibility against the underlying service. See each service's README.md /
docs/API.md for the x402 details. Base Sepolia testnet only — no mainnet.
Verifying receipts independently
The receipts returned by certify_provenance, score_quality, and audit_action
are Ed25519-signed and verifiable without trusting any of these services —
re-hash the content/record and check the signature against the service's public
key. Each service ships a runnable independent verifier and recipe: see
provenance-receipts/docs/VERIFYING.md,
quality-gate/docs/VERIFYING.md,
and agent-action-audit's docs/VERIFYING.md.
Build status
- Step 1 — skeleton + tool definitions (
src/tools.ts) - Step 2 — tool handlers (HTTP forwarding) + local smoke test
- Step 3 — README: what it is, the tools, and how an MCP client connects
- Live — pointed at the deployed services (
*.gpmiddleton71.workers.dev) and verified end-to-end viascripts/test-live.mjs: free tools work; paid tools forward the x402402.
All seven tool paths verified against the live deployments (including one paid
score_quality call end-to-end through the wrapper); the paid tools
(certify_provenance, score_quality, audit_action) forward the x402 402.
Stack
- Official MCP SDK:
@modelcontextprotocol/sdkv1.29.0 (TypeScript), stdio transport,zodinput schemas. - Node ESM + TypeScript (
tsc→dist/).
Project layout
來源:README.md,提交 3093987
工具
0版本歷史
1- v0.2.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分