L402 Search Mcp

io.github.llmops-pro由 GitHub 账号 llmops-pro 发布v0.1.0更新于 Oct 24, 2026

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

已验证STDIO仅桌面网页搜索与抓取金融

概览

AI 生成的概览

本地 MCP 服务器,为助手提供按次付费的网页搜索工具,通过 L402 端点以闪电网络 sats 结算,无需 API 密钥。

可以做什么
  • 对 L402 付费端点发起网页搜索,首次调用返回闪电网络发票和 payment_hash。
  • 凭助手自身钱包返回的 payment_preimage 再次调用以取得搜索结果。
  • 查看所配置端点的可达性、待处理挑战和付费流程说明。
  • 将挑战、结果、端点错误等事件写入仅追加的审计日志。
适用场景
适合需要网页搜索但不想注册账号、申请 API 密钥或做 KYC 的助手,且已有可在预算上限内支付发票的闪电网络钱包服务器(如 nwc-mcp)。也适合接入自建的兼容 L402 的搜索端点。
运行要求
通过 npx 在本地运行(需要 Node.js)。无需账号或 API 密钥。可选环境变量:SEARCH_SERVICE_URL(默认指向托管端点)、CHALLENGE_TTL_SECONDS、AUDIT_LOG_PATH、HTTP_TIMEOUT_MS。实际支付发票需要另配钱包服务器。需能访问搜索端点。
安装前请注意
每次搜索都花费 sats,默认端点每次 50 sats,具体由所配置端点决定。服务器本身不持有密钥,但会把发票转交给助手钱包,支付上限取决于该钱包的限额设置。待处理的搜索查询保存在内存中,进程被攻破时可能泄露。查询内容会发送给所配置的第三方端点。

安装

在 SourceWeft 中

  1. 打开 控制台中的 L402 Search Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

bash
npx -y l402-search-mcp

Claude Code (project scope):

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

Claude Desktop (claude_desktop_config.json):

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 endpointCHALLENGE_TTL_SECONDS=900                          # match the endpoint's macaroon TTLAUDIT_LOG_PATH=./l402-search-mcp-audit.log         # NDJSON, append-onlyHTTP_TIMEOUT_MS=15000

The flow, end to end

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 · ⚡ [email protected]

来源:README.md,提交 1d0080f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分