forgesworn avatar

402 Mcp

forgesworn/402-mcp

Gives Claude the ability to pay for and consume Lightning-gated APIs autonomously. It discovers services via Nostr (kind 31402 events), probes endpoints for pricing without paying, then auto-pays invoices using NWC or Cashu if under your configured budget cap. Credentials are cached locally and encrypted. Works with any L402-compliant server including toll-booth and Aperture. The agent can browse volume discount tiers, reason about cost versus usage, and make purchasing decisions within your spend limits. Supports onion routing and Handshake domains with fallback. Useful when you want Claude to consume paid data APIs, routing services, or AI inference endpoints without manual API key management or per-service registration.

tools
14
auth
Secret needed
transport
STDIO
env vars
2
last updated
Apr 7, 2026

Tools

14 tools

Public tool metadata for what this MCP can expose to an agent.

l402-configIntrospect payment capabilities (wallets, limits, credential count)

Introspect payment capabilities (wallets, limits, credential count)

No parameter schema in public metadata yet.

l402-discoverProbe an endpoint to discover pricing without paying

Probe an endpoint to discover pricing without paying

No parameter schema in public metadata yet.

l402-fetch-previewShow what an endpoint costs without paying; drives the payment confirmation widget

Show what an endpoint costs without paying; drives the payment confirmation widget

No parameter schema in public metadata yet.

l402-fetchHTTP request that pays a 402 challenge when autoPay is set and the price is within the limits

HTTP request that pays a 402 challenge when autoPay is set and the price is within the limits

No parameter schema in public metadata yet.

l402-payPay a challenge returned by l402-fetch or l402-discover, by its payment hash. Any other invoice needs the human's approval

Pay a challenge returned by l402-fetch or l402-discover, by its payment hash. Any other invoice needs the human's approval

No parameter schema in public metadata yet.

l402-reconcileList or resolve payments whose outcome is unknown; auto-pay to that service is paused until they are resolved

List or resolve payments whose outcome is unknown; auto-pay to that service is paused until they are resolved

No parameter schema in public metadata yet.

l402-credentialsList stored credentials and cached balances

List stored credentials and cached balances

No parameter schema in public metadata yet.

l402-balanceCheck cached credit balance for a server

Check cached credit balance for a server

No parameter schema in public metadata yet.

l402-searchDiscover L402 services on Nostr relays (kind 31402 announcements)

Discover L402 services on Nostr relays (kind 31402 announcements)

No parameter schema in public metadata yet.

l402-store-tokenStore an L402 token obtained from a payment page

Store an L402 token obtained from a payment page

No parameter schema in public metadata yet.

l402-service-directoryInteractive, searchable directory of services found by l402-search

Interactive, searchable directory of services found by l402-search

No parameter schema in public metadata yet.

l402-wallet-dashboardInteractive view of wallet status, limits and stored credentials

Interactive view of wallet status, limits and stored credentials

No parameter schema in public metadata yet.

l402-buy-creditsBrowse and purchase volume discount tiers

Browse and purchase volume discount tiers

No parameter schema in public metadata yet.

l402-redeem-cashuRedeem Cashu tokens directly (avoids Lightning round-trip)

Redeem Cashu tokens directly (avoids Lightning round-trip)

No parameter schema in public metadata yet.

Sponsors

Configuration

NWC_URIsecret

Nostr Wallet Connect URI for autonomous Lightning payments

MAX_AUTO_PAY_SATS

Maximum sats to auto-pay per request

Readme

402-mcp

Nostr: npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2

MIT licence TypeScript Node Statement coverage 90%, measured with npm run test:coverage Nostr GitHub Sponsors

L402 client MCP that gives AI agents economic agency. Discover, pay for, and consume Lightning and ecash payment-gated APIs within limits you set: no human registration, no API keys, no middlemen.


View the full README on GitHub

Details

Repository
github.com/forgesworn/402-mcp
Package
402-mcp
Transport
STDIO
Auth
Required
Registry
MCP registry, active

More from forgesworn