# Lightning Enable MCP Server

Hands your agent a Lightning wallet: BOLT11 invoice payments, L402 API access, budgets and receipts. Useful when the agent pays for APIs on its own.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: refined-element
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/refined-element/lightning-enable-mcp
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/lightning-enable-mcp-server

## What it does

This server wires Lightning Network tools into an agent. It pays BOLT11 invoices, settles L402 challenges automatically when a paid API is called, searches the L402 registry by keyword or category, and pulls a single API's manifest with endpoints and prices. A second group covers spend tracking: budget caps, a receipt log, balance checks. There is also the receiving side — invoice creation, BTC price, currency exchange, on-chain sends through Strike.

No wallet means nothing runs, so the first step is `setup_wallet`. The quickest route is NWC: create a Nostr Wallet Connect connection in your wallet app (Alby Hub, CoinOS, any NIP-47 wallet), hand the `nostr+walletconnect://` string to the agent, and it validates the string, connects to prove the wallet answers, then writes it to `~/.lightning-enable/config.json` with permissions limited to your user. Restart the server afterwards. Environment variables work too: `STRIKE_API_KEY`, `NWC_CONNECTION_STRING`, `LND_REST_HOST` plus `LND_MACAROON_HEX`. Priority runs LND, then NWC, Strike, OpenNode, and env vars beat the config file — `setup_wallet` refuses to write a string an env var would override and names the variable to unset.

L402 needs a wallet that returns the payment preimage. OpenNode does not, so it only covers invoicing and direct payments; making it your only wallet breaks the main use case.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `STRIKE_API_KEY`, `NWC_CONNECTION_STRING`, `LND_REST_HOST`, `LND_MACAROON_HEX`, `OPENNODE_API_KEY`, `OPENNODE_ENVIRONMENT`, `LIGHTNING_ENABLE_API_KEY`, `LIGHTNING_ENABLE_TOOL_PROFILE`, `AGENT_RELAY_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add lightning-enable-mcp -e STRIKE_API_KEY=<STRIKE_API_KEY> -e NWC_CONNECTION_STRING=<NWC_CONNECTION_STRING> -e LND_MACAROON_HEX=<LND_MACAROON_HEX> -e OPENNODE_API_KEY=<OPENNODE_API_KEY> -e LIGHTNING_ENABLE_API_KEY=<LIGHTNING_ENABLE_API_KEY> -- uvx lightning-enable-mcp
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from lightning-enable-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add lightning-enable-mcp-server --env STRIKE_API_KEY=<STRIKE_API_KEY> --env NWC_CONNECTION_STRING=<NWC_CONNECTION_STRING> --env LND_REST_HOST=<LND_REST_HOST> --env LND_MACAROON_HEX=<LND_MACAROON_HEX> --env OPENNODE_API_KEY=<OPENNODE_API_KEY> -- uvx lightning-enable-mcp
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from lightning-enable-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "lightning-enable-mcp-server": {
            "command": "uvx",
            "args": [
                "lightning-enable-mcp"
            ],
            "env": {
                "STRIKE_API_KEY": "<STRIKE_API_KEY>",
                "NWC_CONNECTION_STRING": "<NWC_CONNECTION_STRING>",
                "LND_REST_HOST": "<LND_REST_HOST>",
                "LND_MACAROON_HEX": "<LND_MACAROON_HEX>",
                "OPENNODE_API_KEY": "<OPENNODE_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from lightning-enable-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "lightning-enable-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "lightning-enable-mcp"
            ],
            "env": {
                "STRIKE_API_KEY": "<STRIKE_API_KEY>",
                "NWC_CONNECTION_STRING": "<NWC_CONNECTION_STRING>",
                "LND_REST_HOST": "<LND_REST_HOST>",
                "LND_MACAROON_HEX": "<LND_MACAROON_HEX>",
                "OPENNODE_API_KEY": "<OPENNODE_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from lightning-enable-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e STRIKE_API_KEY=<STRIKE_API_KEY> -e NWC_CONNECTION_STRING=<NWC_CONNECTION_STRING> -e LND_REST_HOST=<LND_REST_HOST> -e LND_MACAROON_HEX=<LND_MACAROON_HEX> -e OPENNODE_API_KEY=<OPENNODE_API_KEY> lightning-enable-mcp-server uvx lightning-enable-mcp
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from lightning-enable-mcp <command>

## When to use it
- pay a BOLT11 invoice from inside the agent
- clear an L402 challenge on a paid API without manual steps
- find a paid API in the L402 registry by category
- keep a spend cap and a receipt log
- issue an invoice to receive a payment

## Example prompts
- Run `setup_wallet` with this connection string: `nostr+walletconnect://...`
- Run `test_l402_payment` to check the wallet
- Search the L402 registry for an image generation API and show me the prices

## Similar
- [SaturnZap](https://affpapa.org/en/nevibecode/mcp/saturnzap.md) — MCP server · ★ 7
- [Lightning Wallet](https://affpapa.org/en/nevibecode/mcp/lightning-wallet.md) — MCP server · ★ 10
- [platform-custom-lightning-type-generate](https://affpapa.org/en/nevibecode/skills/platform-custom-lightning-type-generate.md) — skill · 5700 installs
- [platform-lightning-app-coordinate](https://affpapa.org/en/nevibecode/skills/platform-lightning-app-coordinate.md) — skill · 5600 installs
- [invinoveritas](https://affpapa.org/en/nevibecode/mcp/invinoveritas.md) — MCP server

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
