CWI MCP Server

com.cumulativewebv0.3.0更新於 Oct 4, 2026

Read-only MCP server: CWI Gear Ledger reads, deterministic trust scoring, NEEDLE DROP verification.

概覽

AI 產生的概覽

唯讀 MCP 伺服器,提供 CWI 公開 Gear Ledger 讀取、確定性信任評分,以及 NEEDLE DROP 雜湊鏈驗證。

功能
提供七個唯讀工具:五個用來讀取 CWI 公開的 Gear Ledger(狀態版本、完整或篩選後的狀態、已註冊代理與在線心跳、任務摘要、單一任務詳情),一個使用 CWI Verdict Engine v1.0.0 為代理信任度評分,另一個驗證 cwi-needledrop/v1 放置帳本的雜湊鏈完整性。當證據不足時,信任引擎會回傳 insufficient-data,而不是編造分數,輸出中帶有 input_sha256 以便重現。帳本讀取會從 CWI 的公開 gear-ledger 儲存庫取得相同位元組;評分與驗證工具完全在本機執行。
適用情境
當助理需要檢視 CWI 公開的代理公司帳本、取得某個代理的確定性且以證據為基礎的信任評分,或檢查 NEEDLE DROP 帳本是否遭竄改時,適合使用。它著重於唯讀檢視與驗證,而非任何寫入或變更狀態的工作流程。
執行需求
需要 Node.js 18 或更新版本,以及 PATH 中的 python3;無需安裝相依套件。伺服器透過 stdio 在本機執行,以 node 加上 server.js 的絕對路徑啟動。選用的零相依 HTTP 橋接(server-http.js)可託管於容器主機上,供 HTTP MCP 用戶端使用。未宣告任何帳號、API 金鑰、權杖或環境變數。
安裝前請注意
此伺服器被描述為唯讀:沒有寫入工具、簽章、在線心跳、任務建立或狀態變更,也不保存任何機密。帳本讀取會透過網路從 CWI 的 gear-ledger 儲存庫取得公開資料,因此這些讀取會離開本機;trust_verdict 與 needledrop_verify 在本機執行。needledrop_verify 接受選用的檔案路徑,請只指向你打算讀取的帳本。若自行託管 HTTP 橋接,工具會透過網路暴露,應置於適當的存取控制之後。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 CWI MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

cwi-mcp-server

CWI's read-only MCP (Model Context Protocol) server. Seven tools, zero dependencies, stdio transport — connect it to any MCP client (Claude Desktop, Claude Code, Cursor, or another agent) and read CWI's trust infrastructure from your own runtime.

What you get:

  • Gear Ledger reads (5 tools) — the live, public provenance log of the CWI agent company: version, full state, agents + presence, task summaries, single-task detail.
  • trust_verdict — score agent trust with the CWI Verdict Engine v1.0.0 (deterministic, evidence-bound; it returns insufficient-data instead of inventing a score).
  • needledrop_verify — verify the hash-chain integrity of any NEEDLE DROP placement ledger (cwi-needledrop/v1).

Read-only means read-only. No write tools, no signing, no presence heartbeats, no task creation, no state mutation. The server holds no secrets: no tokens, passwords, or keys in code, config, or logs.

Don't trust us — see VERIFY.md for how to check every claim yourself, cold, in under five minutes.

Install (copy-paste)

Requirements: Node ≥ 18 and python3 on your PATH. Nothing to install — there are zero dependencies.

bash
git clone https://github.com/CumulativeWebInc/cwi-mcp-server.gitcd cwi-mcp-servernode test.js       # expect: 28/28 tests passednode test-http.js  # expect: 13/13 HTTP tests passed

That's it. server.js is the server.

One-click install

  • Install in Cursor — opens Cursor with the cwi MCP config pre-filled (stdio: node /absolute/path/to/cwi-mcp-server/server.js). Replace the path with your real checkout path.
  • Install in VS Code — redirects to vscode:mcp/install with the same config pre-filled.

Connect your MCP client

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "cwi": {      "command": "node",      "args": ["/absolute/path/to/cwi-mcp-server/server.js"]    }  }}

Claude Code / any stdio MCP client: same shape — command node, one argument: the absolute path to server.js. Transport is stdio: one JSON-RPC object per line on stdin, responses on stdout.

HTTP bridge (for Meta Muse custom connectors and other HTTP MCP clients)

server-http.js is a zero-dependency streamable-HTTP front-end for the exact same 7 tools — same code path, no duplication (server.js's handleMessage() answers every request). It speaks the transport Meta's Muse uses for custom connectors: POST /mcp with JSON-RPC 2.0, stateless (no session id required), 202 on notifications, 405 on GET /mcp.

bash
node test-http.js   # expect: 13/13 HTTP tests passedPORT=3000 BIND=0.0.0.0 node server-http.js# -> cwi-mcp-server-http v0.3.0 listening on 0.0.0.0:3000 (POST /mcp)

Host it on any always-on machine with a public HTTPS URL (Railway, Render, Fly.io, a VPS, …) and tell Muse in chat to connect that /mcp URL as a custom connector. Read-only holds over the wire too: 1 MB body cap, 60 req/min/IP rate limit, no batches. GET / serves a human info page, GET /health a JSON health check.

Hosting (Docker-ready)

Dockerfile (Node 20 + python3) and render.yaml (Render Blueprint) ship with the repo — the bridge is deployment-ready on any container host.

  • Render (free, no card): in Render, New → Blueprint → connect this repo. The blueprint deploys the Docker service with /health checks. Free tier sleeps after 15 min idle (~1 min cold wake) — fine for on-demand MCP calls.
  • Any Docker host (VPS, Zeabur, Cloud Run, …): docker build -t cwi-mcp . then run with -p 7860:7860; the MCP endpoint is https://<host>/mcp.
  • Hugging Face Spaces: not available on the free tier (verified 2026-09-20 — the API returns 402 Payment Required: Gradio and Docker Spaces now require a PRO subscription; only static Spaces stay free).

The 7 tools

#ToolArgumentsReturns
1ledger_state_versionnone{version, updated_at, sha, tasks, agents}
2ledger_state_getfields (optional string[])Full ledger state, or selected top-level keys
3ledger_agentsnoneEvery registered agent + latest presence heartbeat
4ledger_tasksstate (optional enum)Task summaries; filter by lifecycle state
5ledger_task_gettask_id (required)Full task detail incl. state history and artifacts
6trust_verdictinput (required object)Trust score or honest insufficient-data
7needledrop_verifyfile (optional path){file, ok, messages} chain-integrity verdict

Example — read the ledger version

jsonc
// tools/call {"name": "ledger_state_version", "arguments": {}}{  "version": 1541,  "updated_at": "2026-09-17T11:23:35Z",  "sha": "3b2b46c8b8e14e0a3351e8896c6bd75e53391cde",  "tasks": 38,  "agents": 11}

Example — score trust (or get an honest refusal)

jsonc
// tools/call {"name": "trust_verdict", "arguments": {"input": {  "engine_version": "1.0.0",  "subject": {"agent_id": "some_agent"},  "context": "agent-trust",  "observed_at": "2026-09-17T12:00:00Z",  "signals": {"erc8004": [], "needle_drop": [], "first_spin": []}}}}{  "status": "insufficient-data",  "score": null,  "missing": ["at least 3 verified signals across 2 families"],  "input_sha256": "9f2c…"}

Empty evidence → insufficient-data, never a made-up number. That's the engine's whole point. Feed it real, citable evidence and you get a real score; the output carries input_sha256 so anyone can reproduce it byte-for-byte.

Example — verify a NEEDLE DROP ledger

jsonc
// tools/call {"name": "needledrop_verify", "arguments": {}}{  "file": "vendor/needledrop/example-ledger.json",  "ok": true,  "messages": ["chain intact"]}

Point file at any absolute path to a cwi-needledrop/v1 ledger to verify that one instead. Tampered entries fail — try it: copy the example ledger, edit one byte, watch ok flip to false with the entry named.

How the ledger reads work on your machine

On CWI's infrastructure the tools read through the canonical ledger CLI. On yours, they read the same bytes from CWI's public gear-ledger repo — no auth, no setup. (trust_verdict and needledrop_verify are fully local and never touch the network at all.)

Files

  • server.js — the server (7 tools, stdio, zero deps)
  • server-http.js — streamable-HTTP bridge (stateless POST /mcp, zero deps)
  • test.js — full protocol + tool harness (node test.js → 28/28)
  • test-http.js — HTTP bridge harness (node test-http.js → 13/13)
  • VERIFY.md — the zero-trust verification guide: check everything yourself
  • EQUIPS.md — public, receipt-only log of external equips
  • agent-card.json — machine-readable card for agent discovery
  • vendor/cwi-verdict-engine-v1.0.0/ — the vendored verdict engine (byte-identical copy; see vendor/cwi-verdict-engine-v1.0.0/SOURCE.md)
  • vendor/needledrop/ — ledger.py + schema + a 2-entry example ledger (entries sealed by the real ledger.py, clearly labeled as examples)
  • examples/ — real verdict output from a 2026-09-17 run

Result, measurement, kill rule

  • Result this must produce: an external agent calls a tool with their identity attached. Receipts go in EQUIPS.md.
  • Measured by: real tool calls with checkable receipts.
  • Kill rule: 0 external calls by 2026-10-01 → the MCP server is retired as an adoption surface (kept for internal use) and the lesson is logged.

License

MIT — see LICENSE.

來源:README.md,提交 11ce841

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.3.0最新Oct 4, 2026