402-mcp is a client that enables AI agents to discover, pay for, and consume payment-gated APIs without human registration or API keys. It supports multiple payment methods including Lightning and Cashu.
From the registry: AI agents discover, pay for, and consume any Lightning-gated API autonomously
Please install the `402-mcp` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install Node.js 18+** — Required to run the MCP server via npx. (https://nodejs.org)
Optional prerequisites:
- (Optional) Set up a Lightning/Cashu wallet — For autonomous payments configure a Nostr Wallet Connect URI or a Cashu token store; without these the agent falls back to human-in-the-loop QR code payment. (https://nwc.dev)
Canonical MCP server config (stdio transport):
- command: `npx`
- args: ["402-mcp"]
- optional environment variables:
- `NWC_URI`: Nostr Wallet Connect URI for autonomous Lightning payments. (example: `nostr+walletconnect://<pubkey>?relay=wss://<relay>&secret=<secret>`)
- `CASHU_TOKENS`: Path to the Cashu token store file. (example: `~/.402-mcp/cashu.json`)
- `MAX_AUTO_PAY_SATS`: Safety cap in sats; payments above this require human confirmation. (example: `1000`)
- `CREDENTIAL_STORE`: Path for persistent macaroon/credential storage (encrypted at rest). (example: `~/.402-mcp/credentials.json`)
- `TRANSPORT`: MCP transport mode: 'stdio' or 'http'. (example: `stdio`)
- `PORT`: HTTP server port when TRANSPORT=http. (example: `3402`)
- `TRANSPORT_PREFERENCE`: Comma-separated preference order for multi-URL services (e.g. onion,hns,https,http). (example: `onion,hns,https,http`)
- `TOR_PROXY`: SOCKS5 proxy for .onion addresses. (example: `socks5h://127.0.0.1:9050`)
- `SOCKS_PROXY`: Generic SOCKS5 proxy applied to all outbound requests. (example: `socks5h://127.0.0.1:1080`)
- `HNS_GATEWAY_URL`: HTTP gateway for Handshake (.hns) domains. (example: `https://hns.to`)
Note: Credentials are stored locally and encrypted at rest. Without a wallet configured, the agent can still discover services but paid calls will prompt for human QR approval.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.NWC_URIrequiredNostr Wallet Connect URI for autonomous Lightning paymentsCASHU_TOKENSrequiredPath to Cashu token store fileOpen-source SEC EDGAR toolkit — 11 tools, 7 prompts, every filing type. No API key required.
SEC filing intelligence — insider sentiment, material events, financial ratios, disclosure search.
MCP server for Stripe — global payments API (PaymentIntents, Checkout, Billing, Refunds)