Skip to main content

Lightning MCP: 3-Minute Setup

Get your AI paying Lightning invoices in under 3 minutes. The MCP server is open-source (MIT) and free to install. Paying, invoicing, L402, budget, and API-discovery tools need only a wallet. Selling access over L402 and some agent-marketplace actions also need a Lightning Enable API key. The MCP Complete Guide is the full reference.

What You'll Get

After this guide, Claude can:

  • Pay any Lightning invoice
  • Access L402-protected APIs with automatic micropayments
  • Check your wallet balance and payment history
  • Buy from L402 stores (like agent-commerce.store)

Try L402 Now (No Setup Required)​

Before installing anything, you can verify L402 works with a single curl:

curl https://api.lightningenable.com/l402/test/ping

You'll get a 402 Payment Required response with a 1-sat Lightning invoice. Pay the invoice with any Lightning wallet, then retry with the L402 token:

curl -H "Authorization: L402 <macaroon>:<preimage>" \
https://api.lightningenable.com/l402/test/ping

You'll get a 200 OK confirming L402 is working. No API key or signup required.


What You Need​

  1. Claude Code or Claude Desktop — Already installed
  2. A Strike account — Free, 2-minute signup

Step 1: Get a Strike API Key (1 minute)​

Strike is the fastest way to start. No infrastructure, no node, full L402 support.

  1. Create an account in the Strike app or at strike.me.
  2. Sign in at dashboard.strike.me and create an API key.
  3. Copy the key.
Why Strike?

Strike requires zero infrastructure, supports L402 (returns preimage on every payment), and handles custody. Want alternatives? See Wallet Options for NWC wallets (CoinOS, Alby Hub, CLINK) or LND for self-hosted.

Fund Your Wallet​

Send a small amount of Bitcoin to your Strike wallet, or buy directly in the Strike app. Start with $1-5 worth.


Step 2: Install the MCP Server (30 seconds)​

# .NET (recommended)
dotnet tool install -g LightningEnable.Mcp

# Or Python
pip install lightning-enable-mcp

Already installed? Update to the latest release (2.1.0 or later is needed for renew_lightning_enable_subscription):

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

Download the .NET SDK from https://dot.net/download (the tool runs on .NET 8, 9, or 10)

NWC wallets

The base Python install supports NWC wallets on every platform. The old [nwc] extra still installs but adds nothing.


Step 3: Configure Claude (1 minute)​

Claude Code and Claude Desktop are configured differently — pick the one you use.

Claude Code (CLI)​

Register the server with the claude mcp add command:

.NET:

claude mcp add --transport stdio lightning-enable \
--env STRIKE_API_KEY=your-strike-api-key \
-- lightning-enable-mcp

Python:

claude mcp add --transport stdio lightning-enable \
--env STRIKE_API_KEY=your-strike-api-key \
-- uvx lightning-enable-mcp

Alternatively, for a project-scoped setup, create a .mcp.json file in your project root (don't commit API keys):

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

Restart Claude Code (or run /mcp to check the server is connected).

Claude Desktop​

Edit the Claude Desktop config file:

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

.NET:

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

Python:

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

Restart Claude Desktop after saving.

Other Clients​


Step 4: Test It!​

Open Claude and try:

Check Your Balance​

Check my Lightning balance

Pay an Invoice​

Pay this Lightning invoice: lnbc...

Access an L402 API​

Get weather data for New York from agent-commerce.store

Claude will automatically handle the L402 payment and return the data.

Buy from the Lightning Enable Store​

Buy me a Lightning Enable t-shirt from store.lightningenable.com

Claude browses the catalog, checks out, pays the invoice, and gives you a claim link.


Set Spending Limits​

The server creates ~/.lightning-enable/config.json on first run. Edit its tiers and limits before the first real payment, for example:

{
"currency": "USD",
"tiers": {
"autoApprove": 0.10,
"logAndApprove": 1.00,
"formConfirm": 10.00
},
"limits": {
"maxPerPayment": 10.00,
"maxPerSession": 20.00
}
}
ThresholdBehavior
Up to $0.10Paid without asking
Up to $1.00Paid and logged
$1.00 - $10.00Needs confirmation: the server prints a code to its console, and you give the code to the AI
Over $10 per payment, or $20 per sessionRefused

No MCP tool can raise these limits. Restart the server after editing the file. See AI Spending Security for the full model, including sats-denominated limits. A Lightning Enable Store order (25,000+ sats) is above these example limits; AI Spending Guidelines shows what a purchase needs.


Troubleshooting​

"Wallet not configured"​

Your Strike API key isn't being read. Check:

  1. Environment variable is set correctly in your MCP config
  2. Restart Claude after saving config changes
  3. Try running lightning-enable-mcp directly to see errors

"dotnet: command not found"​

Install the .NET SDK (8, 9, or 10) from https://dot.net/download

"uvx: command not found"​

Install uv: pip install uv or curl -LsSf https://astral.sh/uv/install.sh | sh


Next Steps​


Quick Reference​

SettingWhere
Strike API Keydashboard.strike.me
Claude Code Configclaude mcp add ... or project .mcp.json
Claude Desktop Configclaude_desktop_config.json (per-OS paths above)
Budget Config~/.lightning-enable/config.json
MCP Installdotnet tool install -g LightningEnable.Mcp

Questions? Open an issue on GitHub.

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.