Alby Bitcoin Payments MCP Server
OfficialConnect an LLM/agent to a bitcoin lightning wallet via Nostr Wallet Connect (NWC) to query wallet/node info and perform lightning payment and invoice operations.
Get wallet service info: NWC capabilities, encryption types, and notification support.
Get wallet/node info: alias, pubkey, lud16, network, block height/hash, supported methods, metadata.
Create lightning invoices with amount, description, expiry, metadata, and description hash.
Pay lightning invoices, optionally specifying amount for zero-amount invoices.
Check the connected wallet balance in sats.
Look up invoice/transaction details by BOLT-11 invoice or payment hash.
List transactions with filters by time, type, limit, offset, and unpaid status.
Fetch paid resources protected by L402, with URL, method, and body.
Convert fiat amounts to sats.
Parse BOLT-11 lightning invoices.
Request an invoice from a lightning address, with amount, description, and payer metadata.
Run locally via STDIO, HTTP Streamable, or SSE, or connect to Alby's hosted MCP server with bearer or query-parameter NWC authentication.
Connects to Alby's lightning wallet to enable Bitcoin payments through the MCP server, allowing AI agents to send and receive Bitcoin Lightning payments.
Provides Bitcoin Lightning Network payment capabilities through Nostr Wallet Connect (NWC), LNURL, and L402 protocols.
Supports direct integration with n8n workflows through both SSE and STDIO connections, allowing n8n to use the MCP server as a tool for AI agents.
Implements Nostr Wallet Connect (NWC) to securely connect Bitcoin lightning wallets to AI agents, enabling cryptocurrency transactions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Alby Bitcoin Payments MCP Server send 500 sats to alice@getalby.com for coffee"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Alby Bitcoin Payments MCP Server
NEW: also checkout Alby CLI for agents that don't support MCP.
Connect a bitcoin lightning wallet to your LLM using Nostr Wallet Connect (NWC).
This MCP server uses the official MCP TypeScript SDK
This MCP server has knowledge of NWC, LNURL and L402 using Alby SDK and Alby Lightning Tools.
Take a look at Awesome AI Bitcoin for places where you can use the Alby MCP.
Quick Start
In case you get stuck, see troubleshooting section below.
Use the Alby-Hosted MCP Server
If your agent supports remote MCP servers - SSE (e.g. N8N) or HTTP Streamable transports, you can connect to Alby's MCP server.
SSE:
https://mcp.getalby.com/sseHTTP Streamable:
https://mcp.getalby.com/mcp
Authentication
Both require providing an NWC connection secret as authentication, either as Bearer authentication (preferred) or via the nwc query parameter.
Bearer Auth
Example: Authorization: Bearer nostr+walletconnect://...
If your agent UI supports bearer auth, just paste the connection secret into the bearer auth field.
Query Parameter
If your agent doesn't support bearer auth, you can pass the NWC connection secret as a query parameter.
Example: https://mcp.getalby.com/sse?nwc=ENCODED_CONNECTION_SECRET or https://mcp.getalby.com/mcp?nwc=ENCODED_CONNECTION_SECRET
To get ENCODED_CONNECTION_SECRET, open browser devtools (right click -> inspect) and enter this in the console, with your own NWC connection secret set:
encodeURIComponent("nostr+walletconnect://...");In case there is a message asking for confirmation for pasting, follow the instructions, and then enter the above command again.
Once the command has run, copy the output and replace ENCODED_CONNECTION_SECRET. It will look like this: nostr%2Bwalletconnect%3A%2F%2F...
Add to Claude Web or Claude Desktop
Use the remote Alby MCP server
Currently, at least a Claude Pro subscription is required to be able to connect to remote MCP servers.
Go to Settings -> Connectors
Click on "Add custom connector"
Call it
albyWhat is the endpoint URI:
https://mcp.getalby.com/mcp?nwc=ENCODED_NWC_URL(see above for instructions)
Client-side
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"nwc": {
"command": "npx",
"args": ["-y", "@getalby/mcp"],
"env": {
"NWC_CONNECTION_STRING": "YOUR NWC CONNECTION STRING HERE"
}
}
}
}Add to Goose Desktop
Open Goose Desktop
Go To Settings -> Advanced Settings
Click on "Add custom Extension"
Call it
alby, and change the type toHTTP StreamableWhat is the SSE endpoint URI:
https://mcp.getalby.com/mcpTimeout: 30
Description: no
environment variables: no
Add to Goose CLI
Use the Alby MCP server
Type
goose configureAdd extension -> Remote Extension (HTTP Streamable)
Call it
albyWhat is the HTTP Streamable endpoint URI:
https://mcp.getalby.com/mcpTimeout: 30
Description: no
environment variables: no
add custom headers: yes
header name:
Authorizationheader value:
Bearer nostr+walletconnect://...(replace with your connection secret)
Client-side
Type
goose configureAdd extension -> Command Line Extension
Call it
albyWhat command should be run:
npx -y @getalby/mcpTimeout: 30
Description: no
environment variables: yes
environment variable name:
NWC_CONNECTION_STRINGenvironment variable value:
nostr+walletconnect://...(your NWC connection secret here)
Add to Cline
Copy the below and paste it into a cline prompt. It should prompt you to update the connection string.
Add the following to my MCP servers list:
"nwc": {
"command": "npx",
"args": ["-y", "@getalby/mcp"],
"env": {
"NWC_CONNECTION_STRING": "nostr+walletconnect://..."
},
"disabled": false,
"autoApprove": []
}Add to Claude Code
Use the Alby MCP server
claude mcp add --transport http alby https://mcp.getalby.com/mcp --header "Authorization: Bearer nostr+walletconnect://..."Add to N8N via SSE
You can use the native N8N MCP Client tool connected to an AI agent. Enter your SSE endpoint, set authentication to "Bearer" and paste your NWC connection secret.
Tested with OpenRouter + anthropic/claude-3.7-sonnet
See the N8N workflow for a simple example
Add to N8N via STDIO (Community Node)
Currently this MCP server only works via command line (STDIO).
You can install the n8n-nodes-mcp community node and run n8n with tools enabled e.g.
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true npx n8nCreate a blank workflow and add an AI agent node. Configure your LLM model and add a new tool "MCP Client" (which will have a cube next to it showing it's a community node).
Configure the MCP Client by adding a credential with Command Line (STDIO) selected.
command: npx
arguments: -y @getalby/mcp
environments NWC_CONNECTION_STRING=nostr+walletconnect://your_key_here (create the whole line in a text editor and paste it in, since the password field cannot be switched to plaintext)
See the N8N paid chat workflow for a full example
Add to Windsurf
Use the remote Alby MCP server
Download and open your Windsurf Editor
Click on "Windsurf - Settings" in the toolbar at the bottom -> "Advanced Settings" -> "Cascade" -> Plugins (MCP Servers): Click on "Manage plugins" -> "View raw config" -> you'll see your "mcp_config.json"
Paste this to your mcp_config.json:
{
"mcpServers": {
"alby": {
"serverUrl": "https://mcp.getalby.com/sse?nwc=ENCODED_NWC_URL"
}
}
}Replace "ENCODED_NWC_URL" as descripted above. Click "Save" and restart the Windsurf editor.
Related MCP server: Alby Bitcoin Payments MCP Server
Modes
STDIO
By default NWC MCP Server runs locally in STDIO mode.
HTTP
You can set the following environment variable: MODE=HTTP which will enable Streamable HTTP (http://localhost:3000/mcp) and SSE (http://localhost:3000/sse Note: SSE is deprecated).
HTTP requires bearer authorization, where the token is a wallet's NWC connection secret. See the authentication section further above in the README.
Request validation
The HTTP endpoints only accept requests whose Host header is allowlisted. Requests from browsers (carrying an Origin header) are refused; MCP clients that aren't browsers don't send one. fetch_l402 only fetches http(s) URLs whose hostname resolves to globally-routable addresses — loopback, link-local and private ranges are refused. This is a best-effort check: the hostname is resolved again when fetching, so a DNS server that changes its answer between the two lookups can bypass it. Configure via environment variables:
Variable | Default | Purpose |
|
|
|
|
| Address the HTTP listener binds to. The default keeps it off the network; set |
fetch_l402 does not follow redirects; a URL that redirects returns an error.
From Source
Prerequisites
Node.js 20+
Yarn
A connection string from a lightning wallet that supports NWC
Installation
yarn installBuilding
yarn buildAdd your NWC connection
Copy .env.example to .env and update your connection string
Inspect the tools (use/test without an LLM)
yarn inspect
Supported Tools
See the tools directory
Troubleshooting
Model Usage
Make sure you use a decent model (e.g. Claude Sonnet 3.7) otherwise the MCP server will not work.
Failure to connect to wallet, secret missing
Make sure you copied the entire NWC connection secret, without spaces
Contact Alby Support
Visit support.getalby.com and we're happy to help you get the MCP server working.
Available Tools
11 toolsfetch_l402Fetch L402C
Fetch a paid resource protected by L402
Inputs: url (required), body, method. Returns: content
fiat_to_satsFiat To SatsB
Convert fiat amounts to sats
Inputs: fiat_amount (required), fiat_currency (required). Returns: amount_in_sats
get_balanceGet BalanceB
Get the balance of the connected lightning wallet
Inputs: no named parameters. Returns: amount_in_sats
get_infoGet InfoB
Get NWC capabilities of the connected lightning wallet, and general information about the wallet and underlying lightning node
Inputs: no named parameters. Returns: alias, color, lud16, pubkey, +6 more
get_wallet_service_infoGet Wallet Service InfoA
Get NWC capabilities, supported encryption and notification types of the connected lightning wallet
Inputs: no named parameters. Returns: encryptions, capabilities, notifications
list_transactionsList TransactionsC
List all transactions from the connected wallet with optional filtering by time, type, and limit
Inputs: from, type, limit, until, +2 more. Returns: total_count, transactions
lookup_invoiceLookup InvoiceB
Look up lightning invoice details from a BOLT-11 invoice or payment hash
Inputs: invoice, payment_hash. Returns: type, state, invoice, metadata, +10 more
make_invoiceMake InvoiceC
Create a lightning invoice
Inputs: amount_in_sats (required), expiry, metadata, description, +1 more. Returns: type, state, invoice, metadata, +10 more
parse_invoiceParse InvoiceC
Parse a BOLT-11 lightning invoice
Inputs: invoice (required). Returns: expiry, verify, preimage, timestamp, +7 more
pay_invoicePay InvoiceC
Pay a lightning invoice
Inputs: invoice (required), metadata, amount_in_sats. Returns: preimage, fees_paid_in_sats
request_invoiceRequest InvoiceC
Request an invoice from a lightning address
Inputs: amount_in_sats (required), lightning_address (required), payer_data, description. Returns: expiry, verify, preimage, timestamp, +7 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools target distinct actions (make/pay/request/parse invoices, balance, transactions), but get_info and get_wallet_service_info both return NWC capabilities of the same wallet and are nearly indistinguishable, and parse_invoice vs lookup_invoice have subtle boundaries (local parse vs lookup by hash) that could cause misselection.
Almost all tools follow a clean verb_noun snake_case pattern (fetch_l402, get_info, make_invoice, pay_invoice, lookup_invoice, list_transactions, parse_invoice, request_invoice, get_balance), with only fiat_to_sats deviating as a noun_to_noun converter.
11 tools is a well-scoped size for a Lightning/NWC payments server, covering the core payment lifecycle without excessive bloat; the only redundancy is the pair of capability-introspection tools.
The surface covers invoice creation, payment, lookup, parsing, transaction listing, balance, fiat conversion, and L402 fetching, giving good lifecycle coverage; minor gaps like fee estimation or direct keysend/pay-to-address are workarounds, not dead ends.
Maintenance
Related MCP Connectors
Give AI agents a Bitcoin wallet with Lightning Network payments and L402 support.
Crypto payments for AI agents: self-serve account, invoices, receiving, payouts, exchange.
Crypto pay links and API for people and AI agents. BTC, Lightning, USDC, USDT, EURC, SOL, ETH.
Keyless non-custodial crypto payments for AI agents: payment links and tip jars, no API key.
Related MCP Servers
- AlicenseBqualityFmaintenanceConnects a Bitcoin Lightning wallet to your LLM using Nostr Wallet Connect, enabling payment functionalities within language models like Claude.611 npm15MIT
- AlicenseNot gradedqualityDmaintenanceEnables Bitcoin Lightning wallet integration with LLMs through Nostr Wallet Connect (NWC). Supports lightning payments, LNURL operations, and L402 authentication for AI-powered bitcoin transactions.Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI agents to perform Bitcoin and Lightning Network payments using a non-custodial, zero-trust architecture. It provides 13 tools for wallet management, invoice creation, and payment processing while keeping node credentials local to the user's machine.13MIT
- AlicenseAqualityCmaintenanceEnables AI agents to manage Bitcoin micropayments, service offers, and escrow contracts through MCP tools, without requiring a Lightning node.8MIT