Tools · Agent-integration primitives
Alby & Nostr Wallet Connect (NWC)
A standard for controlling a Lightning wallet remotely — scoped, budgeted, and revocable — without ever handing over the keys.
What it is
Nostr Wallet Connect (NWC, NIP-47) is an open protocol that lets an application or agent control a Lightning wallet remotely — create invoices, send payments, check balances — without ever holding the wallet’s private keys. The wallet (which holds the keys and signs) and the app (which signs nothing) talk over Nostr relays. The agent holds a revocable, scoped connection string instead of a key, which drastically shrinks its attack surface.
Alby is the primary builder and promoter of the standard: the Alby browser extension, Alby Hub (a self-custodial node manager), a JavaScript SDK, and — most relevant for agents — Alby MCP (@getalby/mcp), which exposes NWC payments (plus LNURL and L402 knowledge) to Claude, Cursor, Hermes, or n8n as MCP tools. (The earlier nwc-mcp-server is archived and now points users to @getalby/mcp.)
NWC is usually described from the paying side — an agent holding a scoped connection to spend. It runs the other direction too: ContextVM’s CEP-8 payment spec has the server hold an NWC connection to receive payment and verify settlement for a priced tool call. Same connection-string primitive, both ends of the transaction — the client’s to pay, the server’s to get paid.
When to use it
- Giving an agent the ability to pay without giving it custody of keys.
- Wiring Lightning payments into an MCP-capable agent (Claude, Cursor, Hermes, n8n) via Alby MCP (
@getalby/mcp). - Any app that needs delegated, budget-limited spend from a wallet the user still controls.
Dependencies
A Lightning wallet or node that speaks NWC (Alby Hub, or any NIP-47-compatible wallet) to hold the keys, plus a client or agent that holds the NWC connection string — kept scoped, budgeted, and revocable. Nothing custodial sits on the agent side; the transport runs over Nostr relays.
Quick start
Connect an MCP-capable agent to a wallet with Alby MCP (npx -y @getalby/mcp): generate an NWC connection string from Alby Hub (or any NWC-compatible wallet) with a spending budget, then point the MCP server at it via NWC_CONNECTION_STRING. The agent gets payment tools; the keys stay in the wallet. For the ready-made agent recipe, see the lightning-pay skill.
Gotchas
- The NWC connection string embeds a secret that grants wallet control — treat it as sensitive, and prefer budgeted, scoped connections (per-app spend caps) over full access.
- Transport runs over Nostr relays; relay availability and latency affect payment reliability — use multiple relays.
- Custody depends on the wallet behind the connection (self-custodial Alby Hub vs. a hosted wallet differ) — be explicit about which you are delegating from.
For agents — connect
Reach this programmatically — facts, not endorsements; verify before you depend on them.
- Prerequisite
- A funded wallet (custodial or self-custodial)
wallet - Connect to act
- stdio payment MCP · npx -y @getalby/mcp (pay_invoice, make_invoice, lookup_invoice, get_balance, get_info) · repo The payment MCP that complements the directory's discovery MCP — wraps a scoped, budgeted NWC (NIP-47) connection string (NWC_CONNECTION_STRING env) as Lightning payment tools for an MCP-capable agent; the keys stay in the wallet. This is Alby's current successor package (@getalby/mcp): the earlier @getalby/nwc-mcp-server is now marked deprecated on npm (2026-07 audit) — don't use it for new integrations. Tool names above are the NWC core set; verify against the repo before relying on them in production.
In the marketplace directory: call get_tool with slug alby-nwc at /mcp · this card as markdown.