Give Your AI Agent a Bitcoin Wallet
Lightning payments for Claude Code, Cursor, OpenClaw, and any MCP-compatible agent.
npx lightning-wallet-mcp
Your agent registers itself with one tool call. No signup forms, no keys to copy.
Your first five minutes
Install, then talk to your agent in plain English. Each line maps to one MCP tool.
-
Install
claude mcp add lightning-wallet -- npx lightning-wallet-mcpCursor, Windsurf and other MCP clients: add the samenpx lightning-wallet-mcpcommand to your MCP config. -
Create the wallet
Register a Lightning wallet for me.
Callsregister_operator. The agent keeps its own key; nothing to copy. -
Fund it with a few sats
Create a 500 sat deposit invoice and show it to me.
Callsget_deposit_invoice. Pay it from any Lightning wallet;check_balanceshows the sats within seconds. -
Pay an API, with a cap
Pay this L402 API, and refuse anything over 200 sats.
Callspay_l402_apiwithmax_payment_sats, straight from the operator wallet. Pick an endpoint from the API catalog; calls start at 1 sat. Standing per-agent budgets come later withcreate_agentandset_budget.
How It Works
MCP Server
Works with Claude Code, Cursor, Windsurf, and any MCP client. Your agent gets a wallet, balance, and payment tools.
Primary View on npmAgent Wallets
Managed Lightning wallets for AI agents. Pay for APIs and services. Withdraw to self-custody anytime.
Live Get StartedCLI Tool
The lw command for bash-based agents. JSON stdout, works in scripts, CI pipelines, and any framework.
REST API
HTTP 402 (L402) protocol for direct integration. Monetize your APIs with micropayments per request.
Advanced API CatalogQuick Start
Give your AI agent a Bitcoin wallet. One command, zero API keys.
npx lightning-wallet-mcp
Your agent registers itself with the register_operator tool. Works with Claude Code, Cursor, and any MCP client.
{
"mcpServers": {
"lightning-wallet": {
"command": "npx",
"args": ["lightning-wallet-mcp"]
}
}
}
Add to .mcp.json in your project, or run: claude mcp add lightning-wallet -- npx lightning-wallet-mcp
# Install globally
npm install -g lightning-wallet-mcp
# Register a new agent wallet (free; add --email [email protected] if you want notifications)
lw register
# Fund it: prints a Lightning invoice to pay (the fortune call below costs 50 sats)
lw deposit 500
# Check balance (JSON stdout)
lw balance
# Pay an L402 API, capped at 100 sats
lw pay-api https://lightningfaucet.com/api/l402/fortune --max-sats 100
14 commands available. JSON output for easy parsing in scripts and CI.
How can my app know when a Lightning invoice is paid?
Register an invoice_paid webhook in the wallet API to receive a notification when an invoice is paid. Verify the webhook signature before acting on the event.