Skip to content

feat(mcp): run every Peer Cash tool on @zkp2p/sdk 0.16.0-rc.2 and drop @zkp2p/cash - #49

Merged
ADWilkinson merged 3 commits into
mainfrom
kohai/peer-sdk-rc2-tools
Nov 23, 2026
Merged

ADWilkinson merged 3 commits into
mainfrom
kohai/peer-sdk-rc2-tools

Conversation

@kohai-peer

@kohai-peer kohai-peer commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Created by @kohai-peer at the request of @ADWilkinson.

Summary

Every peer_cash_* MCP tool now runs on @zkp2p/sdk 0.16.0-rc.2, and @zkp2p/cash is removed from the CLI. Every tool name keeps working.

@zkp2p/sdk@0.16.0-rc.2 is published on rc (from zkp2p-clients 88bcfc62); package-lock.json locks it from the registry and no longer contains @zkp2p/cash.

Tools, before and after

All 14 cash-profile tools are registered on both sides, with the same names, the same write gating, and the same inputs except where noted. The generated agents/runtime-manifest.json and agents/tool-catalog.json are unchanged.

Tool Before (main) After
peer_cash_capabilities, peer_cash_fill_stats, peer_cash_estimate, peer_cash_finalize, peer_cash_buyer, peer_cash_order, peer_cash_orders, peer_cash_prepare, peer_cash_prepare_withdraw, peer_cash_prepare_top_up @zkp2p/sdk peer.sell (rc.1) @zkp2p/sdk peer.sell (rc.2), unchanged
peer_cash_source_capabilities @zkp2p/cash 0.7.0 sourceCapabilities() peer.sell.sourceCapabilities()
peer_cash_quote_source @zkp2p/cash 0.7.0 quoteSource() peer.sell.quoteSource()
peer_cash_relay_status @zkp2p/cash 0.7.0 relayStatus() peer.sell.relayStatus()
peer_cash_prepare_access_policy @zkp2p/cash 0.7.0 prepareAccessPolicy(): an unsigned transaction configuring a retired merchant group Same name and inputs. Returns { accessPolicyRequired: false, transaction: null, reason } with nothing to sign. Its description says why. Still a write-profile tool, now annotated read-only.

Other changes

  • PEER_CASH_RELAY_API_KEY (or config.relayApiKey) is passed to the SDK as relay.apiKey. Relay's quote endpoint now requires an API key; without one, peer_cash_quote_source returns RELAY_API_KEY_REQUIRED (retryable: false) naming the env var, instead of a retryable Relay failure. An injected client skips that check.
  • The hosted server's deploy/runtime.cjs accepts PEER_CASH_RELAY_API_KEY as an optional string key (redacted from logs); NODE_ENV stays required. Setting it in the mcp Infisical project is a separate step.
  • peer_cash_source_capabilities reports source: "relay" (Cash said "relay-sdk"). The CHANGELOG records that and the access-policy result change.
  • PeerCashMcpConfig.cashOnlyClient / PeerCashOnlyClient are removed (never released). The SDK client covers every tool.
  • tsup.config.ts no longer bundles @zkp2p/cash.
  • Docs: README, llms.txt, AGENTS.md, skills/peer-cash/SKILL.md and the Unreleased CHANGELOG entry describe the single SDK client and the retired access-policy step. The notes about published 0.4.1 behaviour are kept.

Verification

  • npm ci from the regenerated lockfile, then npm run check (lint, typecheck, 265 tests with coverage, build) against the published @zkp2p/sdk@0.16.0-rc.2.

    • New tests: the access-policy answer (no client call, read-only annotation, description); the source tools on the SDK client; the Relay key passthrough with and without the env var.
  • Live smoke of the MCP handlers on production with a Relay key:

    • peer_cash_source_capabilities: 49 chains, source: "relay";
    • peer_cash_quote_source: 5 USDC Optimism → Base USDC, 2 transactions, request id;
    • peer_cash_relay_status: waiting;
    • peer_cash_prepare_access_policy: accessPolicyRequired: false, no transaction.

    All 14 tools registered. Without the key, quote_source returns RELAY_API_KEY_REQUIRED, retryable: false.

  • CI: see the checks on this head.

🤖 Generated with Claude Code

kohai-peer and others added 3 commits November 23, 2026 15:29
…p @zkp2p/cash

- peer_cash_source_capabilities, peer_cash_quote_source and
  peer_cash_relay_status now call peer.sell.sourceCapabilities(),
  quoteSource() and relayStatus() from the SDK.
- peer_cash_prepare_access_policy stays registered with the same inputs and
  answers accessPolicyRequired: false with no transaction; its description
  says the merchant group it configured was retired in @zkp2p/sdk 0.15.
- PEER_CASH_RELAY_API_KEY (or config.relayApiKey) reaches the SDK's Relay
  client: Relay's quote endpoint now requires a key.
- @zkp2p/cash leaves package.json and the bundle; every tool name stays.

The lockfile is regenerated once @zkp2p/sdk 0.16.0-rc.2 is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ake it

- peer_cash_quote_source without a Relay key returns RELAY_API_KEY_REQUIRED
  (retryable: false) naming PEER_CASH_RELAY_API_KEY, instead of a retryable
  Relay failure an agent would repeat. An injected client skips the check.
- deploy/runtime.cjs accepts PEER_CASH_RELAY_API_KEY as an optional string
  key (redacted from logs like other values); NODE_ENV stays required.
- CHANGELOG notes the access-policy result shape and the 'relay' source label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ADWilkinson
ADWilkinson marked this pull request as ready for review November 23, 2026 16:19

@ADWilkinson ADWilkinson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 4355e12 on Davy's re-review.

@ADWilkinson
ADWilkinson merged commit 2fd981a into main Nov 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants