L402 Search MCP logo

L402 Search MCP

No-KYC web search for AI agents, paid per query in Lightning sats (L402). Holds no keys.

Install L402 Search MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "l402-search-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "l402-search-mcp"
      ]
    }
  }
}

Settings β†’ Developer β†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

npx -y l402-search-mcp

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives β€” missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Tools2

What L402 Search MCP lets your agent do. Expand a tool for its parameters.

Self-reported~41 tokens of context

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

17/17 checks healthy over the last 83d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev Β· l402-search-mcp (npm)

Adoption & maintenance

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

npm downloads237Package downloads in the last 30 days.
Last commit3mo agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Tools exposed2Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

l402-search-mcp

No-KYC web search for AI agents β€” paid per query in Lightning sats, via MCP.

This is an MCP client-side server for L402-paywalled search endpoints. It gives any MCP-capable agent (Claude Desktop, Claude Code, Cursor, nostr-merchant, …) a search tool that costs sats instead of an API key:

  1. search(query) β†’ returns a bolt11 Lightning invoice + payment_hash
  2. The agent pays the invoice with its own wallet β€” e.g. nwc-mcp's nwc_pay_invoice, under the agent's own budget caps
  3. search(query, payment_preimage) β†’ JSON results

No account. No API key. No KYC. Each payment buys exactly one search.

By default it points at https://llmops-search.fly.dev (50 sats/search, run by us), but SEARCH_SERVICE_URL works with any endpoint speaking the same L402 dialect.

The trust model (read this)

This server holds NO keys. Not a wallet connection, not an nsec, nothing. Payment happens in the agent's wallet, where the agent's own budget caps, allowlists, and audit logs apply. l402-search-mcp only:

  • relays the L402 challenge (invoice) to the agent,
  • remembers which macaroon belongs to which payment_hash (so the agent only handles the preimage its wallet already returned),
  • makes the authorized retry.

Worst-case compromise of this process leaks pending search queries β€” never money.

Install

Terminal
npx -y l402-search-mcp

Claude Code (project scope):

Terminal
claude mcp add l402-search -s project -- npx -y l402-search-mcp

Claude Desktop (claude_desktop_config.json):

config.json
{
  "mcpServers": {
    "l402-search": { "command": "npx", "args": ["-y", "l402-search-mcp"] }
  }
}

Pair it with a wallet server (e.g. nwc-mcp) so the agent can actually pay.

Tools

ToolPriceWhat it does
searchsats (set by the endpoint; 50 on the default)First call returns the invoice; the call with payment_preimage returns results.
search_service_infofreeEndpoint reachability, pending challenges, flow explainer.

Configuration

Everything is optional β€” the defaults work. Set in the environment or a .env next to the install (never read from cwd):

bash
SEARCH_SERVICE_URL=https://llmops-search.fly.dev  # any L402 search endpoint
CHALLENGE_TTL_SECONDS=900                          # match the endpoint's macaroon TTL
AUDIT_LOG_PATH=./l402-search-mcp-audit.log         # NDJSON, append-only
HTTP_TIMEOUT_MS=15000

The flow, end to end

Code
agent                    l402-search-mcp              endpoint              agent's wallet
  β”‚  search("foo")            β”‚                          β”‚                       β”‚
  β”‚ ────────────────────────► β”‚  GET /search?q=foo       β”‚                       β”‚
  β”‚                           β”‚ ───────────────────────► β”‚                       β”‚
  β”‚                           β”‚  402 {macaroon, invoice} β”‚                       β”‚
  β”‚  {invoice, payment_hash}  β”‚ ◄─────────────────────── β”‚                       β”‚
  β”‚ ◄──────────────────────── β”‚  (macaroon cached)       β”‚                       β”‚
  β”‚  nwc_pay_invoice(invoice) β”‚                          β”‚                       β”‚
  β”‚ ──────────────────────────┼──────────────────────────┼─────────────────────► β”‚
  β”‚  {preimage}               β”‚                          β”‚                       β”‚
  β”‚ ◄─────────────────────────┼──────────────────────────┼────────────────────── β”‚
  β”‚  search("foo", preimage)  β”‚                          β”‚                       β”‚
  β”‚ ────────────────────────► β”‚  GET + Authorization:    β”‚                       β”‚
  β”‚                           β”‚  L402 macaroon:preimage  β”‚                       β”‚
  β”‚                           β”‚ ───────────────────────► β”‚                       β”‚
  β”‚  {results}                β”‚  200 {results}           β”‚                       β”‚
  β”‚ ◄──────────────────────── β”‚ ◄─────────────────────── β”‚                       β”‚

The macaroon never round-trips through the LLM β€” the agent only sees the invoice and hands back the preimage its wallet returned. sha256(preimage) = payment_hash recovers the rest.

Audit log

NDJSON, one line per event: startup, challenge_received, results_received, unknown_preimage, endpoint_error. Same shape as the other servers in the kit.

Part of the LLMOps.Pro agent-payments kit

nwc-mcp (wallet) Β· nostr-ops-mcp (NOSTR identity/publishing) Β· marketplace-mcp (storefront) Β· albyhub-admin-mcp (node admin) Β· paywall-mcp (sell YOUR tools for sats) Β· l402-search-mcp (buy search with sats)

MIT. Built by LLMOps.Pro · ⚑ sovereigncitizens@getalby.com

Reviews

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

Frequently Asked Questions about L402 Search MCP

l402-search-mcp is an MCP server that provides no-KYC web search to AI agents through Lightning-paid L402 endpoints. It exposes a search tool: first request returns an invoice and payment_hash, and a second request with the wallet-returned payment preimage returns results. It holds no wallet keys and supports configurable endpoints.

Each search costs sats set by the configured L402 endpoint, with the default endpoint charging 50 sats per search. The first search call returns a Lightning invoice, the agent pays it with its own wallet, and a second call with the payment preimage retrieves the results.

No, l402-search-mcp holds no wallet connection, private keys, or nsec and does not pay invoices. The agent pays invoices using its own wallet, while the server relays the L402 challenge, associates the macaroon with its payment_hash, and performs the authorized retry.

Install l402-search-mcp with `npx -y l402-search-mcp`, then add it as an MCP server. For Claude Code, use `claude mcp add l402-search -s project -- npx -y l402-search-mcp`; Claude Desktop can configure an `l402-search` server with `npx` and the `-y l402-search-mcp` argument.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

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 PreviewL402 Search MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/l402-search-mcp?style=directory)](https://allmcps.com/mcp/l402-search-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/l402-search-mcp"><img src="https://allmcps.com/api/badge/l402-search-mcp?style=directory" alt="L402 Search MCP on AllMCPs" /></a>