Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Transports: stdio vs HTTP
  • State of MCP (stats)
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI β†’ MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE β†— (opens in a new tab)
  • llms.txt β†— (opens in a new tab)
  • Catalog JSON β†— (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub β†— (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
Β© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. πŸ’» Developer Tools
  3. 402 MCP
402 MCP logo
Health: ActiveRecent health check succeeded.Last checked 9/22/2026, 7:31:54 AM

402 MCP

User RatingsBe the first to rate and review this MCP server! Enrichment pendingWe haven’t run our AI enrichment pass on this listing yet, so the overview, use cases, and FAQ below may be sparse or missing. We work through the catalog over time β€” check back soon.
View RepositoryVisit Website

AI agents discover, pay for, and consume any Lightning-gated API autonomously

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β€” or use 1-click editor setup below.

Add to CursorAdd to VS Code
Not yet automatically verified

We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β€” we're steadily working through the catalog.

Manual Client & Custom JSON ConfigExpand JSON β–Ύ

Client Config & Setup

Choose your client or environment
Target File:~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "402-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "402-mcp"
      ]
    }
  }
}

πŸ’‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.

Install Tool Schemas (10) Directory Badge Claim listing AlternativesπŸ’» More in Developer Tools

Capabilities & Tool Schemas (10) ~165 tokensApproximate context cost of this server’s tool schemas (~4 chars/token), before any tool is called. Actual usage depends on your client and model.Self-reported Self-reportedParsed from the repository README, not verified against a live server β€” may be incomplete or out of date.

Inspect callable tools, capabilities, and parameters exposed to AI agents by 402 MCP.

l402-config

Introspect payment capabilities (wallets, limits, credential count)

l402-discover

Probe an endpoint to discover pricing without paying

l402-fetch

HTTP request with L402 support; auto-pays if within budget

l402-pay

Pay a specific invoice (NWC, Cashu, or human-in-the-loop)

l402-credentials

List stored credentials and cached balances

l402-balance

Check cached credit balance for a server

Documentation Overview

402-mcp

Nostr: npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2

MIT licence TypeScript Node 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.

  • Discover paid APIs on Nostr β€” no URLs needed upfront
  • Auto-pay with Lightning (NWC), Cashu ecash, LNURLcash bearer notes, or human QR fallback
  • Credentials cached and encrypted at rest (AES-256-GCM)
  • Works with any L402 server β€” toll-booth, Aperture, or any future implementation

Quick start

1. Install

Terminal
npx 402-mcp

2. Connect to Claude Code

Terminal
claude mcp add 402-mcp -- npx 402-mcp

3. Try it

Ask Claude: "Search for paid joke APIs using l402-search" β€” no wallet needed, just discovery.

Ready to make paid calls? See the full quickstart guide to set up a wallet and watch your agent pay for its first API call.

Requires Node.js 22 or newer.

How it works

mermaid
graph LR
    A["1. l402-config()"] --> B["2. l402-discover(url)"]
    B --> C["3. Agent reasons<br/>about pricing"]
    C --> D["4. l402-buy-credits()<br/>or l402-fetch()"]
    D --> E["5. l402-fetch(url)<br/>with credentials"]
    E --> F["6. Data returned<br/>+ balance cached"]

Example session:

Code
Agent: "I need routing data from routing.example.com"

1. l402-config()
   -> nwcConfigured: true, maxAutoPaySats: 1000

2. l402-discover("https://routing.example.com/api/route")
   -> 10 sats/request, toll-booth detected, tiers available

3. Agent reasons: "I need ~20 requests. The 500-sat tier
   gives 555 credits. Better value."

4. l402-buy-credits(url, amountSats=500)
   -> Paid 500 sats, received 555 credits

5. l402-fetch("https://routing.example.com/api/route?from=...&to=...")
   -> 200 OK, route data, 545 credits remaining

For detailed architecture and payment flow diagrams, see docs/architecture.md.

Configuration

VariableDefaultDescription
NWC_URI_FILE-Path to a private 0600 file containing the NWC bearer URI
CASHU_TOKENS-Path to Cashu token store file
LNURLCASH_NOTES-Path to LNURLcash bearer note store file (LUD-25)
MAX_AUTO_PAY_SATS1000Most a single automatic payment may cost. Anything dearer is not paid; the challenge goes back to the agent
MAX_SPEND_PER_MINUTE_SATS10000Automatic spend allowed in any rolling 60 seconds. 0 blocks all auto-pay
MAX_SPEND_PER_DAY_SATS5000Automatic spend allowed in any rolling 24 hours, kept in ~/.402-mcp/spend-ledger.json so a restart does not reset it. 0 blocks all auto-pay
CREDENTIAL_STORE~/.402-mcp/credentials.jsonPersistent macaroon/credential storage
TRANSPORTstdioTransport mode: stdio or http
PORT3402HTTP server port (when TRANSPORT=http)
BIND_ADDRESS127.0.0.1HTTP bind address
HTTP_AUTH_TOKEN_FILE-Private 0600 file holding the bearer token HTTP clients must send. Required when TRANSPORT=http
HTTP_ALLOWED_HOSTS-Extra Host header values the HTTP transport accepts (comma-separated), such as a reverse proxy's name
TRANSPORT_PREFERENCEonion,hns,https,httpPreferred transport order for multi-URL services (comma-separated)
TOR_PROXY-SOCKS5 proxy for .onion addresses only (e.g. socks5h://127.0.0.1:9050)
SOCKS_PROXY-SOCKS5 proxy for every paid-API request (e.g. Tor at socks5h://127.0.0.1:9050). Set this or TOR_PROXY, not both
HNS_GATEWAY_URLhttps://query.hdns.io/DNS-over-HTTPS resolver used for Handshake names. Any host name that ordinary DNS cannot find is looked up here

Transport selection and fallback

When a kind 31402 event advertises multiple URLs (one per transport), 402-mcp selects the best one based on your configuration:

  1. Preference first: URLs are tried in TRANSPORT_PREFERENCE order, onion,hns,https,http by default. Use onion, hns, https and http as the values. A URL counts as hns when its TLD is .hns. One whose TLD is merely unfamiliar (.pub, .fyi) is more likely an ICANN name, so it is tried just after https.
  2. Capability filter: .onion URLs are skipped unless TOR_PROXY or SOCKS_PROXY is set, so without a proxy the default order starts at HNS and clearnet.
  3. Availability fallback: if a transport is unreachable (connection refused, timeout), the next URL is tried.

Services can announce multiple endpoints for the same service (same pricing, same macaroon key) on different transports. This is purely for censorship resistance; you do not need to re-authenticate when switching transports. To reach Tor or HNS endpoints you must configure the corresponding proxy/gateway env vars above.

Tor and SOCKS5

  • TOR_PROXY sends .onion requests through the proxy. Everything else connects directly.
  • SOCKS_PROXY sends every request to a paid API through the proxy, including redirects. Host names are resolved by the proxy, never by this machine, so a Tor proxy hides both your IP and the names you look up. The SSRF guard still refuses private IP literals and local names such as localhost; it cannot see what a name resolves to on the far side, which Tor exits refuse for private ranges anyway.

Neither setting covers wallet or discovery traffic: NWC relays, Cashu and LNURLcash mints, and the Nostr relays l402-search queries still connect directly. Handshake lookups are switched off under SOCKS_PROXY, because the DNS-over-HTTPS query would go around the proxy.

SOCKS5 support comes from undici's Socks5ProxyAgent, which Node marks experimental; expect one ExperimentalWarning on stderr when a proxy is configured.

Tools

Core L402 (any server)

ToolDescription
l402-configIntrospect payment capabilities (wallets, limits, credential count)
l402-discoverProbe an endpoint to discover pricing without paying
l402-fetch-previewShow what an endpoint costs without paying; drives the payment confirmation widget
l402-fetchHTTP request that pays a 402 challenge when autoPay is set and the price is within the limits
l402-payPay a challenge returned by l402-fetch or l402-discover, by its payment hash. Any other invoice needs the human's approval
l402-reconcileList or resolve payments whose outcome is unknown; auto-pay to that service is paused until they are resolved
l402-credentialsList stored credentials and cached balances
l402-balanceCheck cached credit balance for a server
l402-searchDiscover L402 services on Nostr relays (kind 31402 announcements)
l402-store-tokenStore an L402 token obtained from a payment page

Widgets (MCP Apps hosts)

ToolDescription
l402-service-directoryInteractive, searchable directory of services found by l402-search
l402-wallet-dashboardInteractive view of wallet status, limits and stored credentials

l402-fetch-preview also has a payment confirmation widget.

toll-booth extensions

ToolDescription
l402-buy-creditsBrowse and purchase volume discount tiers
l402-redeem-cashuRedeem Cashu tokens directly (avoids Lightning round-trip)

Payment methods

Four payer methods, tried in priority order:

  1. NWC (Nostr Wallet Connect) β€” fully autonomous; pays from your connected wallet
  2. Cashu β€” fully autonomous; melts ecash tokens to pay invoices
  3. LNURLcash: fully autonomous; melts LUD-25 bearer notes to pay invoices
  4. Human-in-the-loop β€” presents QR code, polls for settlement

The agent can override the method per-call, or you can configure only the methods you want.

l402-fetch handles four HTTP 402 challenge variants, plus an experimental x402 format:

ProtocolChallenge headerPayment
L402WWW-Authenticate: L402Lightning invoice via wallet stack
IETF Payment (draft-ryan-httpauth-payment-01)WWW-Authenticate: PaymentLightning invoice via wallet stack
LNURLcash (LUD-25)X-LNURLcash: lnurlcashreq1…Bearer note handed over directly (requires a note store)
xCashu (NUT-18)X-Cashu: creqA…Ecash token sent directly (requires Cashu wallet)
x402 (experimental, custom format)X-Payment-Required: x402 + JSON bodyA custom format, not the x402 specification (whose servers send a base64 PAYMENT-REQUIRED header), so real x402 services are not supported. Payment details are shown to the human, who pays from their own wallet

An LNURLcash challenge is tried first. A bearer note is already money in hand, so paying one costs no Lightning hop and no swap at the mint: the note goes straight into the retry header and the server settles it. When the price does not match a note exactly, one is split at the mint and the change stays in the store. If no note covers it, the other rails are tried as usual.

Spending limits

Read the full README β†’View source on GitHub β†’

Related MCP Servers

View all in Developer Tools View all alternatives
  • Openapi MCP Server logoOpenapi MCP Server

    Connect any HTTP/REST API server using an Open API spec (v3)

    πŸ’» Developer Tools3 views
    Compare vs Openapi MCP Server β†’
  • Andrea9293 MCP logoAndrea9293 MCP

    Local-first document management and semantic search for AI coding agents

    πŸ’» Developer Tools2 views
    Compare vs Andrea9293 MCP β†’
  • Next Devtools MCP logoNext Devtools MCP
    Verified

    Official Next.js MCP server for coding agents. Provides runtime diagnostics, route inspection, dev server logs, docs search, and upgrade guides. Requires Next.js 16+ dev server for full runtime features.

    πŸ’» Developer Tools5 views
    Compare vs Next Devtools MCP β†’
  • MCP Server Docker logoMCP Server Docker

    Integrate with Docker to manage containers, images, volumes, and networks.

    πŸ’» Developer Tools3 views
    Compare vs MCP Server Docker β†’

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

Last commit
3d ago
Most recent push to the default branch.
Tools exposed
10
Callable tools this server registers over MCP.

Reviews

No reviews yet β€” be the first to share how this listing worked for you.

Frequently Asked Questions about 402 MCP

Add the following block to your claude_desktop_config.json under mcpServers: "mcpServers": { "402-mcp": { "command": "npx", "args": ["-y","402-mcp"] } }

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG Preview402 MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/402-mcp?style=directory)](https://allmcps.com/mcp/402-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/402-mcp"><img src="https://allmcps.com/api/badge/402-mcp?style=directory" alt="402 MCP on AllMCPs" /></a>

Technical Specs & Signals

CategoryπŸ’»Developer Tools
More technical detailsExpand β–Ύ
TransportSTDIO
RuntimeNode.js
Last updatedSep 21, 2026
11/12 checks healthy over the last 45d
Views0
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars0
GitHub Star CountTotal stargazers on GitHub representing community popularity (0 stars).
Last commit3d ago
Last Repository CommitThe most recent commit or push recorded for this server's GitHub repository.Last commit on Sep 21, 2026
51Quality signal: Good Β· 51/100How this signal is calculated β–Ύ
Server availabilityNot measured

Not scored for repo-hosted servers β€” we can't reach the running server, only its GitHub page. Hosted MCP endpoints are health-checked live.

Verified ownership10/20
Documentation & tools24/30
Adoption & activity4/15
Community engagement0/10

A guidance signal from public completeness & health data β€” not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 2d ago via OSV.dev Β· 402-mcp (npm)

β˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge β€” proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it β€” no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in πŸ’» Developer Tools β†’Best MCP servers for Developers β†’Alternatives to 402 MCP β†’Install in Claude DesktopInstall in CursorInstall in VS CodeSetup guides for all 13 MCP clients