Lightning MCP: 5-Minute Setup
Get your AI paying Lightning invoices in under 5 minutes. No credit card, no subscription - just Bitcoin.
After this guide, Claude can:
- Pay any Lightning invoice you give it
- Check your wallet balance
- View payment history
- All for free - no subscription required
What You Need
- Claude Code (Claude's CLI) - Already installed
- A Lightning wallet that supports NWC - We'll set one up
That's it. Let's go.
Step 1: Create a Free CoinOS Wallet (2 minutes)
CoinOS is a free Lightning wallet that works perfectly with Claude.
- Go to https://coinos.io
- Click "Get Started" - no email required
- Write down your password (you'll need it later)
- Done! You have a Lightning wallet.
Fund Your Wallet
Send a small amount of Bitcoin to your CoinOS wallet:
- Click Receive in CoinOS
- Copy the Lightning address or invoice
- Send from any other wallet (start with $1-5 worth)
Step 2: Create NWC Connection (1 minute)
NWC (Nostr Wallet Connect) lets Claude pay invoices from your wallet.
- In CoinOS, go to Settings (gear icon)
- Click Nostr Wallet Connect
- Click Add a new connection
- Name it "Claude Code"
- Enable auto-pay (toggle ON)
- Set budget limit (e.g., 10,000 sats per day)
- Click Create
- Copy the connection string (starts with
nostr+walletconnect://)
Save this string - you'll need it in the next step.
Step 3: Configure Claude (2 minutes)
Add the Lightning Enable MCP server to Claude's configuration.
Option A: Claude Desktop (Recommended)
Edit your Claude 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
Add this to your mcpServers section:
{
"mcpServers": {
"lightning-enable": {
"command": "dotnet",
"args": ["tool", "run", "lightning-enable-mcp"],
"env": {
"NWC_CONNECTION_STRING": "nostr+walletconnect://YOUR_STRING_HERE"
}
}
}
}
Replace YOUR_STRING_HERE with your CoinOS connection string.
Option B: Config File (For Special Characters)
If your connection string has characters that don't work in JSON, use a config file instead.
Create ~/.lightning-enable/config.json:
{
"wallets": {
"nwcConnectionString": "nostr+walletconnect://YOUR_STRING_HERE"
}
}
Then use this simpler MCP config:
{
"mcpServers": {
"lightning-enable": {
"command": "dotnet",
"args": ["tool", "run", "lightning-enable-mcp"]
}
}
}
Step 4: Install the MCP Server (30 seconds)
Open your terminal and run:
dotnet tool install --global lightning-enable-mcp
That's it. Restart Claude.
Step 5: Test It! (30 seconds)
Open Claude and try these:
Check Your Balance
Check my Lightning balance
Claude will show your CoinOS balance.
Pay an Invoice
Pay this Lightning invoice: lnbc...
Give Claude any BOLT11 invoice and it will pay it from your wallet.
View Payment History
Show my recent Lightning payments
You're Done!
Claude can now make Lightning payments for you. Here's what's available for free:
| Tool | What It Does |
|---|---|
pay_invoice | Pay any Lightning invoice |
check_wallet_balance | See your wallet balance |
get_payment_history | View recent payments |
get_budget_status | Check spending limits |
create_invoice | Create invoices to receive payments |
check_invoice_status | Check if someone paid your invoice |
Real-World Examples
Tip a Content Creator
Pay this Lightning tip: lnbc210n1pj...
Buy API Access
I need to pay for this API. Here's the invoice: lnbc50u1pj...
Split a Bill
Pay my share of the bill: lnbc15000n1pj...
Receive Payments
Create a Lightning invoice for 5000 sats with memo "Thanks!"
Set Spending Limits
Protect yourself with spending limits. Create ~/.lightning-enable/config.json:
{
"currency": "USD",
"tiers": {
"autoApprove": 0.10,
"logAndApprove": 1.00,
"formConfirm": 10.00
},
"limits": {
"maxPerPayment": 50.00,
"maxPerSession": 20.00
}
}
This means:
- Under $0.10: Auto-pay, no questions
- $0.10-$1.00: Pay but log it
- $1.00-$10.00: Ask for confirmation
- Over $50 per payment: Denied
- Over $20 per session: Denied
Want L402 Auto-Pay?
The free tier handles direct invoice payments. For automatic L402 API payments (like AI agents that pay for API access automatically), unlock L402 features with a one-time Lightning payment.
Unlock L402 Features (One-Time 6,000 sats)
Just ask Claude to unlock L402:
User: Unlock L402 features
Claude: [Uses unlock_l402_features]
L402 features unlocked!
- Amount paid: 6,000 sats (~$6)
- License bound to your wallet pubkey
- Valid: Forever
L402 unlocks these tools:
access_l402_resource- Automatically pay L402 challengespay_l402_challenge- Manual L402 payment handling
Your license is bound to your wallet pubkey. If you switch devices, just run unlock_l402_features again - it will restore your existing license without charging you.
Troubleshooting
"Wallet not configured"
Your NWC connection string isn't being read. Check:
- Environment variable is set correctly
- Or config file exists at
~/.lightning-enable/config.json - Connection string starts with
nostr+walletconnect://
"Payment cancelled by user"
Auto-pay isn't enabled in CoinOS. Go to Settings > NWC > Edit your connection > Toggle auto-pay ON.
"dotnet: command not found"
Install .NET 8 SDK from https://dot.net/download
Payments are slow
CoinOS uses Lightning routing which can take a few seconds. This is normal.
Next Steps
- Spending Security - Advanced budget controls
- Wallet Options - Other wallet choices
- LND Setup - Use your own Lightning node
- L402 Overview - Automatic API payments
Quick Reference
| Setting | Where |
|---|---|
| NWC Connection | CoinOS Settings > Nostr Wallet Connect |
| Claude Config | ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) |
| Budget Config | ~/.lightning-enable/config.json |
| MCP Install | dotnet tool install --global lightning-enable-mcp |
Questions? Check the FAQ or open an issue on GitHub.