For contributors

Working on wallet-mcp-server itself.

This page is for people working on wallet-mcp-server itself, not for installing it — see Install for that.

Architecture

At startup it fetches PolyPay's public catalog (GET /v1/catalog on agent-rail, no account needed), opens one auto-paying MCP connection per provider via @x402/mcp's x402MCPClient (handles the HTTP 402 → pay → retry flow on its own — see src/xrpl-payment-client.ts for everything XRPL-specific: signing, spend limits, RLUSD trust lines), and re-exposes all of it over its own stdio MCP server as exactly two fixed tools — polymitapay_search and polymitapay_call (see src/server.ts).

Installing into a specific MCP client (Claude Code, Claude Desktop, more later) is handled by one small file per host under src/client-targets/, each implementing the same ClientTarget interface (isPresent/isConfigured/optional install/optional manualInstructions — see src/client-targets/types.ts). Adding a new client means adding a file there, not touching src/setup-wizard.ts itself.

Local development

npm install
cp .env.example .env   # fill in POLYPAY_WALLET_SEED yourself
npm run dev             # tsx --env-file=.env src/index.ts (dev only)
npm run build            # tsc -> dist/

To exercise the interactive setup wizard itself (rather than the plain server) while developing, temporarily comment out POLYPAY_WALLET_SEED in .env and run npm run dev in a real terminal — it only triggers when there's no seed and stdin/stdout are both a TTY.