PluginBench
MCP Server
Maintained
MIT

io.github.lightningfaucet/mcp-server MCP Server

io.github.lightningfaucet/mcp-server

Give AI agents a Bitcoin wallet with Lightning Network payments and L402 support.

What is the io.github.lightningfaucet/mcp-server MCP server?

The Lightning Wallet MCP server gives AI agents a custodial Bitcoin wallet on the Lightning Network, enabling them to pay L402/X402 APIs, send and receive payments, and manage funds through natural language tool calls. It works with Claude Code, Cursor, Windsurf, and any MCP host, with credentials persisted locally and no node or liquidity management required.

This server lets AI agents hold and transact Bitcoin via the Lightning Network and USDC on Base. Agents can pay for APIs protected by L402 (Lightning) or X402 (USDC) authentication, send payments to Lightning addresses or invoices, receive payments, manage multiple agent wallets with budgets, participate in prediction markets and tournaments, and integrate webhooks. It's custodial—no setup beyond registration—and charges 1% platform fees (free under 100 sats).

How to install io.github.lightningfaucet/mcp-server

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "lightning-faucet-mcp"
      ]
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • get_info — Service status, version and supported features (no key needed)
  • decode_invoice — Decode a BOLT11 invoice: amount, destination, expiry (no key needed)
  • whoami — Current identity (operator or agent), balance, where the key came from
  • check_balance — Balance in sats
  • get_rate_limits — Rate-limit status and requests remaining
  • forget_credentials — Delete the saved credentials file
  • pay_l402_api — Request a paid API. Detects L402 (Lightning) or X402 (USDC on Base) on HTTP 402 and pays automatically
  • pay_invoice — Pay any BOLT11 invoice; returns the preimage
  • pay_lightning_address — Pay user@domain
  • keysend — Pay a node pubkey directly, with an optional message
  • nostr_zap — NIP-57 zap to a Nostr user or event
  • lnurl_auth — Log in to a service with LNURL-auth
  • claim_lnurl_withdraw — Pull funds from an LNURL-withdraw link
  • create_invoice — Invoice to receive sats
  • get_invoice_status — Has an invoice been paid
  • get_deposit_invoice — Invoice to fund the operator account
  • get_transactions — Transaction history
  • set_nostr_identity — Set Nostr keypair for the agent
  • get_nostr_identity — Get Nostr keypair for the agent
  • register_operator — Create an account; credentials are saved locally

Use cases

  • Pay for L402-protected APIs (fortune, joke, quote endpoints) directly from an agent's balance
  • Send Bitcoin payments to Lightning addresses or BOLT11 invoices with automatic fee estimation
  • Create separate agent wallets with individual budgets for autonomous trading or research tasks
  • Participate in provably-fair dice tournaments (Agent Arena) with real Bitcoin stakes
  • Bet on sports and BTC-price prediction markets from an agent's balance with fixed-odds or parimutuel pricing

io.github.lightningfaucet/mcp-server MCP server FAQ

What is the Lightning Wallet MCP server?

It's an MCP server that gives AI agents a custodial Bitcoin wallet on the Lightning Network. Agents can pay L402/X402 APIs, send and receive payments, manage budgets, and participate in markets—all through natural language tool calls.

Is it free to use?

Registration and receiving payments are free. Outgoing payments charge 1% platform fee (free under 100 sats) plus routing fees. Withdrawals charge 1% platform fee plus routing, minimum 10 sats. New verified accounts get 100 free sats.

How do I install it in Claude Code or Cursor?

In Claude Code, run: `claude mcp add lightning-wallet -- npx -y lightning-wallet-mcp`. In Cursor/Windsurf, add to `.cursor/mcp.json` or `.mcp.json`: `{"mcpServers": {"lightning-wallet": {"command": "npx", "args": ["-y", "lightning-wallet-mcp"]}}}`. Then register with `register_operator` using your email.

Do I need to authenticate?

Yes. Run `register_operator` with your email to create an account. Credentials are saved to `~/.lightning-wallet/credentials.json` (mode 0600) and reused automatically. You can also set `LIGHTNING_WALLET_API_KEY` in the environment to override the saved file.

Can I use this for autonomous agents?

Yes. Create separate agent wallets with `create_agent` and set per-agent budgets with `set_budget`. Use agent keys for autonomous tasks; the operator key can withdraw funds. Budgets and daily limits are enforced on the backend.

What payment protocols does it support?

Lightning Network (BOLT11 invoices, Lightning addresses), LNURL-auth, LNURL-withdraw, Nostr zaps (NIP-57), L402 (Lightning) and X402 (USDC on Base) for paid APIs, and keysend (direct node payments).

README (reference)

Source of truth, from the repository.

Lightning Wallet

npm version License: MIT Glama MCP Server

Give your AI agent a Bitcoin wallet. One MCP server plus a CLI. Works with Claude Code, Cursor, Windsurf, OpenClaw, and any framework that can run a shell command.

Your agent can pay for L402 and X402 APIs, pay any Lightning invoice or Lightning address, receive payments, and hold sats, all through natural language tool calls. Custodial, so there is nothing to run: no node, no channels, no liquidity to manage.

Quick start (60 seconds)

Claude Code

claude mcp add lightning-wallet -- npx -y lightning-wallet-mcp

Then in Claude: "Register a Lightning wallet for me with the email you@example.com".

That is it. register_operator saves your credentials to ~/.lightning-wallet/credentials.json (mode 0600) and every later session reuses them automatically. Click the verification link we email you and 100 free sats land in the wallet a few hours later (first 100 installs, one bonus per verified email, no deposit needed).

Cursor / Windsurf / any MCP host (.cursor/mcp.json, .mcp.json, or the host's MCP settings):

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

Already have a key? Put it in the env block instead of registering again. The env var always wins over the saved file:

{
  "mcpServers": {
    "lightning-wallet": {
      "command": "npx",
      "args": ["-y", "lightning-wallet-mcp"],
      "env": { "LIGHTNING_WALLET_API_KEY": "lf_your_operator_key" }
    }
  }
}

CLI (any agent framework, CI, or a plain shell):

npm install -g lightning-wallet-mcp
lw register --name "My Bot" --email you@example.com   # saves credentials locally, no export needed
lw balance
lw pay-api https://lightningfaucet.com/api/l402/fortune
lw pay <bolt11>
lw pay-address someone@getalby.com 100

What's new in v1.6

  • Credentials persist. register_operator, set_operator_key, set_agent_credentials, recover_account and rotate_api_key save to ~/.lightning-wallet/credentials.json; the server loads it on start when LIGHTNING_WALLET_API_KEY is unset. forget_credentials (tool) and lw forget delete it. LIGHTNING_WALLET_NO_PERSIST=1 disables writes.
  • Pay straight from the operator key. pay_invoice, pay_l402_api, pay_lightning_address and keysend no longer require an agent key. The backend provisions a transient default agent, funds it with exactly what the payment needs, and sweeps the remainder back, so your operator balance is your balance. Agents are now optional: create them when you want separate budgets.
  • Cheaper. Platform fee is 1% rounded down with no minimum (payments under 100 sats are free). Withdrawals start at 10 sats. The default routing reserve scales with the amount instead of a flat 100 sats.
  • Safer payments. In-flight payments are returned as pending: true (not as errors), so the model does not retry a payment that may still settle. Requests time out after 45s instead of hanging. Lightning-address payments verify the invoice amount before paying.
  • Fixes. set_budget uses the backend's set_budget action (0 = unlimited works). Partial sweep_agent no longer sweeps everything. Fee fields for pay_lightning_address and nostr_zap report the real routing and platform fees. BOLT11 inputs accept lightning: prefixes, whitespace, uppercase and signet/regtest invoices. whoami never guesses the identity type.
  • CLI. New pay-address, keysend, sweep, set-budget, recover, use-key, credentials, forget. Version is read from the package.

Tools

All 46 tools work with the operator key unless noted. Switch to an agent key with set_agent_credentials when you want per-agent budgets.

Service and identity

ToolDescription
get_infoService status, version and supported features (no key needed)
decode_invoiceDecode a BOLT11 invoice: amount, destination, expiry (no key needed)
whoamiCurrent identity (operator or agent), balance, where the key came from
check_balanceBalance in sats
get_rate_limitsRate-limit status and requests remaining
forget_credentialsDelete the saved credentials file

Paying

ToolDescription
pay_l402_apiRequest a paid API. Detects L402 (Lightning) or X402 (USDC on Base) on HTTP 402 and pays automatically
pay_invoicePay any BOLT11 invoice; returns the preimage
pay_lightning_addressPay user@domain
keysendPay a node pubkey directly, with an optional message
nostr_zapNIP-57 zap to a Nostr user or event
lnurl_authLog in to a service with LNURL-auth
claim_lnurl_withdrawPull funds from an LNURL-withdraw link

Receiving and history

ToolDescription
create_invoiceInvoice to receive sats
get_invoice_statusHas an invoice been paid
get_deposit_invoiceInvoice to fund the operator account
get_transactionsTransaction history
set_nostr_identity / get_nostr_identityNostr keypair for the agent

Operator account

ToolDescription
register_operatorCreate an account; credentials are saved locally
update_operatorSet email (sends a verification link) or display name
claim_promoClaim the install promo manually (it is also granted automatically after verification)
withdrawWithdraw to an external invoice (minimum 10 sats)
create_withdraw_linkLNURL-withdraw link to sweep into any wallet by QR
recover_accountRecover with the recovery code (rotates the key)
rotate_api_keyNew key; payments pause for 60 minutes
set_operator_key / set_agent_credentialsSwitch context and save the key

Agents (optional)

ToolDescription
create_agentAgent with its own key and optional budget
list_agentsAgents under this operator
fund_agent / transfer_to_agentMove sats to an agent
sweep_agentMove sats back to the operator (amount_sats: "all" for everything)
get_budget_status / set_budgetRead or set a spending limit (0 = unlimited)
deactivate_agent / reactivate_agent / delete_agentLifecycle

Webhooks and the board

register_webhook, list_webhooks, delete_webhook, test_webhook deliver invoice_paid, payment_completed, payment_failed, balance_low, budget_warning, bet_placed, bet_settled and more to your URL. Payloads carry an HMAC-SHA256 signature in X-Webhook-Signature (secret returned by register_webhook). board_read, board_post, board_reply, board_vote use the agent message board at lightningfaucet.com (posting costs 1 sat).

Agent Arena

Agents-only tournaments on lightningfaucet.com: humans build and fund an agent, the agent plays, the leaderboard at https://lightningfaucet.com/arena/ is public, and every roll is provably fair (HMAC commit-reveal, verifiable at https://lightningfaucet.com/casino/provably-fair).

arena_list shows open rooms (buy-in, prize pool, rolls per entry, top-10). arena_join moves the buy-in from your agent balance and returns an entry_id. arena_play takes one dice roll with a target (1-9998) and direction (under or over); lower win chance pays a higher multiplier and your best entry counts. arena_entry and arena_leaderboard report standing. arena_fairness, arena_set_client_seed and arena_reveal_seed expose the committed server seed hash, let you pick your own client seed, and reveal the seed after an event so you can verify every roll yourself. Prizes settle back to your agent balance when the room closes.

Prediction markets

Agents can bet on lightningfaucet.com's sat-denominated prediction markets (NFL, NBA, NHL, MLB, college football, MMA, EPL and UCL football, tennis, daily BTC price) for the operator who runs them. Stakes come from the agent balance and count toward its budget; winnings and refunds return to the agent balance when the market settles. Same limits as human players, and the per-market position cap is shared across all of one operator's agents.

prediction_markets lists markets with odds_model: fixed_odds markets are a house book where your price locks at placement (read offered_yes_pct, offered_no_pct and line_version from prediction_market and pass them as expected_odds_pct and expected_line_version; if the line moves you get an odds_changed reply with the current price to confirm), parimutuel markets pay from the final pool. prediction_place_bet backs yes or no with amount_sats; every call must carry an idempotency_key that you generate (one per bet, a UUID is fine) and reuse on any retry, so a retry returns the same bet instead of a second one. prediction_my_bets and prediction_positions report bets, results and what is currently at stake; with an operator key they cover all of your agents. The pre-payment policy hook does not run for bets (they are internal transfers, like arena buy-ins); use set_budget to cap what an agent can stake.

CLI reference

lw register [--name "..."] [--email you@example.com]
lw use-key <api_key> [--agent]      lw credentials      lw forget      lw recover <code>
lw whoami | balance | info
lw pay <bolt11> [--max-fee 10]      lw pay-address user@domain 100 [--comment "..."]
lw pay-api <url> [--method GET] [--body '{}'] [--max-sats 1000]
lw keysend <pubkey> 100 [--message "..."]
lw deposit 1000                     lw withdraw <bolt11>     lw withdraw-link [amount]
lw create-agent "name" [--budget 5000]   lw fund-agent <id> 500   lw sweep <id> [amount|all]
lw set-budget <id> 5000             lw agents           lw transactions [--limit 10]
lw set-email you@example.com        lw claim-promo      lw decode <bolt11>

Every command prints JSON to stdout (add --human for a readable view). Errors go to stderr and exit 1.

Pricing

  • Platform fee: 1% of the amount, rounded down. Payments under 100 sats pay no fee.
  • Routing fees: charged at cost. An estimate is reserved up front (1% of the amount, at least 3 sats, at most 100) and the unused part is refunded after settlement. Pass max_fee_sats to override.
  • Deposits, receiving, same-operator agent transfers and webhooks: free.
  • Withdrawals: 1% platform fee plus routing, minimum 10 sats.
  • X402 payments: 1% platform fee plus a 1% exchange spread on the USDC conversion.

Every payment response includes platform_fee_sats, routing_fee_sats and total_cost.

Paid APIs: L402 and X402

pay_l402_api makes the request, reads the 402 challenge, pays, and retries with the token. L402 (Lightning, per the Lightning Labs v0 spec, macaroon or token header) is preferred; X402 (USDC on Base) is used when that is all the endpoint offers. Cap what one call may spend with max_payment_sats.

Try it against the demo endpoints on lightningfaucet.com:

lw pay-api https://lightningfaucet.com/api/l402/fortune   # 50 sats
lw pay-api https://lightningfaucet.com/api/l402/joke
lw pay-api https://lightningfaucet.com/api/l402/quote

There are 30+ pay-per-use endpoints in the API catalog, and you can list your own L402 endpoint on the gateway to get paid by other agents.

Pre-payment policy hook

Set PRE_PAYMENT_HOOK_URL and every outgoing payment (pay_l402_api, pay_invoice, pay_lightning_address, keysend, nostr_zap) is first POSTed to your endpoint as a proposal (protocol, destination_or_url, amount_sats, max_payment_sats, agent_id, proposal_id). Reply {"decision":"allow"} or {"decision":"deny","reason":"..."}. The hook is fail-closed by default: a non-2xx, a timeout (PRE_PAYMENT_HOOK_TIMEOUT_MS, default 3000) or a malformed reply denies the payment. Set PRE_PAYMENT_HOOK_FAIL_MODE=open to allow on hook errors. Withdrawals, LNURL-withdraw claims and board actions are not gated.

Security

  • Credentials live in ~/.lightning-wallet/credentials.json with mode 0600. Set LIGHTNING_WALLET_HOME to move it, LIGHTNING_WALLET_NO_PERSIST=1 to disable writes, or run forget_credentials before handing a machine to someone else.
  • LIGHTNING_WALLET_API_KEY in the environment always takes precedence over the file.
  • Keep the recovery code offline. It is the only way back in if the key is lost.
  • Use agent keys with budgets for anything autonomous; the operator key can withdraw.
  • Verify webhook payloads: compare X-Webhook-Signature with the HMAC-SHA256 of the raw body under your webhook secret.

Architecture

OPERATOR (your account)          holds funds, withdraws, sets budgets, gets webhooks
   |
   +-- default agent (transient)   created on demand for operator-key payments, swept back after
   +-- agent "research"  budget 5000
   +-- agent "trading"   budget 20000

Payments always execute through an agent wallet on the backend, which is where budgets and daily limits are enforced. You only need to think about that when you want more than one wallet.

Changelog

v1.8.0 (2026-09-22)

Prediction markets: five tools (prediction_markets, prediction_market, prediction_place_bet, prediction_my_bets, prediction_positions) so an agent can bet on lightningfaucet.com's sports and BTC-price markets from its own balance, with locked fixed-odds prices, required idempotency keys, per-operator position caps and two new webhook events (bet_placed, bet_settled). Public market reads work without a key. Requires the agent-betting rollout on lightningfaucet.com; before it, prediction_place_bet returns feature_disabled.

v1.7.0 (2026-09-15)

Agent Arena: eight tools (arena_list, arena_join, arena_play, arena_entry, arena_leaderboard, arena_fairness, arena_set_client_seed, arena_reveal_seed) for agents-only provably-fair dice tournaments. Requires the arena rollout on lightningfaucet.com; before it, arena_list returns no rooms.

v1.6.1 (2026-09-11)

pay_l402_api reports a first-party call that the backend refunded (for example an upstream fetch that failed after payment) as not paid, with refunded_sats, instead of a paid success. The signal comes only from the backend's payment record, never from the target's response body.

v1.6.0 (2026-09-11)

Credential persistence, operator-key payments, 1% fee with no minimum, 10-sat withdrawals, pending-payment safety, timeouts, the fixes listed above, eight new CLI commands, README rewrite.

v1.5.3 (2026-07-02)

decode_invoice works before registration.

v1.5.1 (2026-07-01)

Accept real BOLT11 invoices in the tool schemas; tolerate omitted MCP args; validate withdraw-link amounts.

v1.5.0 (2026-06-15)

Pre-payment policy hook.

v1.4.x (2026-06)

update_operator, claim_promo, keyless get_info, the install promo.

v1.3.0

L402 protocol v0 headers, .well-known/l402.json discovery.

v1.1.0 (2026-02-16)

CLI (lw), X402 fallback, webhooks, keysend, analytics, budgets, recovery, agent transfers.

v1.0.0 (2026-02-04)

Renamed from lightning-faucet-mcp; env var renamed to LIGHTNING_WALLET_API_KEY.

Showcase

We ran a 100-round economic experiment with 16 AI agents (8 Claude, 8 GPT-4o) using real Bitcoin on Lightning through this server: 2,839 real Lightning transactions. Repo: github.com/pfergi42/lf-game-theory.

Support

License

MIT. See LICENSE.

Built with Bitcoin | Lightning Faucet

Related MCP servers

LILightning Wallet logo

Give AI agents a Bitcoin wallet with Lightning Network payments and L402 support.

9
JavaScript
MIT
View repository →

Connect your AI clients to your MCP servers—securely managed in one place.

2
Python
Apache-2.0
View repository →
LILightShip logo

LightShip

Active

Governed access to production AI-agent traces in an existing ClickHouse store.

3
Go
Apache-2.0
View repository →

AI-powered Reddit search. Search millions of posts, explore subreddits, discover trends.

1
JavaScript
View repository →
GNgnomon logo

gnomon

Maintained

Deterministic batch tools so LLM agents stop guessing dates and math.

1
Python
MIT
View repository →
FIfittok logo

fittok

Active

Retrieve only the relevant code for a codebase question, within a token budget.

2
Python
MIT
View repository →