One command. That's it. Your Claude Code, Cursor, or any MCP-compatible agent gets a fully functional Bitcoin Lightning wallet with the ability to pay for APIs, receive payments, and manage funds.

The Setup (Literally 60 Seconds)

Add this to your Claude Code settings (~/.claude/settings.json):

{"mcpServers":{"lightning-wallet":{"command":"npx","args":["lightning-wallet-mcp"]}}}

That's the entire setup. No API keys, no registration, no configuration files.

Start a new Claude Code session and say: "Register a new Lightning Wallet operator account."

Claude will call register_operator, get back an API key and recovery code. Save the recovery code somewhere safe. You now have a Bitcoin wallet.

What Your Agent Can Do Now

Pay for APIs Automatically

When your agent hits an L402-protected endpoint, it detects the 402 response, pays the Lightning invoice, and retries with the payment proof. One tool call: pay_l402_api.

Receive Payments

Your agent can generate invoices with create_invoice. Anyone with a Lightning wallet can pay it. Useful for agents that sell services.

Manage Sub-Agents

Create agents under your operator account with create_agent, give them budgets with set_budget, and fund them with fund_agent. Each agent has isolated funds and can't overspend.

Send Payments Anywhere

Pay any Lightning invoice with pay_invoice, send to a Lightning address with pay_lightning_address, or keysend directly to a node.

Try It Right Now

Once registered and funded, test with our demo endpoints:

pay_l402_api({ url: "https://lightningfaucet.com/api/l402/fortune" })

This hits an L402 paywall (10-50 sats), your agent pays automatically, and you get a fortune cookie. The entire flow happens in one tool call.

For CLI-Based Agents

If your agent uses Bash instead of MCP (OpenClaw, Pi, KiloCode):

npm install -g lightning-wallet-mcp
export LIGHTNING_WALLET_API_KEY=$(lw register --name "My Agent" | jq -r '.api_key')
lw balance
lw pay-api "https://lightningfaucet.com/api/l402/fortune"

Same wallet, same capabilities, JSON output piped to jq.

How It Works Under the Hood

The MCP server connects to Lightning Faucet's infrastructure. Your agent gets a custodial Lightning wallet backed by our LND node. When your agent makes a payment, we route it through the Lightning Network in milliseconds. The 2% platform fee (minimum 1 sat) covers routing and infrastructure.

Your agent's funds are isolated. Operators can create multiple agents, each with their own balance and spending limits. If an agent goes rogue, it can only spend its allocated budget.

Why Lightning?

Credit cards don't work for machines. OAuth tokens expire. Subscription keys don't scale to agent-to-agent commerce. Lightning payments are instant, programmable, and work without human authentication.

The L402 protocol (HTTP 402 Payment Required) is the native way for machines to pay for web resources. Your agent encounters a paywall, pays it, and gets the content. No signup forms, no API key management, no billing dashboards.

Every AI agent will eventually need to pay for things. Data, compute, APIs, other agents' services. The agents that can pay for what they need will outperform the ones that can't.

Get started: npx lightning-wallet-mcp
Docs: lightningfaucet.com/ai-agents/docs
npm: npmjs.com/package/lightning-wallet-mcp