APIs, data, tools — paid per request, in seconds, with no account, no API key, and no card on file. The free, open-source Lightning Enable MCP server gives any MCP-capable agent a Lightning wallet and the L402 protocol. Here's how it works.
L402 is a small convention built on three old, boring, reliable pieces: an HTTP status code from 1997, a payment network that settles in about a second, and a credential you can verify without a database lookup.
HTTP 402 Payment Required with two
things attached: a Lightning invoice (the price, often a single
sat) and a macaroon — a scoped credential that isn't valid yet.
The MCP server is free and open source (MIT), published on PyPI, NuGet, and Docker Hub — 24,000+ downloads and counting. Three steps from zero to a paid API call.
# 1 — Install (pick your runtime)
pip install lightning-enable-mcp # Python
uvx lightning-enable-mcp # Python, no install
dotnet tool install -g LightningEnable.Mcp # .NET
docker pull refinedelement/lightning-enable-mcp:latest # Docker
2 — Connect one L402-capable wallet. L402 needs a
wallet that returns the payment preimage: Strike (easiest to start),
NWC (CoinOS / CLINK / Alby Hub), or your own LND node. Add the MCP
to your agent host — for Claude Desktop, that's one entry in
claude_desktop_config.json:
{
"mcpServers": {
"lightning-enable": {
"command": "uvx",
"args": ["lightning-enable-mcp"],
"env": { "STRIKE_API_KEY": "your-strike-api-key" }
}
}
}
3 — Prove the whole loop works. Ask your agent to
run test_l402_payment. It pays a public 1-sat L402
endpoint end to end — wallet connected, preimage returned, response
served. Total cost: about one satoshi. Then try the fun one: ask it
to buy a t-shirt from the
Lightning Enable Store.
Simple split: spending money is free, making money is the product.
Building an agent? The MCP is free — install it and your agent can pay any L402 API today. Building an API? Gate your first endpoint in the free sandbox, no card required.
pip install lightning-enable-mcp ·
dotnet tool install -g LightningEnable.Mcp ·
MCP quickstart