Purpose
lightning-enable-mcp is an open-source MCP server that provides AI agents with Bitcoin Lightning Network payment capabilities, enabling them to pay invoices, access L402 paid APIs, create receiving invoices, track spending, and participate in commercial transactions between agents. This project is part of the Lightning Enable infrastructure, designed to support Lightning Network-based agent commerce.
Main Capabilities
- Pay invoices: Send Bitcoin to any BOLT11 invoice over the Lightning Network.
- Access L402 APIs: Automatically pay L402 challenges for seamless API access.
- Discover APIs: Search the L402 API registry, find paid APIs by keyword or category, or retrieve the manifest of a specific API to learn endpoint details and pricing.
- Track spending: Provides budget limits, a persistent receipt log, and balance checks.
- Create invoices: Generate invoices to receive payments.
- Wallet operations: Query BTC price, currency exchange, and on-chain sends (Strike supported; on-chain sends also support LND).
- Self-service account opening: Through the create_lightning_enable_account tool, pay an activation fee of about 100 sats (via L402) to obtain a merchant API key, with no browser or checkout page required, and unlock producer and ASA tools.
- Sell services (L402 producer): Set up a seller account, put an API behind L402, price routes, list publicly, generate payment challenges, and verify payment tokens—all through one tool.
- Agent commerce (ASA): Discover, request, settle, and review services between agents on Nostr.
Usage
- First run — set up wallet: Use the setup_wallet tool. With no parameters, it reports the configured wallet and the source of its credentials (without exposing the credentials themselves). If there is no wallet, it returns setup steps.
- The shortest path is NWC: create a Nostr Wallet Connect connection in a wallet app that supports NIP-47 (such as Alby Hub, CoinOS), copy the nostr+walletconnect:// string, and give it to the agent. setup_wallet will validate the string, connect the wallet to prove it works, then write ~/.lightning-enable/config.json and restrict file permissions. After that, the server must be restarted.
- It can also be set via environment variables: use STRIKE_API_KEY for Strike; use NWC_CONNECTION_STRING for NWC; use LND_REST_HOST + LND_MACAROON_HEX for LND (for self-signed certificates, set LND_TLS_CERT_PATH; optional LND_FEE_LIMIT_SATS, LND_PAYMENT_TIMEOUT_SECONDS).
- Priority: LND > NWC > Strike > OpenNode; environment variables take precedence over the configuration file.
- OpenNode is only suitable for invoicing/direct payments, does not return a preimage, and cannot pay L402 challenges.
- Verify the full flow — test_l402_payment: Pay a public 1 sat L402 endpoint to verify wallet connectivity, preimage return, and L402 payment capability end to end, costing about 1 satoshi.
- Actual use: For example, buy a T-shirt at the Lightning Enable Store (requires a funded wallet and a shipping address).
- Manual installation for Claude Desktop (MCPB package): Get the packaged MCPB package from the mcpb/ directory, build it locally with npx -y @anthropic-ai/mcpb pack mcpb lightning-enable-mcp.mcpb, or download the .mcpb artifact from CI, then double-click it or drag it into Claude Desktop's Settings → Extensions, and enter wallet credentials through its settings interface.
- Claude Desktop configuration: Install the command with dotnet tool install -g LightningEnable.Mcp. Add the configuration in claude_desktop_config.json. Configuration file locations: Windows %APPDATA%\Claude\claude_desktop_config.json; macOS ~/Library/Application Support/Claude/claude_desktop_config.json; Linux ~/.config/claude/claude_desktop_config.json.
- Managed deployment: Payments exceeding the auto-approval threshold require human confirmation. The server generates a 6-digit one-time confirmation code and sends it to the operator; the agent can only continue after you read the code back. The confirmation code does not appear in tool results. The confirmation code is valid for 120 seconds by default (configurable from 30-900 seconds), is bound to the amount, tool, and target, allows at most 3 to exist simultaneously, and 5 consecutive invalid attempts will revoke all pending confirmation codes.
Supported wallets
- Strike: STRIKE_API_KEY, obtained from https://dashboard.strike.me .
- NWC: NWC_CONNECTION_STRING, from CoinOS / CLINK / Alby Hub.
- LND: LND_REST_HOST + LND_MACAROON_HEX; self-signed certificates require LND_TLS_CERT_PATH.
- OpenNode: OPENNODE_API_KEY, supports only invoicing/direct payments, cannot pay L402.
Spending limits
Limits are located in ~/.lightning-enable/config.json and are read-only at runtime—the agent can only tighten its own limits, not raise them. They can be set in USD, satoshi, or both. When both units of account are set, each check uses the stricter limit. When the price source is down, the satoshi limit can still restrict spending; if autoApproveSats is set, payments equal to or below that value are automatically approved, and those above require confirmation; if it is not set, all payments require confirmation until the price source recovers.
Tool list
17 tools in total: 14 free (wallet only) and 3 requiring LIGHTNING_ENABLE_API_KEY (Agentic Commerce subscription). 5 of them are action tools, with the operation selected via the action parameter. Old tool names can still be called, but are deprecated in v3.0.0. The tool profile (LIGHTNING_ENABLE_TOOL_PROFILE) controls the number of schemas pushed to the model context, but does not remove capabilities.
Use cases
- An AI agent needs to automatically pay Bitcoin invoices or access L402 paid APIs.
- A developer wants to charge per use for their own API via L402 and sell it to agents.
- Agents perform service discovery, requests, settlement, and reviews on Nostr.
- Security scenarios that require budget controls and human confirmation for agent payments.
Limitations
- L402 payments require a wallet that returns the preimage; OpenNode does not support this.
- Producer tools and ASA tools require an Agentic Commerce subscription ($49/month, 30-day free trial), or activation by paying about 100 sats via create_lightning_enable_account.
- Human confirmationcode mechanism serves only as an operator confirmation aid; on managed servers you must choose your own confirmation channel (console, file, or webhook), and it does not constitute an independent approval boundary.
- On the managed Lightning Enable API, the attest operation of agent_services is rejected, so you cannot leave a review through it.
- Complete tool documentation and the Python README can be found in the repository's documentation.