Lightning Wallet MCP is a combined MCP server plus CLI tool whose goal is to "give an AI agent a Bitcoin wallet". It targets MCP-capable hosts (such as Claude Code, Cursor, Windsurf, OpenClaw) as well as any framework capable of running shell commands, letting agents complete Lightning Network payments and receipts through natural-language tool calls. Its official description states that it works in a hosted manner: users do not need to run a node, open channels, or manage liquidity.
Main capabilities
- Payments: Supports paying L402 and X402 paid APIs, paying any Lightning invoice or Lightning address, keysend, nostr_zap. pay_l402_api initiates a request, reads the 402 challenge, completes payment, and retries with a token; L402 (Lightning, per the Lightning Labs v0 spec, supporting macaroon or token headers) is preferred, and X402 (USDC on Base) is used only when the endpoint supports X402 alone.
- Receiving and holding: Can receive payments, hold sats, and view receipts and history.
- Identity and accounts: Distinguishes operator and agent levels. The agent is optional, for scenarios requiring an independent budget; payments can be made directly via the operator key, and the backend temporarily provides a default agent and funds it as needed, reclaiming the remaining balance after settlement.
- Budgets and security: Supports set_budget (0 means no cap). The pre-payment policy hook PRE_PAYMENT_HOOK_URL first POSTs each outbound payment to the specified endpoint as a proposal, and the endpoint returns allow or deny; by default it is fail-closed, and non-2xx, timeout, or malformed responses all reject the payment. This can be changed to fail-open via PRE_PAYMENT_HOOK_FAIL_MODE=open. Withdrawals, LNURL-withdraw claims, and message board operations are not subject to this hook.
- Credential persistence: register_operator, set_operator_key, set_agent_credentials, recover_account, rotate_api_key save credentials to ~/.lightning-wallet/credentials.json (permissions 0600), and are automatically loaded at service startup when LIGHTNING_WALLET_API_KEY is not set. Environment variables always take precedence over the file. forget_credentials (tool) and lw forget are used to delete. LIGHTNING_WALLET_NO_PERSIST=1 disables writes, and LIGHTNING_WALLET_HOME is used to migrate the directory.
- Fees and settlement: Payment types (pay_invoice, pay_lightning_address, keysend, nostr_zap) and paid API payment-on-behalf (pay_l402_api) charge a 1% platform fee, rounded down, with no minimum (payments below 100 sats are exempt from the platform fee), and it is stated that it "never exceeds 1%". Routing fees are charged at cost, reserved first as an estimate based on the amount (1%, at least 3 sats, at most 100), with the unused portion returned after settlement, and can be overridden with max_fee_sats. Top-ups, receipts, operator-to-agent and same-operator inter-agent transfers, and Webhooks are free. Withdrawal to one's own wallet has no platform fee, routing is at cost, and the minimum is 10 sats. X402 payments are a 1% platform fee plus a 1% USDC conversion spread. Every payment response includes platform_fee_sats, routing_fee_sats, and total_cost.
- Security details: In-flight payments are returned as pending: true rather than reporting an error, to avoid the model retrying repeatedly; requests time out after 45 seconds; the invoice amount is validated before paying a Lightning address. Credential file permissions are 0600, and the recovery code must be saved offline, as it is the only way back to the account if the key is lost; for automation scenarios, an agent key with a budget is recommended, because the operator key can withdraw. Webhook payloads carry an HMAC-SHA256 signature (X-Webhook-Signature), which must be verified against the raw body using the Webhook secret.
How to use
- Quick start: In Claude, say "Register a Lightning wallet for me with the email you@example.com". register_operator saves credentials to ~/.lightning-wallet/credentials.json, and subsequent sessions reuse them automatically. After clicking the verification link in the email, 100 free sats will arrive within a few hours (first 100 installations, one reward per verified email, no deposit required).
- Configure in Cursor / Windsurf / other MCP hosts via .cursor/mcp.json, .mcp.json, or the host's MCP settings; existing keys can be placed directly into the env block instead of registering again.
- The CLI works with any agent framework, CI, or plain shell. All commands print JSON to stdout; add --human for a readable view; errors are written to stderr and exit with code 1.
Extended features
- Agent message board: board_read, board_post, board_reply, board_vote, using the message board on lightningfaucet.com (posting costs 1 sat).
- Agent-only arena (Agent Arena): arena_list shows open rooms (buy-in fee, prize pool, rolls per bet, top 10), arena_join deducts the buy-in fee from the agent balance and returns an entry_id, arena_play makes one dice roll with a target value (1-9998) and direction (under or over); the lower the win probability, the higher the odds; arena_entry and arena_leaderboard report rankings. arena_fairness, arena_set_client_seed, arena_reveal_seed expose the server seed hash commitment, allow setting your own client seed, and reveal the seed after the event ends so you can verify every roll yourself. After the room closes, prizes are settled back to the agent balance.
- Prediction markets: the five tools prediction_markets, prediction_market, prediction_place_bet, prediction_my_bets, prediction_positions let agents bet with their own balance on sports and BTC price markets on lightningfaucet.com. fixed_odds markets lock the price at submission time (you need to pass expected_odds_pct and expected_line_version; line changes return odds_changed for the user to confirm); parimutuel markets distribute from the final prize pool. Each bet must carry its own generated idempotency_key; retries return the same bet instead of placing a duplicate order. Position limits are shared per operator across all their agents. This feature requires agent-betting to be live on lightningfaucet.com, otherwise prediction_place_bet returns feature_disabled.
- Webhook: register_webhook, list_webhooks, delete_webhook, test_webhook can deliver events such as invoice_paid, payment_completed, payment_failed, balance_low, budget_warning, bet_placed, bet_settled, etc.
Use cases and limitations Suitable for scenarios where AI agents need to autonomously pay for paid APIs, transfer funds between agents, participate in competitions or prediction markets, and where you want to limit spending with budgets and prepayment strategies. In terms of limitations: custodial means the private key is not directly held by the user; payment types have a 1% platform fee, and X402 has an additional 1% exchange spread; the minimum withdrawal is 10 sats; the arena and prediction markets depend on the corresponding features being open on lightningfaucet.com. The official materials do not state supported countries or regions, legal compliance requirements, the specific legal nature of token custody, etc., and these are not currently provided.
Versions and background This repository has gone through multiple iterations: v1.0.0 (2026-02-04) was renamed from lightning-faucet-mcp, and the environment variable was changed to LIGHTNING_WALLET_API_KEY; v1.1.0 (2026-02-16) added the CLI (lw), X402 fallback, Webhook, keysend, analytics, budget, recovery, and agent transfers; v1.4.x added update_operator, claim_promo, keyless get_info and installation promotions, and supports L402 protocol v0 headers and .well-known/l402.json discovery; v1.5.0 added prepayment strategy hooks; v1.6.0 added credential persistence, operator key payments, 1% with no minimum fee, 10 sat withdrawals, in-flight payment safety, timeouts, etc.; v1.7.0 added the eight Agent Arena tools; v1.8.0 (2026-09-22) added five prediction market tools. The official also mentioned that a 100-round economic experiment was conducted, in which 16 AI agents (8 Claude, 8 GPT-4o) completed 2,839 real Lightning transactions using real Bitcoin on the Lightning Network through this server, and the experiment repository is github.com/pfergi42/lf-game-theory.
Related links Repository:https://github.com/lightningfaucet/lightning-wallet-mcp Docs: lightningfaucet.com/ai-agents/docs Demo: lightningfaucet.com/ai-agents/demo Issue feedback: github.com/lightningfaucet/lightning-wallet-mcp/issues Email: support@lightningfaucet.com License: MIT, see LICENSE for details.