Environment Variables
Lightning Enable is hosted at api.lightningenable.com; you never set its server configuration. You configure your account in the dashboard and with the merchant API.
The environment variables on this page configure the open-source (MIT) MCP server, which you run wherever your agent runs. Platform server settings are an operator concern and are documented in the API repository (appsettings.Example.json), not here.
MCP server configuration
Wallet Configuration
Wallet, invoice, L402, budget, and API-discovery tools work with just a wallet. Selling (l402_producer) and some agent_services actions also need LIGHTNING_ENABLE_API_KEY; see the table below.
Choose one wallet (listed in default priority order). You can also store wallet credentials in ~/.lightning-enable/config.json (the setup_wallet tool writes them there); an environment variable wins over the file.
LND (Best for L402):
LND_REST_HOST=https://your-lnd-node:8080
LND_MACAROON_HEX=your-admin-macaroon-hex
Nostr Wallet Connect (NWC):
NWC_CONNECTION_STRING=nostr+walletconnect://pubkey?relay=wss://relay.example.com&secret=xxx
Strike (Recommended for USD users):
STRIKE_API_KEY=your-strike-api-key
OpenNode:
OPENNODE_API_KEY=your-opennode-api-key
OPENNODE_ENVIRONMENT=production # or "dev" for testnet
If multiple wallet credentials are configured, they are used in this order:
- LND (if
LND_REST_HOSTandLND_MACAROON_HEXare set) - NWC (if
NWC_CONNECTION_STRINGis set) - Strike (if
STRIKE_API_KEYis set) - OpenNode (if
OPENNODE_API_KEYis set)
This order prioritizes wallets that return a preimage, which is required for L402. OpenNode does not return preimages, so L402 will not work with it. You can override the priority with the WALLET_PRIORITY environment variable (values: lnd, nwc, strike, opennode).
Only the first configured wallet is used.
Spending Limits Configuration
Budget limits are configured via ~/.lightning-enable/config.json:
{
"currency": "USD",
"tiers": {
"autoApprove": 0.10,
"logAndApprove": 1.00,
"formConfirm": 10.00,
"urlConfirm": 100.00
},
"limits": {
"maxPerPayment": 500.00,
"maxPerSession": 100.00
}
}
This file is created automatically on first run (or written by the setup_wallet tool). AI agents cannot modify this file through any MCP tool (an agent with direct shell or filesystem access to the host is outside this guarantee). At runtime, an agent can tighten its own caps via the budget tool's action="tighten" (formerly the standalone configure_budget tool), but it can never raise them above the limits in this file.
See AI Spending Security for detailed configuration.
MCP Configuration Summary
| Variable | Required | Default | Description |
|---|---|---|---|
LND_REST_HOST | If using LND | - | LND REST API host |
LND_MACAROON_HEX | If using LND | - | LND admin macaroon in hex |
LND_TLS_CERT_PATH | No | - | Path to the node's tls.cert; pins TLS to that certificate (use for self-signed certs) |
LND_SKIP_TLS_VERIFY | No | false | true disables TLS verification for the LND host. Prefer LND_TLS_CERT_PATH |
NWC_CONNECTION_STRING | If using NWC | - | Nostr Wallet Connect URI |
STRIKE_API_KEY | If using Strike | - | Strike API key (preferred for USD) |
OPENNODE_API_KEY | If using OpenNode | - | OpenNode API key with withdrawal permissions |
OPENNODE_ENVIRONMENT | No | production | production or dev |
WALLET_PRIORITY | No | - | Override default wallet priority (lnd, nwc, strike, or opennode) |
LIGHTNING_ENABLE_API_KEY | No | - | Merchant API key; required by every l402_producer action and the agent_services actions request/publish/unpublish/attest (discover/settle/reputation work without it) |
LIGHTNING_ENABLE_TOOL_PROFILE | No | standard | lite (pay and check the wallet only), standard (the full current surface), or full (standard plus every pre-consolidation tool name as a deprecated alias, removed in v3.0.0) — see the MCP Complete Guide |
LIGHTNING_ENABLE_HOSTED | No | unset | Set to 1 in a non-interactive/hosted deployment so out-of-band confirmation defaults to refusing (rather than printing to stderr) when the process isn't attached to a TTY — see AI Spending Security |
The credential Lightning Enable uses to receive payments for you (Strike key, OpenNode key, or NWC connection string) is saved in the dashboard (Settings → Payment Provider) or with the merchant API (PUT /api/merchant/strike-key, /opennode-key, /nwc-connection), never as an environment variable. The wallet variables above configure the MCP server's paying wallet only.
Next Steps
- MCP Complete Guide - Every tool and option
- Strike Setup - Configure the default payment provider
- Quick Start - Test your configuration