
L402 Kit
io.github.ThiagoDataEngineer由 GitHub 账号 ThiagoDataEngineer 发布v1.8.7更新于 Oct 24, 2026
MCP server for L402-protected APIs via Bitcoin Lightning. Pay-per-call AI tools in sats.
概览
让助手调用受 L402 保护的 API,并通过比特币闪电网络按次自动付款。
- 可以做什么
- L402 Kit 是面向 API 的支付层:API 返回 HTTP 402 以及 BOLT11 闪电发票和 macaroon。代理客户端可以识别 402、用配置好的闪电钱包支付发票,然后带上 L402 授权头重试请求。它还提供 TypeScript、Python、Go 和 Rust 的服务端中间件,方便开发者对自己的接口收费,并附带一个用于监控付款的 VS Code 扩展。
- 适用场景
- 当助手需要调用采用 L402 或 x402 按次付费模式的付费 API,且你希望付款环节无需人工逐次批准时,适合安装。它面向自主代理工作流,也面向希望将自家 API 变现的开发者。
- 运行要求
- 以 stdio 方式在本地运行,通常通过 npx l402-kit-mcp 启动。需要 Node.js,以及通过环境变量提供的闪电钱包凭据,例如 BLINK_API_KEY(配合 BLINK_WALLET_ID)、ALBY_TOKEN、OPENNODE_KEY 或 LNBITS_KEY,具体取决于所选服务商。收款需要闪电地址或自建节点。需要能访问闪电服务商和付费 API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 L402 Kit,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
l402-kit
Add Bitcoin Lightning pay-per-call to any API. 3 lines of code.
[License: MIT] [Live Demo] [Tests] [l402-kit MCP server]
[VS Code Marketplace] [Installs]
▶ Watch end-to-end demo — install → 402 → pay → 200 OK
Live traction
🌍 Available in 11 languages — click to expand
🇺🇸 Charge for your API in Bitcoin Lightning. 3 lines of code. 🇧🇷 Monetize sua API com Bitcoin Lightning. 3 linhas de código. 🇪🇸 Monetiza tu API con Bitcoin Lightning. 3 líneas de código. 🇨🇳 用 3 行代码,通过比特币闪电网络收费。 🇮🇳 अपने API को Bitcoin Lightning से 3 लाइनों में मोनेटाइज़ करें। 🇸🇦 اكسب من API الخاص بك عبر Bitcoin Lightning. 3 أسطر فقط. 🇫🇷 Monétisez votre API en Bitcoin Lightning. 3 lignes de code. 🇩🇪 Monetarisiere deine API mit Bitcoin Lightning. 3 Zeilen Code. 🇷🇺 Монетизируй свой API через Bitcoin Lightning. 3 строки кода. 🇯🇵 Bitcoin LightningでAPIを3行で収益化。 🇮🇹 Monetizza la tua API con Bitcoin Lightning. 3 righe di codice.
📖 Official docs: 🇺🇸 · 🇧🇷 · 🇪🇸 · 🇨🇳 · 🇮🇳 · 🇸🇦 · 🇫🇷 · 🇩🇪 · 🇷🇺 · 🇯🇵 · 🇮🇹
Install
AI Agents / LLMs: See
llms.txtfor machine-readable instructions. Agent discovery:/.well-known/agent.json·/.well-known/l402.json
For AI Agents
l402-kit is the payment layer for autonomous agents. Agents can pay for APIs without human intervention.
System prompt snippet — add this to any agent to enable L402 payments:
Agent SDK quickstart:
MCP Server (for Claude Desktop, Cursor, and any MCP-compatible agent):
Compatible with: LangChain · OpenAI Agents · CrewAI · Vercel AI SDK · AutoGPT · Any MCP client
Protocol support: L402 (Bitcoin Lightning) · x402 (USDC/Coinbase) compatible
How it works
Quickstart
TypeScript
Python
Go
Rust
Test it live
Why not Stripe?
Providers
Bring your own node — implement the LightningProvider interface in 5 lines:
Security model
- Unforgeable — SHA256 is a one-way function; you cannot fake a preimage
- No chargebacks — cryptographic settlement, not reversible card auth
- Replay-safe — MemoryReplayAdapter (dev) or RedisReplayAdapter (production, multi-instance)
- 600+ automated tests across 5 runtimes (TS, Python, Go, Rust, Cloudflare Workers) — production-grade reliability for autonomous agent workflows
- Fully auditable — MIT, every line open source
VS Code Extension
Monitor every sat in real-time without leaving your editor.
- ⚡ Live payment feed per endpoint
- 📊 Bar chart — 1D / 7D (free) · 30D / 1Y / ALL (Pro)
- 🌍 11 languages built-in
- 🎨 Light / dark / auto theme
- 🔧 Zero config — just set your Lightning Address
Get a Lightning Address (free)
Sign up at dashboard.blink.sv — free, no credit card, instant.
Your address: [email protected]
Other wallets: Wallet of Satoshi · Phoenix · Zeus · Alby
Links
来源:README.md,提交 a9a2161
工具
0版本历史
1- v1.8.7最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分