Labsco
MCP SERVER

Lightning Enable

by refined-element

Give an agent a Lightning wallet so it can clear L402 paywalls and pay BOLT11 invoices itself, under per-request and per-session limits you set first.

Payments, Billing & SubscriptionsVerified
Summary
An agent can settle a 402 by itself, inside limits set before it starts.

access_l402_resource turns a paywalled endpoint into an ordinary fetch, and the controls around it are the substance: configure_budget only tightens, spends above the configured threshold stop for a confirmation code a human relays from the server console, and get_receipts keeps a durable record after the session ends. Part of the surface is conditional — the price, exchange and on-chain tools are Strike-only, and four of the agent-coordination tools are in preview and return an error against the hosted API today.

What it is

A Lightning wallet and L402 client for agents, covering both sides of the exchange: paying for access, and charging for it. It holds no funds — the wallet you connect does — and runs locally next to your client.

What you get
  • Fetches that pay their own way: a 402 response is settled and the request retried, capped by a max_sats ceiling (access_l402_resource), plus manual handling of an L402 or MPP challenge when you want the token yourself (pay_l402_challenge).
  • A one-satoshi self-test against a public L402 endpoint that proves the wallet is connected and returns a preimage before you depend on it (test_l402_payment).
  • Direct BOLT11 payment returning the preimage as proof, invoice creation to receive payment, and a paid/unpaid check by invoice ID (pay_invoice, create_invoice, check_invoice_status).
  • Spending limits that only tighten at runtime, a read-only budget view, and an append-only receipt log at ~/.lightning-enable/receipts.jsonl that outlives the session and records the spend policy and how to revoke the wallet (configure_budget, get_budget_status, get_receipts, get_payment_history).
  • Wallet balance in sats and, with a Strike wallet, the Bitcoin price, USD/BTC exchange and on-chain sends (get_balance, get_btc_price, exchange_currency, send_onchain).
  • Discovery of paid APIs in the L402 registry by keyword, category or manifest URL, with budget_aware=true reporting how many calls you can afford (discover_api).
  • The provider side: issue an L402 challenge to charge for a resource, then verify the macaroon and preimage a payer presents back (create_l402_challenge, verify_l402_payment).
  • Agent-to-agent commerce on Nostr — capabilities published as kind 38400 events, requests as 38401, attestations as 38403 — with settlement over the same L402 auto-pay path (discover_agent_services, publish_agent_capability, unpublish_agent_capability, request_agent_service, settle_agent_service, publish_agent_attestation, get_agent_reputation).
Requirements

One L402-capable wallet, and it has to return the payment preimage: Strike (STRIKE_API_KEY), an NWC connection string (NWC_CONNECTION_STRING) from CoinOS, CLINK or Alby Hub, or your own LND node (LND_REST_HOST plus LND_MACAROON_HEX). OpenNode invoices and pays but never returns a preimage, so it cannot clear L402 challenges. If several are set the order is LND, then NWC, then Strike, then OpenNode. Install it as a .NET tool (`dotnet tool install -g LightningEnable.Mcp`), from PyPI (`pip install lightning-enable-mcp` or `uvx lightning-enable-mcp`), or from the Docker image; all three run over stdio. Nine tools additionally need LIGHTNING_ENABLE_API_KEY, which create_lightning_enable_account can mint with a payment of about 100 sats.

Setup effort

One command plus a key — pip install lightning-enable-mcp, then supply credentials