development
documentation
public
bitcoin
lightning
What is Connect a bitcoin lightning wallet to your LLM using Nostr Wallet Connect.?
This MCP server uses the official MCP TypeScript SDK and has knowledge of NWC, LNURL, and L402 using Alby SDK and Alby Lightning Tools. It supports remote MCP servers and requires an NWC connection secret for authentication.
Documentation
Alby Bitcoin Payments MCP Server
Connect a bitcoin lightning wallet to your LLM using Nostr Wallet Connect (NWC).
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 -> 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)
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
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)
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"
Replace "ENCODED_NWC_URL" as descripted above. Click "Save" and restart the Windsurf editor.
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
yarn install
Building
yarn build
Add your NWC connection
Copy .env.example to .env and update your connection string