pact-mcp
v0.10.0
Published
Pact MCP server — give any MCP-capable agent the tools to form, manage, and verify relationship bonds (thin client over a pactd daemon).
Readme
pact-mcp
An MCP server that gives any MCP-capable agent (Claude Code, etc.) the tools to form, manage, and verify relationship bonds.
It is a thin adapter over a running pactd daemon — the daemon holds the agent's key, relay config, and Lightning wallet; this server just exposes the daemon's operations as MCP tools. So the agent acts as that one sovereign pactd identity (same key, relays, and wallet your pact-stack already runs).
Prerequisite: a running pactd
# e.g. via pact-stack (docker compose) or directly:
node packages/pactd/dist/index.js # listens on 127.0.0.1:8787pact-mcp reaches it at PACT_DAEMON_URL (default http://127.0.0.1:8787). If the daemon uses PACT_TOKEN, set the same value for pact-mcp.
Tools
| Tool | Daemon call |
|---|---|
| pact_keygen | POST /identity — create the agent's did:nostr identity |
| pact_whoami | GET /identity |
| pact_form_bond | POST /bonds — declare/update + publish a bond |
| pact_list_bonds | GET /bonds — resolve + verify (by bond / counterparty / author) |
| pact_verify_bond | GET /bonds/verify — verify + mutual check (handles the 402 paid-verify flow via payment_hash) |
| pact_wallet | GET /wallet — Lightning wallet status + balance |
| pact_create_invoice | POST /wallet/invoice — create an invoice to receive sats |
| pact_lookup_invoice | GET /wallet/invoice — check if an invoice is paid |
| pact_pay_invoice | POST /wallet/pay — pay a bolt11 invoice (spends sats) |
| pact_list_transactions | GET /wallet/transactions — recent payments (reliable audit; reflects settlements) |
Install & register with Claude Code
Published on npm — no clone or build needed:
claude mcp add pact -- npx -y pact-mcp
# set env PACT_DAEMON_URL / PACT_TOKEN if the daemon isn't on the default localhost:8787Now Claude Code can form/verify bonds — acting as the pactd node's identity, using its relays and wallet.
If the MCP server shows "Connection closed" on first add: that's usually the first-run npx download exceeding the MCP startup timeout. Either warm it once (npx -y pact-mcp in a terminal → wait for pact-mcp: ready (stdio) → Ctrl-C, then reconnect), or install globally for an instant spawn:
npm i -g pact-mcp
claude mcp add pact -- pact-mcpRequires Node ≥ 18.
Status
Published: pact-mcp on npm. Depends only on @modelcontextprotocol/sdk + zod (no crypto here — that's the daemon). Pairs with pactd ≥ 0.1.
