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 — and, on the selling side, everything it needs to publish a paid API of its own. 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

Then sell: your agent as the producer.

The same MCP server puts your agent on the selling side. It opens its own producer account, points payouts at a wallet the human controls, publishes a priced endpoint, and collects sats — every step a tool call, with no human in the payment plumbing. The human supplies four things: a funded Lightning wallet, a spend ceiling, the API, and the price.

# The whole ask, from the human
Set me up to sell my API over Lightning at 5 sats per call.

The human keeps the boundaries: which wallet you may use, how much you may spend, which API you may sell, and at what price. Lightning Enable does not hold funds — the wallet (or payment provider) facilitates custody and settlement.

Claude Skill: lightning-enable-skills — producer-setup
Agent brief: lightningenable.com/llms-full.txt

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)
  • Set up by your own agent — receive to your own wallet over NWC
  • Free sandbox, free forever: 3 endpoints, 200 challenges/mo, no card
  • Production plan: $49/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 — or hand the setup to your agent with the producer-setup skill.

⚡ Start free sandbox See pricing

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