Your agent can pay for
what it needs.

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.

How an agent buys an API call.

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.

Quickstart: give your agent a wallet.

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.

Full guide: docs.lightningenable.com — MCP quickstart
Source: github.com/refined-element/lightning-enable-mcp

What's free, what's paid.

Simple split: spending money is free, making money is the product.

Free forever — the agent side

Pay and use L402 APIs.

  • Open-source MCP server (MIT) — no subscription
  • Pay Lightning invoices and L402 challenges
  • Discover paid APIs in the public L402 registry
  • Budgets, spending limits, payment history
  • Works with Strike, NWC, or your own LND node
Install the MCP
Needs a plan — the producer side

Sell access to your own API.

  • Create L402-protected endpoints agents can buy from
  • Per-endpoint pricing, live revenue dashboard
  • Agent-to-agent commerce tools (ASA over Nostr)
  • Free sandbox: 3 endpoints, 200 challenges/mo, no card
  • Production plans from $99/mo — flat fee, no take rate
See pricing

Both sides of the rail

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.

⚡ Start free sandbox See pricing

pip install lightning-enable-mcp · dotnet tool install -g LightningEnable.Mcp · MCP quickstart