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.
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
Both require providing an NWC connection secret as authentication, either as Bearer authentication (preferred) or via the nwc query parameter.
Example: Authorization: Bearer nostr+walletconnect://...
If your agent UI supports bearer auth, just paste the connection secret into the bearer auth field.
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 and enter this in the console:
encodeURIComponent("nostr+walletconnect://...");And then copy the output and replace ENCODED_CONNECTION_SECRET. It will look like this: nostr%2Bwalletconnect%3A%2F%2F...
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"
}
}
}
}- 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
- 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)
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": []
}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
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
By default NWC MCP Server runs locally in STDIO mode.
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. (header example: Authorization: Bearer nostr+walletconnect://... )
- Node.js 20+
- Yarn
- A connection string from a lightning wallet that supports NWC
yarn installyarn buildCopy .env.example to .env and update your connection string
yarn inspect
See the tools directory