Skip to main content

Lightning Enable MCP - Complete Guide

The Lightning Enable MCP (Model Context Protocol) server lets an AI agent pay, receive, and sell over Lightning. It is free and open source (MIT). This page is the full reference for its tools, configuration, and spending controls. For a 3-minute setup, see MCP Quick Start; for wallet-specific steps, see Wallet Configuration.

Open Source

The MCP server is fully open source: github.com/refined-element/lightning-enable-mcp. Available on NuGet, PyPI, and Docker.

Overview​

┌──────────────────────────────────────────────────────────────────────────┐
│ Lightning Enable MCP │
├──────────────────────────────────────────────────────────────────────────┤
│ AI Agent (Claude, etc.) │
│ ↓ │
│ MCP Server (wallet priority: LND > NWC > Strike > OpenNode) │
│ ↓ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ LND │ │ NWC │ │ Strike │ │ OpenNode │ │
│ │ Wallet │ │ Wallet │ │ Wallet │ │ Wallet │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ↓ ↓ ↓ ↓ │
│ Lightning Network │
└──────────────────────────────────────────────────────────────────────────┘

Wallet Priority: When multiple wallets are configured, the MCP server selects them in order: LND > NWC > Strike > OpenNode. This order is optimized for L402 compatibility (LND and NWC always return preimages). Override with the WALLET_PRIORITY environment variable or the priority field in your config file.

Installation​

.NET (Windows, Linux, macOS)​

dotnet tool install -g LightningEnable.Mcp

Python (All Platforms)​

pip install lightning-enable-mcp

Or use uvx for no-install execution:

uvx lightning-enable-mcp
NWC wallets

The base Python install supports NWC wallets on every platform, including Windows, with no build toolchain. The old pip install lightning-enable-mcp[nwc] still works, but the [nwc] extra adds nothing.

Updating​

To update an existing install (docs needs 2.2.0 or later; renew_lightning_enable_subscription needs 2.1.0 or later):

dotnet tool update -g LightningEnable.Mcp     # .NET
pip install --upgrade lightning-enable-mcp # Python
uvx --refresh lightning-enable-mcp # Python with uvx

Quick Start​

Claude Code users: register the server with claude mcp add --transport stdio lightning-enable --env STRIKE_API_KEY=your-key -- lightning-enable-mcp (or a project .mcp.json) — see Claude Code Setup. Claude Code does not read claude_desktop_config.json.

Claude Desktop users: add to your Claude Desktop config:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/claude/claude_desktop_config.json

{
"mcpServers": {
"lightning-enable": {
"command": "lightning-enable-mcp",
"env": {
"STRIKE_API_KEY": "your-strike-api-key"
}
}
}
}

All Available Tools​

Tool Profiles​

The MCP server ships three tool profiles, selected once at startup with LIGHTNING_ENABLE_TOOL_PROFILE:

export LIGHTNING_ENABLE_TOOL_PROFILE=standard   # default — omit this line to get the same result
ProfileSurfaceUse it when
litePay, check the wallet, budget, receipts, wallet setupYou want the smallest possible footprint — an agent that can pay and check its own wallet, and nothing else.
standard (default)Every current tool (listed below)The current, canonical surface. Everything the server can do, addressed through a small number of action-based tools instead of one tool per operation.
fullstandard plus every pre-consolidation name, listed as a deprecated aliasYour agent discovers tools from the server's listing and its prompts use the old per-operation names (configure_budget, create_l402_challenge, …). Aliases forward to the consolidated tools and are removed in v3.0.0, so migrate when you can.

Profiles change only what the server lists. Every tool and every deprecated alias stays callable by name under every profile, so a narrower profile never breaks a call that names a tool directly; it only keeps that tool's schema out of the agent's context.

lite: pay_invoice, access_l402_resource, get_balance, budget, receipts, setup_wallet

standard (default): access_l402_resource, pay_invoice, pay_l402_challenge, test_l402_payment, get_balance, budget, receipts, create_invoice, check_invoice_status, verify_confirmation_code, discover_api, docs, create_lightning_enable_account, renew_lightning_enable_subscription, setup_wallet, wallet_ops, l402_producer, agent_services

renew_lightning_enable_subscription pays for Agentic Commerce in sats (30 days over L402, at the price GET /api/merchant/subscription/renew quotes) using your merchant API key and connected wallet; it requires MCP 2.1.0 or later. See Renew in sats.

docs searches and reads this documentation site from inside the MCP server, so an agent without web access can look things up. It requires MCP 2.2.0 or later. See docs.

These lists mirror the server's own guard tests. The server's tool listing is authoritative for the version you have installed.

Tool Availability by Wallet​

ToolStrikeOpenNodeLNDNWC (CoinOS/CLINK)NWC (Alby)NWC (Primal)API key
pay_invoice✅✅✅✅✅✅No
access_l402_resource✅❌✅✅✅❌No
pay_l402_challenge✅❌✅✅✅❌No
test_l402_payment✅❌✅✅✅❌No
get_balance✅ (multi-currency)✅✅✅✅✅No
budget (action=status|tighten)✅✅✅✅✅✅No
receipts (source=durable|session)✅✅✅✅✅✅No
create_invoice✅✅✅✅*✅*✅*No
check_invoice_status✅✅✅❌❌❌No
verify_confirmation_code✅✅✅✅✅✅No
discover_api✅✅✅✅✅✅No
docs (action=search|read)✅✅✅✅✅✅No
create_lightning_enable_account✅❌✅✅✅❌No
renew_lightning_enable_subscription✅❌✅✅✅❌Yes
setup_wallet✅✅✅✅✅✅No
wallet_ops (action=price|exchange|send_onchain)✅❌**✅ (send_onchain only)❌**❌**❌**No
l402_producer (action=create|verify|configure_receive|status|create_proxy|add_endpoint|publish|list_challenges)✅✅✅✅✅✅Yes, every action
agent_services (action=discover|request|settle|publish|unpublish|attest|reputation)✅✅✅✅✅✅Partial — see ASA tools

*NWC invoice creation depends on wallet support. **price and exchange are Strike-only regardless of wallet; send_onchain also works on LND.

docs needs no wallet at all; it works before one is configured.

L402 requires preimage return: LND always works, Strike works, CoinOS/CLINK work, Alby works, OpenNode/Primal don't return preimage.

Deprecated aliases​

Two generations of renames, both kept working so an old prompt still makes sense — the mapping is what changed, not the behavior:

Deprecated nameCurrent callSince
check_wallet_balance, get_all_balancesget_balancev1.17.0
confirm_paymentverify_confirmation_codev1.17.0
get_payment_historyreceipts(source="session")Tool consolidation
get_receiptsreceipts(source="durable")Tool consolidation
get_budget_statusbudget(action="status")Tool consolidation
configure_budgetbudget(action="tighten")Tool consolidation
get_btc_pricewallet_ops(action="price")Tool consolidation
exchange_currencywallet_ops(action="exchange")Tool consolidation
send_onchainwallet_ops(action="send_onchain")Tool consolidation
create_l402_challengel402_producer(action="create")Tool consolidation
verify_l402_paymentl402_producer(action="verify")Tool consolidation
discover_agent_servicesagent_services(action="discover")Tool consolidation
request_agent_serviceagent_services(action="request")Tool consolidation
settle_agent_serviceagent_services(action="settle")Tool consolidation
publish_agent_capabilityagent_services(action="publish")Tool consolidation
unpublish_agent_capabilityagent_services(action="unpublish")Tool consolidation
publish_agent_attestationagent_services(action="attest")Tool consolidation
get_agent_reputationagent_services(action="reputation")Tool consolidation

Every alias in the table dispatches under every profile. The profile decides only whether an alias is listed: the "Tool consolidation" aliases are listed under LIGHTNING_ENABLE_TOOL_PROFILE=full, and standard and lite list only the current names. The v1.17.0 aliases aren't listed under any profile. All the aliases are scheduled for removal in v3.0.0.


Onboarding​

setup_wallet​

Reports which wallet the server pays from, or connects an NWC wallet. Call it with no arguments first: when no wallet is configured, it returns the setup steps. It is usually the first call on a fresh machine, and the one the producer-setup skill opens with.

Parameters:

ParameterTypeRequiredDescription
nwcConnectionStringstringNoA nostr+walletconnect://... string (nwc_connection_string in Python). Omit to only report the current wallet.

With a connection string, the tool validates it, checks that it reaches a live wallet, and only then writes it to wallets.nwcConnectionString in ~/.lightning-enable/config.json. If an environment variable already selects a wallet, it refuses and names the variable to unset, because environment variables override the config file. The response never contains the connection string.

To use Strike, OpenNode, or LND, set their environment variables or config keys instead; see Wallet Configuration.

Core Tools (All Wallets)​

pay_invoice​

Pay any Lightning invoice and get the preimage as proof of payment.

Parameters:

ParameterTypeRequiredDefaultDescription
invoicestringYes-BOLT11 Lightning invoice
max_satsintNo1000Maximum payment allowed (Python package; the .NET tool relies on budget-service limits)
confirmationNoncestringNo-Confirmation code from the server console (confirmation_nonce in Python). Required on the retry when the first call returned requiresConfirmation=true — see Out-of-Band Confirmation

Example:

User: Pay this invoice: lnbc500n1p3...

Claude: [Uses pay_invoice]

Payment successful!
- Amount: 500 sats
- Preimage: 7f8a9b2c3d4e5f...
- Provider: Strike

Response:

{
"success": true,
"provider": "Strike",
"payment": {
"preimage": "7f8a9b2c3d4e5f...",
"amountSats": 500
},
"message": "Payment successful! Paid 500 sats."
}

get_balance​

Get the connected wallet's balance: the sats balance plus, where available, all currency balances (multi-currency for Strike, a single BTC entry otherwise) and the session spend summary. Supersedes the old check_wallet_balance and get_all_balances tools (v1.17.0) — it returns the superset of what both returned, and the old names keep working as deprecated aliases until v3.0.0.

Parameters: None required

Example:

User: What's my wallet balance?

Claude: [Uses get_balance]

Wallet Balance: 50,000 sats (~$50 USD)
Provider: Strike
Strike balances: $127.45 USD · 0.00050000 BTC

Response:

{
"success": true,
"provider": "Strike",
"balance": {
"sats": 50000,
"btc": 0.0005
},
"balances": [
{ "currency": "USD", "available": 127.45, "formatted": "127.45 USD" },
{ "currency": "BTC", "available": 0.0005, "formatted": "0.00050000 BTC (50,000 sats)" }
],
"message": "Balance: 50,000 sats"
}

receipts​

Read the payment record, from either of two sources selected with source. Replaces the two formerly separate tools get_payment_history (now source="session") and get_receipts (now source="durable").

Parameters:

ParameterTypeRequiredDefaultDescription
sourcestringYes-durable: the append-only log at ~/.lightning-enable/receipts.jsonl (survives restarts). session: payments made since this server process started (in memory).
limitintNo-Maximum records to return (durable clamps to 1-200)

Example:

User: Show my recent payments

Claude: [Uses receipts with source="session"]

Recent Payments:
1. 500 sats - lnbc500n1... - 5 min ago
2. 100 sats - lnbc100n1... - 1 hour ago
3. 1000 sats - lnbc1u1... - 2 hours ago

Total: 1,600 sats across 3 payments
Also readable as an MCP Resource

The durable log is also exposed as an MCP Resource at lightning-enable://receipts, so a client that reads resources rather than calling tools can pull the same data without a tool call.


budget​

Read or tighten spending limits, selected with action. Replaces the two formerly separate tools get_budget_status (now action="status") and configure_budget (now action="tighten").

Parameters:

ParameterTypeRequiredDescription
actionstringYesstatus (read-only) or tighten (lower the runtime caps)
perRequest / perSessionintNotighten only: new per-payment and per-session caps in sats (per_request / per_session in Python). They default to 1,000 and 10,000, so pass both.

tighten can only lower a cap, never raise it above the config file. To raise a limit, edit ~/.lightning-enable/config.json and restart the server.

Example — status:

User: What are my spending limits?

Claude: [Uses budget with action="status"]

Budget Configuration (READ-ONLY):
- Config file: ~/.lightning-enable/config.json
- Auto-approve: up to $0.10
- Log & approve: $0.10 - $1.00
- Requires out-of-band confirmation code: above $1.00
- Maximum per payment: $500.00
- Maximum per session: $100.00

Session:
- Spent: $0.45 (4,500 sats)
- Remaining: $99.55

Note: AI cannot RAISE budget limits. budget(action="tighten") can only
tighten the runtime sats caps; edit config.json to raise limits.

Example — tighten:

User: Lower my per-request cap to 5,000 sats for this session.

Claude: [Uses budget with action="tighten", perRequest=5000, perSession=10000]

Runtime per-payment cap tightened to 5,000 sats for this session.
(This cannot be undone by calling budget again with a higher value —
only editing config.json can raise it back.)

The operator's own sats limits are config-file keys; see Sats-native budgets.


verify_confirmation_code​

Verify whether a payment confirmation code (relayed by the human from the server console) is still valid and what it authorizes. Verification only — it never executes a payment. To actually pay, re-call the original payment tool with the confirmationNonce (.NET) / confirmation_nonce (Python) parameter. Renamed from confirm_payment in v1.17.0 (the old name still works as a deprecated alias until v3.0.0).

Parameters:

ParameterTypeRequiredDescription
noncestringYesThe confirmation code the human read from the server console

Response (valid):

{
"valid": true,
"amount_sats": 2500,
"tool": "pay_invoice",
"message": "Code verified — NOTHING HAS BEEN PAID. To execute, call pay_invoice again with confirmation_nonce=<code>."
}

Invoice Tools (Strike, OpenNode, LND)​

create_invoice​

Create a Lightning invoice to receive payments. Returns a BOLT11 string to share with the payer.

Parameters:

ParameterTypeRequiredDefaultDescription
amountSatslongYes-Amount to receive in satoshis
memostringNonullDescription for the invoice
expirySecsintNo3600Invoice expiry (default 1 hour)

Example:

User: Create an invoice for 1000 sats for "Coffee payment"

Claude: [Uses create_invoice]

Invoice Created!
- Amount: 1,000 sats
- Memo: Coffee payment
- Expires: 1 hour
- Invoice ID: inv_abc123...

BOLT11 Invoice (share with payer):
lnbc10u1p3xyza...

Share this invoice with the payer, or display as a QR code.

Response:

{
"success": true,
"provider": "Strike",
"invoice": {
"id": "inv_abc123",
"bolt11": "lnbc10u1p3xyza...",
"amountSats": 1000,
"expiresAt": "2024-01-15T14:30:00Z"
},
"message": "Invoice created for 1000 sats. Share the bolt11 string with the payer."
}

check_invoice_status​

Check if a previously created invoice has been paid.

Parameters:

ParameterTypeRequiredDescription
invoiceIdstringYesInvoice ID from create_invoice

Example:

User: Has the coffee invoice been paid?

Claude: [Uses check_invoice_status with invoiceId="inv_abc123"]

Invoice Status: PAID! ✅
- Amount: 1,000 sats
- Paid at: 2024-01-15 13:45:22 UTC

Response:

{
"success": true,
"provider": "Strike",
"invoice": {
"id": "inv_abc123",
"state": "paid",
"isPaid": true,
"isPending": false,
"amountSats": 1000,
"paidAt": "2024-01-15T13:45:22Z"
},
"message": "Invoice inv_abc123 has been PAID!"
}

wallet_ops​

Strike- and LND-specific operations. One consolidated tool for the operations that only some wallets support, selected with action. Replaces the three formerly separate tools get_btc_price (now action="price"), exchange_currency (now action="exchange"), and send_onchain (now action="send_onchain").

price and exchange are Strike-only regardless of wallet. send_onchain works with Strike and LND.

action="price"​

Get the current Bitcoin price in USD.

Parameters: action="price" only — no other parameters

Example:

User: What's the current Bitcoin price?

Claude: [Uses wallet_ops with action="price"]

Current BTC Price: $97,500.00 USD
Source: Strike
Timestamp: 2024-01-15 13:30:00 UTC

Response:

{
"success": true,
"provider": "Strike",
"ticker": {
"btcUsd": 97500.00,
"timestamp": "2024-01-15T13:30:00Z"
},
"message": "Current BTC price: $97,500.00 USD"
}

action="exchange"​

Convert between USD and BTC within your Strike wallet.

Parameters:

ParameterTypeRequiredDescription
sourceCurrencystringYesCurrency to convert from: USD or BTC
targetCurrencystringYesCurrency to convert to: BTC or USD
amountdecimalYesAmount in source currency

Example — Buy Bitcoin:

User: Convert $50 to Bitcoin

Claude: [Uses wallet_ops with action="exchange", sourceCurrency=USD, targetCurrency=BTC, amount=50]

Exchange Complete!
- Converted: $50.00 USD
- Received: 0.00051282 BTC (51,282 sats)
- Rate: $97,500/BTC
- Fee: $0.25

Example — Sell Bitcoin:

User: Sell 0.001 BTC for dollars

Claude: [Uses wallet_ops with action="exchange", sourceCurrency=BTC, targetCurrency=USD, amount=0.001]

Exchange Complete!
- Converted: 0.001 BTC (100,000 sats)
- Received: $97.00 USD
- Rate: $97,500/BTC
- Fee: $0.50

action="send_onchain"​

Send an on-chain Bitcoin payment to a Bitcoin address (not Lightning). Works with Strike and LND.

Parameters:

ParameterTypeRequiredDescription
addressstringYesBitcoin address (bc1q..., 3..., or 1...)
amountSatslongYesAmount to send in satoshis
confirmationNoncestringNoConfirmation code from the server console (confirmation_nonce in Python). Omit on the first call to request one; always required to actually send
Always Confirmed

On-chain payments are irreversible, so wallet_ops(action="send_onchain") always requires an out-of-band confirmation code — even for small amounts — and fails closed if the budget service is unavailable. See Out-of-Band Confirmation.

Example:

User: Send 50000 sats to bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh

Claude: [Uses wallet_ops with action="send_onchain"]

On-Chain Payment Sent!
- Amount: 50,000 sats (0.0005 BTC)
- Address: bc1qxy2kg...
- Network Fee: 500 sats
- Status: COMPLETED
- Transaction ID: abc123def456...
On-Chain vs Lightning

On-chain payments are slower (10+ minutes) and have higher fees than Lightning. Use Lightning (pay_invoice) when possible.


L402 Tools​

These tools need no API key, but they need a wallet that returns the payment preimage: LND, Strike, or an NWC wallet such as CoinOS, CLINK, or Alby Hub. OpenNode and Primal don't return it, so they can't pay L402 challenges.

access_l402_resource​

Fetch a URL with automatic L402 payment handling. When the API returns 402 Payment Required, the MCP automatically pays the invoice and retries with the L402 credential.

Parameters:

ParameterTypeRequiredDefaultDescription
urlstringYes-URL to fetch
methodstringNoGETHTTP method
headersstringNonullJSON object of headers
bodystringNonullRequest body
maxSatsintNo1000Maximum payment allowed
confirmationNoncestringNo-Confirmation code from the server console (confirmation_nonce in Python). Required on the retry when the first call returned requiresConfirmation=true

Example:

User: Fetch premium data from https://api.example.com/l402/data

Claude: [Uses access_l402_resource]

The API required a 50 sat payment which was automatically paid.

Response:
{
"premium": "data...",
"analysis": "..."
}

Payment Details:
- Amount: 50 sats ($0.05)
- L402 token cached for future requests

pay_l402_challenge​

Manually pay an L402 (or MPP) invoice when you have the invoice — and, for L402, the macaroon — as separate components.

Parameters:

ParameterTypeRequiredDefaultDescription
invoicestringYes-BOLT11 Lightning invoice
macaroonstringNo-Base64-encoded macaroon. Optional — omit for MPP mode
maxSatsintNo1000Maximum payment allowed
confirmationNoncestringNo-Confirmation code from the server console (confirmation_nonce in Python). Required on the retry when confirmation was requested

Returns: L402 credential in format macaroon:preimage (L402 mode), the bare preimage (legacy MPP mode), or a single-use Authorization: Payment <base64url(JSON)> credential (modern MPP draft-00 mode)

MPP support: the macaroon parameter is optional. When you omit it, the tool operates in MPP (Machine Payments Protocol) mode — some paid APIs issue a plain Lightning invoice and accept the payment preimage alone as the access token, with no macaroon involved. Provide the macaroon for standard L402 challenges; omit it when the challenge only gave you an invoice.

Modern Payment challenges (v1.24.0+): for APIs using the current MPP draft-00 wire format (draft-httpauth-payment-00), pass the raw challenge header via the optional challengeHeader (.NET) / challenge_header (Python) parameter. The tool runs client-side safety checks before paying (expiry, intent: charge, sat currency, declared amount must agree with the invoice) and returns the single-use modern credential, which is never cached or replayed. access_l402_resource handles modern Payment challenges automatically and surfaces the server's Payment-Receipt header in its result (paymentReceipt — payment hash only, never the preimage).


Reference Tools​

These tools look things up and never pay, so they don't need a wallet that returns a preimage. docs needs no wallet at all.

discover_api​

Search the L402 API registry to find available paid APIs by keyword or category, or fetch a specific API's manifest for full endpoint details and pricing.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringNo-Search the registry by keyword (e.g., "weather", "ai")
categorystringNo-Filter registry results by category
urlstringNo-Fetch a specific API's manifest directly
budgetAwareboolNotrueAnnotate results with affordable call counts

Example — Search the registry:

User: Find me some weather APIs I can pay for

Claude: [Uses discover_api with query="weather"]

Found 3 weather APIs in the L402 registry:

1. Weather Data API — 5 sats/request (1,600 calls affordable)
2. Storm Tracker Pro — 25 sats/request (320 calls affordable)
3. Climate Analytics — 100 sats/request (80 calls affordable)

Want me to get full details on any of these?

Example — Get full manifest:

User: Show me the full details for Weather Data API

Claude: [Uses discover_api with url="https://api.lightningenable.com/l402/proxy/weather-api/.well-known/l402-manifest.json"]

Weather Data API — 3 endpoints:
- GET /v1/current — Current weather (5 sats)
- GET /v1/forecast — 7-day forecast (10 sats)
- GET /v1/historical — Historical data (25 sats)

Registry URL: Defaults to https://api.lightningenable.com. Override with L402_REGISTRY_URL or LIGHTNING_ENABLE_API_URL environment variable.

Manifest probing (v1.24.1+): when you pass a base url, the tool probes /.well-known/l402-manifest.json, /.well-known/l402.json, /l402-manifest.json, and /l402.json in order, and only accepts documents that actually describe a service or its endpoints (protocol signposts are skipped).


docs​

Search or read the Lightning Enable documentation from inside the MCP server, so an agent can answer "how do I connect an NWC wallet?" or "what does payment_provider_not_configured mean?" without web access. Needs no wallet and no API key. Requires MCP 2.2.0 or later.

The tool reads llms-full.txt, the whole docs site in one file, and keeps it in memory for an hour. If a refresh fails, it answers from the copy it already has and marks the result stale: true with a warning. If it has no copy yet, the error names the URL it tried, and the tool waits a minute before trying again. Redirects are not followed: a redirect is reported as an error, so point LIGHTNING_ENABLE_DOCS_URL at the final URL.

action="search": returns the best-matching sections for a free-text query.

ParameterTypeRequiredDefaultDescription
actionstringYes-search
querystringYes-Free text, for example nwc connection string
limitintNo5Number of results, 1 to 20

Each result has title (page title, and the heading when the match is a section), path, url (with the heading's anchor), section (the heading text, to pass to read), and snippet. Ranking counts how often the query's words appear in each section, and a word in the section's title counts five times as much as one in its body.

action="read": returns one page, or one section of it with its subsections, as text.

ParameterTypeRequiredDefaultDescription
actionstringYes-read
pathstringYes-A docs path such as /nwc-setup/account-setup. A full docs URL also works, and a #anchor on it selects a section
sectionstringNowhole pageHeading text, for example Troubleshooting

The result has title, path, url, section, text, truncated, and sections (the page's headings, so you can read a long page one section at a time). text is capped at 12,000 bytes; when it is cut, truncated is true and a hint points at sections. An unknown path returns an error with suggested paths; an unknown section returns the page's headings.

Example:

User: My NWC invoices never confirm. What should I check?

Claude: [Uses docs with action="search", query="nwc invoices never confirm"]
Claude: [Uses docs with action="read", path="/nwc-setup/account-setup", section="Troubleshooting"]

[Answers from the Troubleshooting section of the NWC setup guide, and links to it]

Source URL: defaults to https://docs.lightningenable.com/llms-full.txt. Override it with LIGHTNING_ENABLE_DOCS_URL: an https:// URL, http:// on localhost, or a local file:// path (file:///path or file://localhost/path; network shares are refused).


l402_producer​

The producer side of L402: everything your agent needs to charge other agents and users, configure where payments land, and stand up a monetized endpoint, selected with action. Every action requires LIGHTNING_ENABLE_API_KEY. A Free Producer Sandbox key works, within that plan's caps (3 endpoints, 200 challenges a month, 1,000 sats per challenge). No key yet? create_lightning_enable_account creates one.

Agents That Earn

The consumer tools above let agents spend. l402_producer lets an agent earn — including setting up the whole receive path itself. Together, they enable true agent-to-agent commerce — AI agents that autonomously buy and sell services using Lightning payments. See Sell With Your Agent for the full end-to-end walkthrough that chains every action below.

actionReplacesDoes
createcreate_l402_challengeMint a Lightning invoice + macaroon to charge for a resource
verifyverify_l402_paymentVerify an L402 token (macaroon + preimage) before granting access
configure_receive(new)Point payouts at your own NWC wallet (pass nwcConnectionString, or omit it to reuse this server's NWC wallet)
status(new)Read the plan, wallet, setup checklist, and recent mints (read-only)
create_proxy(new)Wrap an existing API in an L402-gated proxy
add_endpoint(new)Register a specific path, method, price, and description in the proxy's manifest
publish(new)Enable the manifest and, optionally, list the proxy in the public L402 registry
list_challenges(new)Read back the challenge feed — what's been minted and what's been paid

action="create"​

Create an L402 payment challenge (Lightning invoice + macaroon) to charge another agent or user.

Parameters:

ParameterTypeRequiredDefaultDescription
resourcestringYes-Resource identifier (URL, service name, or description)
priceSatslongYes-Price in satoshis to charge
descriptionstringNonullDescription shown on the Lightning invoice

Example:

User: Charge 50 sats for access to the forecast data

Claude: [Uses l402_producer with action="create"]

L402 challenge created!
- Invoice: lnbc500n1p3xyza...
- Price: 50 sats
- Resource: /api/weather/forecast

Share the invoice with the payer. After they pay,
use l402_producer with action="verify" to confirm before granting access.

Response:

{
"success": true,
"challenge": {
"invoice": "lnbc500n1p3xyza...",
"macaroon": "AgELbGlnaHRuaW5n...",
"paymentHash": "abc123def456...",
"expiresAt": "2026-03-13T14:30:00Z"
},
"resource": "/api/weather/forecast",
"priceSats": 50,
"message": "L402 challenge created for 50 sats. Share the invoice with the payer."
}

action="verify"​

Verify an L402 token (macaroon + preimage) to confirm payment was made before granting access.

Parameters:

ParameterTypeRequiredDefaultDescription
macaroonstringYes-Base64-encoded macaroon from the L402 token
preimagestringYes-Hex-encoded preimage (proof of payment)

Example:

User: The agent sent this L402 token — verify it

Claude: [Uses l402_producer with action="verify"]

Payment verified! The payer paid 50 sats for /api/weather/forecast.
Granting access now.

Response (valid):

{
"success": true,
"valid": true,
"resource": "/api/weather/forecast",
"message": "Payment verified. The payer has paid — you can now grant access to the resource."
}

Response (invalid):

{
"success": true,
"valid": false,
"message": "Payment verification failed. The token is invalid or the invoice has not been paid. Do NOT grant access."
}
Always Verify

Never grant access based on a payer claiming they paid. Always call l402_producer with action="verify" to cryptographically confirm payment before granting access.

action="configure_receive", "status", "create_proxy", "add_endpoint", "publish", "list_challenges"​

These six actions are new — there is no legacy single-purpose tool they rename. Together they let an agent take an API from "not connected to Lightning Enable at all" to "live, priced, and discoverable" without the dashboard:

  • configure_receive — wraps PUT /api/merchant/nwc-connection.
  • status — wraps GET /api/merchant/quickstart; confirm the receive lane actually took before anything downstream depends on it.
  • create_proxy — wraps POST /api/proxy.
  • add_endpoint — wraps POST /api/proxy/{proxyId}/manifest/endpoints.
  • publish — wraps PUT /api/proxy/{proxyId}/manifest/settings.
  • list_challenges — wraps GET /api/l402/challenges.

Full parameters, request/response shapes, and a worked example chaining all eight actions (including create/verify above) are in Sell With Your Agent; the underlying REST contract for each is in the Producer API Reference and Proxy Configuration.

See L402 Producer API for the complete producer guide with end-to-end examples.


agent_services​

Agent Service Agreements (ASA) over Nostr, live at wss://agents.lightningenable.com and nostrwolfe.com. Agents discover each other's services, request one, settle it through an L402 payment, and review it (flow: discover → request → settle → attest). discover, settle, and reputation work with just a wallet; request, publish, unpublish, and attest require LIGHTNING_ENABLE_API_KEY.

actionReplacesPurposeAPI key
requestrequest_agent_serviceEntry point. Sends a service request (kind 38401 event) referencing the provider's capability.Required
discoverdiscover_agent_servicesDiscover agent capabilities on Nostr by category, hashtag, or keyword (kind 38400 events).—
settlesettle_agent_serviceSettle an agreement via L402 payment (consumer/requester side) using the same auto-pay flow as access_l402_resource.—
publishpublish_agent_capabilityCreate an L402 proxy for your service and prepare its listing (kind 38400 event). The listing goes live only after you verify ownership of the target; until then the response has published: false.Required
unpublishunpublish_agent_capabilityTake a published listing down: retires the L402 proxy and publishes a NIP-09 deletion plus a status=removed replacement, so other agents stop seeing a dead listing.Required
attestpublish_agent_attestationPublish a review (rating 1–5) for an agent after a completed agreement (kind 38403 event) to build its reputation.Required
reputationget_agent_reputationFetch an agent's reputation score and reviews (queries kind 38403 attestations for a pubkey).—

action="request"​

Sends a service request (kind 38401 event) referencing the provider's capability. The full ASA flow is discover → request → settle → attest. If the provider has an L402 endpoint, you can skip this step and use action="settle" directly.

ParameterTypeRequiredDefaultDescription
capabilityEventIdstringYes-Event ID of the capability to request
budgetSatsintYes-Maximum budget in satoshis
parametersstringNo-Additional parameters as JSON

action="discover"​

ParameterTypeRequiredDefaultDescription
categorystringNo-Filter by service category (e.g., ai, data, translation)
hashtagsstring[]No-Filter by hashtags
querystringNo-Search query
limitintNo20Maximum results to return

action="settle"​

Pays the L402 endpoint specified in the agreement, completing the service transaction. If you are the provider (selling a service), use l402_producer with action="create" to generate an invoice and action="verify" to confirm payment instead.

ParameterTypeRequiredDefaultDescription
l402EndpointstringYes-L402 endpoint URL from the service agreement
methodstringNoGETHTTP method (GET, POST)
bodystringNo-Optional request body for POST requests
agreementIdstringNo-Agreement event ID for tracking
maxSatsintNo1000Maximum satoshis to pay

action="publish"​

Creates an L402 proxy for your target API and prepares its kind 38400 listing, but doesn't publish it yet. Other agents can't discover the service until you verify that you own the target. The response has published: false, reason: "ownership_verification_required", a verifyEndpoint, and a one-time verification.token with instructions. Save the token: it isn't shown again. Place the token as the instructions describe, call POST /api/proxy/{proxyId}/verify, and then list the proxy with PUT /api/proxy/{proxyId}/manifest/settings and "manifestPubliclyListed": true. The proxy works by its direct L402 URL the whole time. See Verify ownership to list publicly.

ParameterTypeRequiredDefaultDescription
serviceIdstringYes-Unique service identifier (used as d-tag). An ID that starts with shopify is reserved for the Shopify integration and returns 400 reserved_proxy_id.
categoriesstring[]Yes-Service categories (e.g., ['ai', 'translation'])
contentstringYes-Description of the service
priceSatsintYes-Price per request in satoshis
l402EndpointstringNo-L402 endpoint URL for payment settlement
targetUrlstringYes-Target API URL. Publish always creates an L402 proxy for it, so a request without it returns 400.
hashtagsstring[]No-Hashtags for discoverability

action="unpublish"​

Works for marketplace listings created via the L402 proxy/dashboard pipeline.

ParameterTypeRequiredDefaultDescription
serviceIdstringYes-The listing's identifier — its Nostr d-tag / proxy id
reasonstringNo-Optional free-text reason recorded on the removal event

action="attest"​

ParameterTypeRequiredDefaultDescription
subjectPubkeystringYes-Pubkey of the agent being reviewed
agreementIdstringYes-Event ID of the agreement this review is for
ratingintYes-Rating from 1–5
contentstringYes-Free-text review content

action="reputation"​

ParameterTypeRequiredDefaultDescription
pubkeystringYes-Pubkey of the agent to query reputation for
limitintNo20Maximum number of attestations to return

Wallet Configuration​

Set one wallet with environment variables in your MCP client config, or with the wallets block of ~/.lightning-enable/config.json (environment variables win). Per-wallet steps are in Wallet Configuration and LND Node Setup.

WalletEnvironment variablesConfig keysReturns preimage (L402)
LNDLND_REST_HOST, LND_MACAROON_HEXlndRestHost, lndMacaroonHexYes
NWC (CoinOS, CLINK, Alby Hub)NWC_CONNECTION_STRINGnwcConnectionStringYes
NWC (Primal)NWC_CONNECTION_STRINGnwcConnectionStringNo
StrikeSTRIKE_API_KEYstrikeApiKeyYes
OpenNodeOPENNODE_API_KEY, OPENNODE_ENVIRONMENTopenNodeApiKey, openNodeEnvironmentNo

When several are configured, the server picks LND > NWC > Strike > OpenNode. Override with WALLET_PRIORITY or wallets.priority (lnd, nwc, strike, or opennode).


Budget Configuration​

Spending limits live in ~/.lightning-enable/config.json, which the server creates on first run. In MCP 2.2.0+ the .NET and Python servers both write this file, and fall back to the same values for any key an existing file omits:

{
"currency": "USD",
"tiers": {
"autoApprove": 0.10,
"logAndApprove": 1.00,
"formConfirm": 10.00,
"urlConfirm": 100.00
},
"limits": {
"maxPerPayment": 500.00,
"maxPerSession": 100.00
},
"session": {
"cooldownSeconds": 2,
"requireApprovalForFirstPayment": true
}
}

Both formConfirm and urlConfirm need the same out-of-band confirmation code; if your client supports MCP elicitation, a payment above formConfirm also asks you to retype the amount. An explicit null on a limit means no limit. Tiers out of ascending order are clamped down to the tier above them, never raised. An omitted USD limit still applies when you set only sats limits, so write "maxPerPayment": null, "maxPerSession": null to rely on the sats limits alone. session.cooldownSeconds is the minimum gap between payments; session.requireApprovalForFirstPayment asks for a confirmation code on the first payment of every session. Add a confirmation block to choose where codes go (see Out-of-Band Confirmation).

A hosted container (LIGHTNING_ENABLE_HOSTED=1) with no confirmation channel can't pay until you mount a config, turn off first-payment approval, or set a webhook or file channel; the server prints a startup warning in that state. The auto-pay paths (L402 auto-payment, wallet_ops send_onchain, agent_services settle) never prompt, so while first-payment approval is on they refuse a session's first payment on any channel; only session.requireApprovalForFirstPayment: false unblocks them.

Approval Tiers​

With the defaults above:

Amount (USD)Behavior
First payment of a session (any amount)Needs a confirmation code while requireApprovalForFirstPayment is true
≤ autoApprove ($0.10)Paid without asking
≤ logAndApprove ($1.00)Paid and logged
Above logAndApproveNeeds an out-of-band confirmation code (see below)
Above maxPerPayment ($500), or over maxPerSession ($100) in totalRefused

Sats-Native Budgets​

The USD values above are converted to sats at payment time from a live BTC price feed. If no price source answers, a USD check refuses the payment rather than guessing. To set limits directly in sats, add the sats keys under limits:

{
"limits": {
"maxPerPaymentSats": 50000,
"maxPerSessionSats": 200000,
"autoApproveSats": 1000
}
}

You can set USD and sats limits together; the stricter one wins on every check. A sats limit needs no price feed, so it keeps working during a price-feed outage. The environment variables LIGHTNING_ENABLE_MAX_PER_PAYMENT_SATS, LIGHTNING_ENABLE_MAX_PER_SESSION_SATS, and LIGHTNING_ENABLE_AUTO_APPROVE_SATS set the same three values and override the file.

Out-of-Band Confirmation​

When a payment needs confirmation, the server delivers a code over one of four channels, set with confirmation.channel in the config file or LIGHTNING_ENABLE_CONFIRMATION_CHANNEL:

confirmation.channelWhere the code goesUse it when
stderr (default)The server's console/stderr — the channel a human operator watching the terminal seesInteractive local use — Claude Code, Claude Desktop, a terminal session
refuseNowhere — the payment is refused outright rather than printed anywhereNon-interactive / hosted contexts where nothing reads stderr, so printing a code there would be silently lost (or worse, readable by the wrong process)
webhookPOSTed to confirmation.webhookUrl (signed with confirmation.webhookSecret)A human is notified out-of-band (chat app, pager) rather than watching a terminal
fileWritten to confirmation.filePathHeadless or scheduled runs where no one is watching in real time

A code expires after confirmation.ttlSeconds (default 120 seconds, maximum 15 minutes); 300-600 suits the webhook and file channels. An unrecognized channel name refuses payments rather than falling back to stderr.

LIGHTNING_ENABLE_HOSTED=1 changes the default: when it is set and stdin is not a terminal, the channel defaults to refuse instead of stderr, because in a hosted, non-interactive deployment nobody is guaranteed to be watching stderr. Set the channel explicitly to webhook or file to deliver codes there instead. In every case the code is never returned in a tool result, so a prompt-injected agent can't read its own code and approve its own payment.

The flow (channels other than refuse):

  1. The agent calls the payment tool (pay_invoice, access_l402_resource, pay_l402_challenge, or wallet_ops with action="send_onchain"); the response says confirmation is required — without the code.
  2. The server delivers the code over the configured channel, where you read it.
  3. You give the code to the AI, which re-calls the original payment tool with the confirmationNonce (.NET) / confirmation_nonce (Python) parameter. The separate verify_confirmation_code tool only verifies a code — it never executes a payment.

Codes are bound to the exact amount, tool, and destination (invoice, URL, or on-chain address), so a code can't be reused for a different payment. wallet_ops with action="send_onchain" always requires a code (on-chain sends are irreversible) and fails closed if the budget service is unavailable.

No MCP tool can raise a limit: budget(action="tighten") only lowers the runtime caps, and setup_wallet writes only the wallet entry. These guarantees assume the agent can't read the server's stderr or edit files on its host; see AI Spending Security for that boundary.


Environment Variables Reference​

VariableRequiredDefaultDescription
STRIKE_API_KEYIf using Strike-Strike API key
OPENNODE_API_KEYIf using OpenNode-OpenNode API key
OPENNODE_ENVIRONMENTNoproductionproduction or dev
NWC_CONNECTION_STRINGIf using NWC-Nostr Wallet Connect URI
LND_REST_HOSTIf using LND-LND REST API host
LND_MACAROON_HEXIf using LND-LND admin macaroon in hex
LND_TLS_CERT_PATHNo-Path to the node's tls.cert (PEM or DER). Needed for LND's self-signed certificate
LND_SKIP_TLS_VERIFYNofalsetrue skips LND TLS verification (development only)
LND_PAYMENT_TIMEOUT_SECONDSNo25How long an LND payment may stay in flight before it is reported as pending
LND_FEE_LIMIT_SATSNo5% of the invoice (minimum 2 sats)Fixed routing-fee ceiling per LND payment
WALLET_PRIORITYNolnd > nwc > strike > opennodeForce a specific wallet when several are configured (e.g., nwc)
LIGHTNING_ENABLE_API_KEYFor l402_producer + some agent_services actions-Lightning Enable API key — required by every l402_producer action, and by the agent_services actions request/publish/unpublish/attest (discover/settle/reputation work without it). No key? create_lightning_enable_account provisions one for ~100 sats over Lightning
LIGHTNING_ENABLE_API_URLNohttps://api.lightningenable.comAPI base URL
L402_REGISTRY_URLNofalls back to LIGHTNING_ENABLE_API_URLRegistry endpoint used by discover_api
LIGHTNING_ENABLE_DOCS_URLNohttps://docs.lightningenable.com/llms-full.txtSource the docs tool reads: an https:// URL, http:// on localhost, or a file:// path
LIGHTNING_ENABLE_TOOL_PROFILENostandardlite, standard, or full — see Tool Profiles
LIGHTNING_ENABLE_HOSTEDNounset1 in a non-interactive/hosted deployment: the confirmation channel defaults to refuse. See Out-of-Band Confirmation
LIGHTNING_ENABLE_CONFIRMATION_CHANNELNostderrstderr, refuse, webhook, or file; overrides confirmation.channel
LIGHTNING_ENABLE_CONFIRMATION_WEBHOOK_URL / _WEBHOOK_SECRET / _FILE / _TTL_SECONDSNo-Override the matching confirmation.* config keys
LIGHTNING_ENABLE_MAX_PER_PAYMENT_SATS / _MAX_PER_SESSION_SATS / _AUTO_APPROVE_SATSNo-Sats limits; override the matching limits.*Sats config keys. See Sats-native budgets

The L402_MAX_SATS_PER_REQUEST and L402_MAX_SATS_PER_SESSION variables from older releases were removed and have no effect.

The first time the server writes ~/.lightning-enable/config.json, it restricts the file to your user (chmod 0600 on macOS and Linux, icacls on Windows). If that fails, it prints a warning to stderr; restrict the file yourself.


Security Best Practices​

  1. Use a dedicated wallet with only what you are willing to lose.
  2. Set budget limits in ~/.lightning-enable/config.json before first use.
  3. Review receipts (receipts with source="durable") after sessions.
  4. Never commit keys or connection strings to version control.

See AI Spending Security for the threat model and incident response.


Troubleshooting​

"Wallet not configured"​

Set one of: STRIKE_API_KEY, NWC_CONNECTION_STRING, LND_REST_HOST+LND_MACAROON_HEX, or OPENNODE_API_KEY

"Budget limit exceeded"​

Payment exceeds your limits. Use budget with action="status" to see current limits, edit config file to adjust.

"Tool not found" after upgrading​

An old name like configure_budget or create_l402_challenge still dispatches under every profile until v3.0.0, but standard and lite don't list it, so an agent that picks tools from the server's listing won't see it. Switch the prompt or integration to the consolidated tool (budget(action="tighten"), l402_producer(action="create"), …), or set LIGHTNING_ENABLE_TOOL_PROFILE=full to list the legacy names as deprecated aliases. From v3.0.0 the old names are removed and only the consolidated tools work. See Tool Profiles and Deprecated aliases.

"Feature not supported"​

Some features are wallet-specific (for example, BTC price is Strike-only). Check Tool Availability by Wallet.

"L402 payment succeeded but access failed"​

Your wallet doesn't return preimage. Use LND, CoinOS, CLINK, Alby Hub, or Strike. OpenNode and Primal don't work for L402 (no preimage return).


Try It: Lightning Enable Store​

The Lightning Enable Store is a live L402-powered web store where AI agents can purchase physical merchandise using Bitcoin Lightning payments.

Ask Claude: "Buy me a Lightning Enable t-shirt from store.lightningenable.com"

This demonstrates the full L402 flow:

  1. Browse catalog — GET /api/store/catalog
  2. Checkout — POST /api/store/checkout (returns HTTP 402 with invoice + macaroon)
  3. Pay invoice — Use pay_invoice with the BOLT11 string
  4. Claim order — POST /api/store/claim with L402 credential

Next Steps​

Stuck?​

Start with Troubleshooting for the common failures and their fixes. If something's broken or not working, email support@lightningenable.com — a real person reads it.