Your AI agent now has a Lightning wallet — introducing nwc-mcp
- What it is
- Why the safety model matters
- Validated end-to-end
- What you can build with it
- What’s in the box
- Where to get it
- Companion servers (also 50k each on the same storefront)
Three things stopped me from giving an LLM agent the keys to my wallet:
- No standard way to plug a Lightning wallet into an MCP-speaking agent.
- No safety story I’d trust for autonomous spend.
- No working demo of an agent paying for a paid tool call — the whole point.
I built nwc-mcp to fix all three.
What it is
An MCP server that exposes Nostr Wallet Connect (NIP-47) wallet operations as tools an agent can call. Drop it into Claude Desktop, Claude Code, Cursor, or any client that speaks MCP. Set a daily cap. Hand the agent a sub-wallet — not your main one — and let it spend.
Twelve tools:
- Read —
get_info,get_balance,lookup_invoice,list_transactions,decode_invoice,budget_status - Receive —
make_invoice - Spend —
pay_invoice,pay_lightning_address,pay_lnurl,multi_pay_invoice,pay_keysend - Two-step —
confirm_payment(consumes a one-time token if you opt into the two-step gate)
Why the safety model matters
An agent with a pay_invoice tool can drain a wallet faster than you can intervene. The defense in depth runs in this order on every call:
NWC_READ_ONLYgate — flip one env var, spend is disabled. Block lands at gate 1, no decode, no network.- Invoice decode + amount resolution — refuses to guess when amount-override conflicts with the invoice’s embedded amount.
- Destination allowlist — if you list specific LN addresses or pubkeys, only those are payable.
- Budget tracker — daily rolling cap, lifetime cap, per-payment cap. Persisted to disk.
- Two-step confirmation (optional) — server returns a one-time token; payment executes only after a second tool call with the token. Trades autonomy for safety.
- Audit log — every attempt (success, blocked, error) gets one structured JSON line. Tail it for ground truth — independent of whatever the LLM tells you.
The floor is your NWC connection’s own daily cap, set in the wallet itself. This server’s checks are belt-and-suspenders on top. If you trust nothing about the agent or the server, the wallet still won’t spend past the cap.
Validated end-to-end
Smoke-tested against Alby Hub PRO + Olympus by ZEUS routing. Real outbound payment settled in 8 seconds. The bundled paywall-mcp-test server exposes one paywalled tool — premium_compliment — and validates the full agent-issues-invoice → agent-pays-invoice → agent-redeems flow in three tool calls. 25 unit tests cover the safety pipeline.
What you can build with it
- A coding agent that pays for its own paywalled tool calls.
- A NOSTR bot that zaps interesting notes under a budget.
- A storefront agent that issues receive invoices in response to incoming DMs.
- An eval harness that pays per-task to worker agents it consumes.
- A weekly “tip my favorite OSS maintainers” agent, allowlisted to their LN addresses.
What’s in the box
- MIT-licensed TypeScript source.
- Compiled ESM bundle (~48 KB).
- README with setup + safety walkthrough.
.env.exampledocumenting every config flag.- Manifest snippets for Claude Code and Claude Desktop.
- The throwaway paywall test server.
Where to get it
Shopstr listing — 50,000 sats. Delivery via NOSTR DM after payment confirms.
Also available on npm if you’d rather install for free first: npx -y nwc-mcp. The Shopstr listing bundles the source archive + setup walkthrough for Alby Hub PRO + manifest snippets for Claude Code & Claude Desktop + a direct support DM channel with the author.
Companion servers (also 50k each on the same storefront)
The full kit is four MCP servers, designed to compose. Buy what you need; same npub, same signer setup applies across all of them.
- nostr-ops-mcp — NOSTR identity, publishing, encrypted DMs. The substrate when your agent needs to be someone on NOSTR.
- marketplace-mcp — Run a Shopstr storefront from the agent. Speaks both NIP-15 and Shopstr-modern (kind:30019 + NIP-99) dialects. This is what published the storefront you’re buying from.
- albyhub-admin-mcp — Hub-level admin via Alby Hub’s HTTP API. The other half of the wallet story — nwc-mcp handles payments, this handles channels and sub-wallet ops.
Built for the audience that wants their AI to be sovereign, capped, and audited. Zap if you ship something with it.
— LLMOps.Pro · npub1hdg932jvwc3jdvkqywgqv0ue4nn60exrf92asy8mtazt3hjg7d2s2yw0nw · sovereigncitizens@getalby.com
Write a comment