LND Node Setup Guide
This guide covers connecting the Lightning Enable MCP server to your own LND (Lightning Network Daemon) node. LND always returns the preimage, making it the most reliable option for L402 authentication.
Why Use Your Own LND Node?
| Benefit | Description |
|---|---|
| Guaranteed L402 | LND always returns preimage - L402 never fails due to wallet limitations |
| You Hold the Keys | You run the node — you control your funds, not a third party |
| No API Limits | No provider rate limits or account restrictions |
| No Third Party | No provider account sits between you and your funds |
LND is ideal for:
- Power users who already run Lightning nodes
- Businesses that need 100% L402 reliability
- Users who want to run the node and hold the keys themselves
- Developers testing L402 implementations
Prerequisites
You Need
-
A running LND node with:
- REST API enabled (default port 8080)
- Funded channels with outbound liquidity
- Admin macaroon access
-
Network access from your MCP server to LND:
- Same machine:
localhost:8080 - Local network:
192.168.x.x:8080 - Remote: use a VPN
- Same machine:
LND Installation Options
If you don't have LND yet:
| Platform | Recommended Approach |
|---|---|
| Start9 | Built-in LND package |
| Umbrel | Lightning app from store |
| RaspiBlitz | Included by default |
| Voltage | Cloud-hosted LND |
| Manual | LND Installation Guide |
Step 1: Enable LND REST API
LND's REST API is enabled by default on port 8080. Verify in your lnd.conf:
[Application Options]
# REST API (enabled by default)
restlisten=0.0.0.0:8080
# TLS settings
tlsextraip=0.0.0.0
tlsextradomain=your-domain.com
If you changed the port, note it for configuration.
Restart LND After Config Changes
# Stop LND
lncli stop
# Start LND (method depends on your setup)
lnd
# or
systemctl restart lnd
Step 2: Get Your Admin Macaroon
The macaroon is your authentication credential. You need the admin macaroon for payments.
Location by Platform
| Platform | Default Path |
|---|---|
| Linux | ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon |
| macOS | ~/Library/Application Support/Lnd/data/chain/bitcoin/mainnet/admin.macaroon |
| Windows | %LOCALAPPDATA%\Lnd\data\chain\bitcoin\mainnet\admin.macaroon |
| Start9 | SSH in, check /embassy-data/package-data/volumes/lnd/ |
| Umbrel | ~/umbrel/app-data/lightning/data/lnd/data/chain/bitcoin/mainnet/admin.macaroon |
| Docker | Inside container at /root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon |
Convert Macaroon to Hex
The MCP server needs the macaroon in hex format (not base64).
Linux/macOS:
xxd -ps -c 1000 ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
Windows PowerShell:
[System.BitConverter]::ToString([System.IO.File]::ReadAllBytes("$env:LOCALAPPDATA\Lnd\data\chain\bitcoin\mainnet\admin.macaroon")) -replace '-',''
Docker:
docker exec lnd xxd -ps -c 1000 /root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
The output looks like:
0201036c6e6402f801030a10b3b1a4d3e5f6789012345678901234561201...
Save this string - you'll need it for configuration.
Step 3: Test LND Connection
Before configuring the MCP server, verify LND is accessible:
# Test from the machine running MCP
curl --insecure \
-H "Grpc-Metadata-macaroon: YOUR_MACAROON_HEX" \
https://localhost:8080/v1/getinfo
You should see JSON output with your node info:
{
"identity_pubkey": "03abc...",
"alias": "MyNode",
"num_active_channels": 5,
...
}
Common Test Issues
| Error | Solution |
|---|---|
Connection refused | LND not running or REST not enabled |
certificate unknown | Use --insecure for this test; the MCP server needs LND_TLS_CERT_PATH (Step 4) |
permission denied | Wrong macaroon or insufficient permissions |
timeout | Firewall blocking port 8080 |
Step 4: Configure MCP Server
The "command": "lightning-enable-mcp" configurations on this page run the .NET global tool. Install it first with dotnet tool install -g LightningEnable.Mcp, which puts the lightning-enable-mcp command on your PATH.
LND serves REST over HTTPS with a self-signed certificate, so the MCP server must be told to trust it, even on localhost. Copy the node's tls.cert (for example ~/.lnd/tls.cert) to the machine running the MCP server and set LND_TLS_CERT_PATH to its path. LND_TLS_CERT_PATH is an environment variable only; there is no config-file key for it.
Option A: Environment Variables
{
"mcpServers": {
"lightning-enable": {
"command": "lightning-enable-mcp",
"env": {
"LND_REST_HOST": "localhost:8080",
"LND_MACAROON_HEX": "0201036c6e6402f801030a10...",
"LND_TLS_CERT_PATH": "/home/you/.lnd/tls.cert"
}
}
}
}
Option B: Config File
Add a wallets block to ~/.lightning-enable/config.json (the server creates the file on first run; keep its budget settings), and still set LND_TLS_CERT_PATH in the MCP client's env:
{
"wallets": {
"lndRestHost": "localhost:8080",
"lndMacaroonHex": "0201036c6e6402f801030a10b3b1a4d3e5f6789012345678901234561201...",
"priority": "lnd"
}
}
Environment variables override the config file.
Configuration Options
| Variable | Config Key | Description | Required |
|---|---|---|---|
LND_REST_HOST | lndRestHost | LND REST host and port (https:// is assumed) | Yes |
LND_MACAROON_HEX | lndMacaroonHex | Macaroon in hex | Yes |
LND_TLS_CERT_PATH | - | Path to the node's tls.cert (PEM or DER) | For a self-signed certificate |
LND_SKIP_TLS_VERIFY | - | true turns off certificate checks (development only) | No |
LND_PAYMENT_TIMEOUT_SECONDS | - | How long a payment may stay in flight before it is reported as pending (default 25) | No |
LND_FEE_LIMIT_SATS | - | Fixed routing-fee ceiling per payment (default 5% of the invoice, minimum 2 sats) | No |
WALLET_PRIORITY | priority | Set to lnd when several wallets are configured | Optional |
Step 5: Verify Connection
Restart your MCP client and check the MCP server's stderr output:
[LND] Initialized REST client for localhost:8080
Using LND wallet backend
LND always returns preimage - L402 fully supported
Test with a balance check:
User: Check my Lightning balance
Claude: [Uses get_balance]
Your LND balance: 500,000 sats
Remote LND Access
Same Local Network
{
"wallets": {
"lndRestHost": "192.168.1.100:8080"
}
}
Over VPN
- Connect both machines to same VPN
- Use VPN IP address:
{
"wallets": {
"lndRestHost": "10.8.0.1:8080"
}
}