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. Wallet, invoice, L402, budget, and API-discovery tools work out of the box with just a wallet — no API key required. Producer tools (sell access via L402) and Agent Service Agreement tools (agent-to-agent commerce over Nostr) unlock with a Lightning Enable API key. See the MCP Complete Guide for the full tool list.

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. Download the Strike app or go to strike.me
  2. Create an account (requires phone number)
  3. Go to developer.strike.me
  4. Log in with your Strike account
  5. Click Generate API Key
  6. Copy the API 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
.NET not installed?

Download the .NET 9+ SDK from https://dot.net/download (the tool targets .NET 9)

NWC wallets

The Python package installs on every platform (including Windows) with no build toolchain. If you connect a Nostr Wallet Connect (NWC) wallet, install the optional extra instead: pip install lightning-enable-mcp[nwc]. Other wallet types (LND, Strike, OpenNode) don't need it. (.NET is unaffected.)


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": "dotnet",
"args": ["tool", "run", "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.


You're Done!

The MCP server is open-source (MIT) and free to install. Wallet, invoice, L402, budget, and API-discovery tools work out of the box with just a wallet. Producer tools (sell access via L402) and Agent Service Agreement tools (agent-to-agent commerce over Nostr) unlock with a Lightning Enable API key. See the MCP Complete Guide for the full tool list.


Set Spending Limits

Protect yourself with budget controls. Create ~/.lightning-enable/config.json:

{
"currency": "USD",
"tiers": {
"autoApprove": 0.10,
"logAndApprove": 1.00,
"formConfirm": 10.00
},
"limits": {
"maxPerPayment": 50.00,
"maxPerSession": 20.00
}
}
ThresholdBehavior
Under $0.10Auto-pay silently
$0.10 - $1.00Pay and log
$1.00 - $50.00Confirmation required — the server prints a code to its console; you give the code to the AI to approve
Over $50/paymentDenied
Over $20/sessionDenied

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 9+ SDK 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 Keydeveloper.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.