Lightning Enable MCP Server

v2.4.0
io.github.refined-element/lightning-enable-mcp Checked 1 day ago Published 19 days ago

AI agent Lightning payments: L402, invoices, wallets, API discovery, budgets, self-serve signup.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

setup_wallet

Report the wallet this server pays from, or connect one. Call with no arguments first - it also returns the setup steps when no wallet is configured.

ParameterTypeDescription
nwc_connection_stringstringNWC connection string (nostr+walletconnect://...). Omit to just report.

access_l402_resource

Fetch a URL with GET or HEAD, automatically paying any L402 challenge and retrying. Read-only: other HTTP methods are refused. Returns the response plus what was paid.

ParameterTypeDescription
url *stringURL to fetch
bodystringOptional request body (rarely needed)
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
headersobjectExtra headers
max_satsintegerMax sats to pay
methodstringGET or HEAD only (paid HTTP is read-only)

pay_invoice

Pay a BOLT11 Lightning invoice directly and get the preimage as proof.

ParameterTypeDescription
invoice *stringBOLT11 invoice to pay
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
max_satsintegerMax sats to pay

pay_l402_challenge

Pay an L402 or MPP invoice yourself and get the authorization token. Omit macaroon for MPP; pass challenge_header for a draft-00 Payment challenge.

ParameterTypeDescription
challenge_headerstringRaw WWW-Authenticate value of a 'Payment' challenge; draft-00 yields a single-use credential.
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
invoicestringBOLT11 invoice. Optional if challenge_header carries one.
macaroonstring | nullBase64 macaroon from the challenge. Omit for MPP.
max_satsintegerMax sats to pay

test_l402_payment

Self-test the wallet by paying the public 1-sat L402 test endpoint end to end. A 'needs_confirmation' verdict means the server printed a code to its console; re-run with confirmation_nonce.

ParameterTypeDescription
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.

get_balance

Get the connected wallet's balance in sats, plus all currency balances and wallet info where the wallet reports them.

budget

View or tighten this session's spending limits. Tightening is one-way - an agent can lower its caps but never raise the operator's config limits.

ParameterTypeDescription
action *stringstatus: read limits, tiers and session spend. tighten: lower the runtime sats caps.
per_requestintegertighten: max sats per request
per_sessionintegertighten: max sats per session

receipts

List payments this wallet made. The durable log persists across restarts and says how to revoke the wallet; the session list is in-memory only.

ParameterTypeDescription
source *stringdurable: the append-only log at ~/.lightning-enable/receipts.jsonl. session: payments since startup.
limitintegerMax entries (durable clamps to 1-200)
sincestringsession: ISO timestamp to filter from

create_invoice

Create a BOLT11 Lightning invoice to receive a payment.

ParameterTypeDescription
amount_sats *integerSatoshis to receive
expiry_secsintegerExpiry in seconds
memostringInvoice memo

check_invoice_status

Check whether an invoice from create_invoice has been paid.

ParameterTypeDescription
invoice_id *stringInvoice ID from create_invoice

verify_confirmation_code

Check whether a payment confirmation code is still valid and what it authorizes. Verification ONLY - it never pays; to pay, re-call the payment tool with confirmation_nonce.

ParameterTypeDescription
nonce *stringThe 6-character code from the payment request

discover_api

Discover L402 APIs: search the registry with query/category, or fetch one API's manifest with url.

ParameterTypeDescription
budget_awarebooleanAnnotate endpoints with affordable call counts
categorystringRegistry category filter, e.g. 'ai'
querystringRegistry keyword search, e.g. 'weather'
urlstringBase URL of an L402 API, or a manifest URL. Omit to search the registry.

docs

Search or read the Lightning Enable docs. search: query -> sections. read: path, optional section -> text.

ParameterTypeDescription
action *string
limitintegerdefault 5, max 20
pathstringe.g. /nwc-setup/account-setup
querystring
sectionstringheading text

create_lightning_enable_account

Self-bootstrapping signup: pay a ~100-sat activation fee for a Lightning Enable merchant API key. Needs only a wallet; the key is saved to ~/.lightning-enable/config.json.

ParameterTypeDescription
email *stringEmail to register
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
max_satsintegerMax sats for the ~100-sat fee

wallet_ops

Wallet operations beyond invoices: BTC price, currency exchange, on-chain sends. Strike only (send_onchain also works on LND).

ParameterTypeDescription
action *stringprice: BTC/USD. exchange: convert currency in your wallet. send_onchain: irreversible - ALWAYS needs confirmation_nonce, so the first call only prints a code to the server console.
addressstringsend_onchain: destination address
amountnumberexchange: amount in source_currency
amount_satsintegersend_onchain: satoshis to send
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
intent_idstringsend_onchain: optional idempotency scope. Omit for normal use. Supply a NEW value only when you intentionally need to pay the same address the same amount again; a repeat with the same address, amount…
source_currencystringexchange: from, USD or BTC
target_currencystringexchange: to, BTC or USD

l402_producer

Sell access with L402: charge for your API or monetize an endpoint. sell_url turns a URL and a Lightning Address into a paid endpoint in one call, paid from this wallet, no account needed. verify with proxy_id proves domain ownership to get listed. Other actions need LIGHTNING_ENABLE_API_KEY.

ParameterTypeDescription
action *stringcreate: mint an invoice + macaroon challenge. verify: check a payer's token before granting access, or with proxy_id your API ownership. configure_receive: point payouts at your own NWC wallet. status…
accept_termsstringsell_url: terms version the operator accepted; omit for the quote
categoriesarraypublish: registry categories
challenge_statusstringlist_challenges: filter; omit for all
confirmation_noncestringsell_url: code the human reads off the server console; omit to request one
default_price_satsintegercreate_proxy/sell_url: per-call price buyers pay
descriptionstringcreate: invoice text; create_proxy/sell_url: what the API does
endpoint_idstringadd_endpoint: stable id for the route
http_methodstringadd_endpoint: GET, POST, ... (default GET)
lightning_addressstringsell_url: name@domain paid per call
limitintegerstatus/list_challenges: max rows
list_publiclybooleansell_url: list once verified
macaroonstringverify: base64 macaroon
methodstringverify*: well-known, dns-txt or header
namestringcreate_proxy/sell_url: service name
nwc_connection_stringstringconfigure_receive: nostr+walletconnect:// string; omit to reuse this server's own NWC wallet
offsetintegerlist_challenges: rows to skip
pathstringadd_endpoint: route path like /forecast
preimagestringverify: hex preimage
price_satsintegercreate/add_endpoint: price in sats
proxy_idstringadd_endpoint/publish/verify*: proxy id
recovery_emailstringsell_url: recovery email
recovery_nostr_pubkeystringsell_url: recovery Nostr pubkey, hex
reissuebooleanverification_token: rotate a verified token
resourcestringcreate: URL or name you are charging for
service_descriptionstringpublish: registry description
service_namestringpublish: rename the listed service
summarystringadd_endpoint: one-line summary
target_base_urlstringcreate_proxy: https:// base URL to monetize
target_urlstringsell_url: https URL to sell

agent_services

Agent Service Agreements over Nostr: discover, request, settle, publish and review agent services. Requires LIGHTNING_ENABLE_API_KEY (review/reviews/reviewer_key do not).

ParameterTypeDescription
action *stringdiscover: search listings. request: ask for a service. settle: PAY an agreement's L402 endpoint. publish: list your service once; to change it, unpublish then publish. unpublish: remove it. attest/rep…
agreement_idstringsettle/attest/review: agreement id
allow_unknown_paymentbooleanreview: unrecorded proof, unbacked
bodystringsettle: request body
budget_satsintegerrequest: max sats
capability_event_idstringrequest: capability event id
categoriesarraypublish: categories
categorystringdiscover: category
checksobjectreview: {responded,on_time,well_formed,price_honored}: bool
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
contentstringpublish: service text; attest/review: note (never prompt/response)
hashtagsarraydiscover/publish: hashtags
l402_endpointstringsettle/publish/review(s): L402 endpoint
limitintegerdiscover/reputation: max results
max_satsintegersettle: max sats
methodstringsettle: HTTP method
parametersstringrequest: extra params, JSON string
price_satsintegerpublish: price per request
proofstringattest: preimage hash; review: payment hash
pubkeystringreputation: agent pubkey
querystringdiscover: keyword
ratingintegerattest: 1-5; review: quality 1-5
reasonstringunpublish: reason
service_idstringpublish/unpublish: listing d-tag
subject_pubkeystringattest/review(s): subject pubkey
target_urlstringpublish: API URL to wrap in a new L402 proxy

renew_lightning_enable_subscription

Pay the L402 invoice that buys or extends 30 days of Lightning Enable Agentic Commerce for the configured API key. Needs a preimage-capable wallet.

ParameterTypeDescription
confirmation_noncestringCode the human reads off the server console (never returned to you). Omit to request one.
max_satsintegerMax sats to pay