The Alby MCP Server enables AI agents and LLMs to integrate with Bitcoin Lightning wallets via Nostr Wallet Connect (NWC), offering these capabilities:
- Wallet Management: Retrieve wallet information, NWC capabilities, and lightning node details
- Payment Operations: Create and pay invoices with customizable metadata and parameters
- Balance Checking: View current wallet balance
- Invoice Handling: Look up and parse BOLT-11 invoice details using strings or payment hashes
- L402 Authentication: Access resources protected by L402, with automatic payment handling
- Currency Conversion: Convert fiat amounts to satoshis
- Lightning Address Support: Request invoices from lightning addresses
- Flexible Deployment: Can run in STDIO mode or as HTTP server (Streamable/SSE)
- Platform Integration: Compatible with Claude Desktop, Goose, Cline, and N8N
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.
Alby MCP Server
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.
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/sse
- HTTP 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:
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+walletconnect://...
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 -> Integrations
- Click on "Add Integration"
- Call it
alby
- What 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:
Add to Goose Desktop
- Open Goose Desktop
- Go To Settings -> Advanced Settings
- Click on "Add custom Extension"
- Call it
alby
, and change the type toSSE
- What is the SSE endpoint URI:
https://mcp.getalby.com/sse?nwc=ENCODED_NWC_URL
(see above for instructions) - Timeout: 30
- Description: no
- environment variables: no
Add to Goose CLI
Use the Alby MCP server (SSE)
- Type
goose configure
- Add extension -> Remote Extension
- Call it
alby
- What is the SSE endpoint URI:
https://mcp.getalby.com/sse?nwc=ENCODED_NWC_URL
(see above for instructions) - Timeout: 30
- Description: no
- environment variables: no
Client-side
- Type
goose configure
- Add extension -> Command Line Extension
- Call it
alby
- What command should be run:
npx -y @getalby/mcp
- Timeout: 30
- Description: no
- environment variables: yes
- environment variable name:
NWC_CONNECTION_STRING
- environment 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 to Claude Code
Use the Alby MCP server
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.
Create 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
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.
From Source
Prerequisites
- Node.js 20+
- Yarn
- A connection string from a lightning wallet that supports NWC
Installation
Building
Add 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.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Connects a Bitcoin Lightning wallet to your LLM using Nostr Wallet Connect, enabling payments and interactions with Lightning Network features.
Related MCP Servers
- -securityFlicense-qualityA server that adds Bitcoin payment capabilities to LLMs, enabling sending/receiving payments, creating charges, managing wallets, and performing other Bitcoin Lightning Network operations.Last updated -3TypeScript
- -securityFlicense-qualityA Model Context Protocol server that enables LLMs to access Binance Smart Chain data, perform blockchain queries, and create Four.meme tokens.Last updated -TypeScript
- -securityFlicense-qualityEnables interaction with lightning addresses and common lightning tools via your LLM, providing Lightning Network functionality through natural language.Last updated -151TypeScript
- AsecurityFlicenseAqualityConnects a Bitcoin Lightning wallet to your LLM using Nostr Wallet Connect, enabling payment functionalities within language models like Claude.Last updated -61512TypeScript