Alby Bitcoin Payments MCP Server

Alby Bitcoin Payments MCP Server

Connect Bitcoin Lightning wallets to LLMs using Nostr Wallet Connect within the Model Context Protocol framework.

36
Stars
9
Forks
36
Watchers
0
Issues
Alby Bitcoin Payments MCP Server provides a way to integrate Bitcoin Lightning wallets with large language models (LLMs) via the Model Context Protocol (MCP). This server supports Nostr Wallet Connect (NWC), LNURL, and L402, enabling secure payment and authentication flows. Leveraging the official MCP TypeScript SDK along with Alby SDKs and tools, it allows agents and clients to interact with lightning wallets using various transport protocols like SSE and HTTP Streamable. The server can be integrated with tools such as Claude, Goose, and Cline for seamless wallet operations within AI workflows.

Key Features

Supports Nostr Wallet Connect (NWC) for wallet integration
Compliant with Model Context Protocol (MCP)
Integrates with LNURL and L402 standards for payments
Endpoints available over SSE and HTTP Streamable transports
Works with the official MCP TypeScript SDK
Provides remote and client-side interaction
Leverages Alby SDK and Lightning Tools
Bearer and query parameter-based authentication
Compatible with major AI agent hosts like Claude and Goose
Supports environment-based and header-based configuration

Use Cases

Adding Bitcoin Lightning payment capabilities to LLM-based agents
Automating wallet transactions within AI workflows
Remote management of wallet connections through standardized APIs
Providing secure authentication for agent-driven financial operations
Integrating payment and authentication tools in platforms like Claude and Goose
Accepting micropayments for AI agent-driven services
Testing payment flows with various LLM clients via MCP-compliant endpoints
Streamlining developer integration with pre-existing wallet infrastructure
Bridging cryptocurrency payments with SaaS AI applications
Enabling user-initiated or automated transactions in response to AI actions

README

Alby Bitcoin Payments 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:

js
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.

  1. Go to Settings -> Integrations
  2. Click on "Add Integration"
  3. Call it alby
  4. 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:

json
{
  "mcpServers": {
    "nwc": {
      "command": "npx",
      "args": ["-y", "@getalby/mcp"],
      "env": {
        "NWC_CONNECTION_STRING": "YOUR NWC CONNECTION STRING HERE"
      }
    }
  }
}

Add to Goose Desktop

  1. Open Goose Desktop
  2. Go To Settings -> Advanced Settings
  3. Click on "Add custom Extension"
  4. Call it alby, and change the type to HTTP Streamable
  5. What is the SSE endpoint URI: https://mcp.getalby.com/mcp
  6. Timeout: 30
  7. Description: no
  8. environment variables: no

Add to Goose CLI

Use the Alby MCP server

  1. Type goose configure
  2. Add extension -> Remote Extension (HTTP Streamable)
  3. Call it alby
  4. What is the HTTP Streamable endpoint URI: https://mcp.getalby.com/mcp
  5. Timeout: 30
  6. Description: no
  7. environment variables: no
  8. add custom headers: yes
  9. header name: Authorization
  10. header value: Bearer nostr+walletconnect://... (replace with your connection secret)

Client-side

  1. Type goose configure
  2. Add extension -> Command Line Extension
  3. Call it alby
  4. What command should be run: npx -y @getalby/mcp
  5. Timeout: 30
  6. Description: no
  7. environment variables: yes
  8. environment variable name: NWC_CONNECTION_STRING
  9. 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.

json
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

bash
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.

bash
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true npx n8n

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

Add to Windsurf

Use the remote Alby MCP server

  1. Download and open your Windsurf Editor
  2. 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"
  3. Paste this to your mcp_config.json:
json
{
  "mcpServers": {
    "alby": {
      "serverUrl": "https://mcp.getalby.com/sse?nwc=ENCODED_NWC_URL"
    }
  }
}
  1. 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

bash
yarn install

Building

bash
yarn build

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.

Star History

Star History Chart

Repository Owner

getAlby
getAlby

Organization

Repository Details

Language TypeScript
Default Branch master
Size 79 KB
Contributors 4
License Apache License 2.0
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
89.89%
JavaScript
6.44%
Dockerfile
3.66%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • NWC MCP Server

    NWC MCP Server

    Bridge your Bitcoin Lightning wallet with LLMs using Nostr Wallet Connect.

    NWC MCP Server enables users to connect Bitcoin Lightning wallets to language models through Nostr Wallet Connect (NWC) and NIP-47 protocols. It leverages the official Model Context Protocol (MCP) TypeScript SDK and supports various transport modes such as STDIO, HTTP streamable, and SSE. The solution can be integrated with platforms like N8N, Claude Desktop, Goose, and Cline, and allows authentication and context management using NWC connection secrets. Although now deprecated in favor of Alby MCP, it provides tooling for leveraging Lightning payment workflows within AI agent interactions.

    • 12
    • MCP
    • getAlby/nwc-mcp-server
  • Bitcoin & Lightning Network MCP Server

    Bitcoin & Lightning Network MCP Server

    Enable AI models to safely interact with Bitcoin and Lightning Network in a standardized way.

    The Bitcoin & Lightning Network MCP Server implements the Model Context Protocol, allowing AI models to interface with Bitcoin and Lightning Network functionalities such as key generation, address validation, transaction decoding, blockchain queries, and lightning payments. It provides standardized endpoints for AI model integration, including support for Claude Desktop and Goose. The solution supports querying blockchain data, parsing transactions and invoices, and managing cryptographic operations in a secure and extensible manner.

    • 65
    • MCP
    • AbdelStark/bitcoin-mcp
  • Base MCP Server

    Base MCP Server

    An extensible onchain Model Context Protocol (MCP) server for AI application integrations on Base and Coinbase.

    Base MCP Server is an implementation of the Model Context Protocol (MCP) that equips AI applications with onchain tools for interacting with the Base Network and Coinbase API. It offers capabilities such as wallet management, onchain transfers, smart contract interactions, ERC20 and NFT handling, and integration with external services like OpenRouter and Morpho. Its architecture is designed for easy extension, enabling the addition of third-party protocols, tools, and data sources via a modular plugin system.

    • 317
    • MCP
    • base/base-mcp
  • Alchemy MCP Server

    Alchemy MCP Server

    A Model Context Protocol server for structured AI access to blockchain data and actions via Alchemy.

    Alchemy MCP Server enables AI agents to interact with Alchemy’s blockchain APIs using the Model Context Protocol. It provides structured endpoints for querying token prices, NFT data, transaction history, asset transfers, and executing blockchain transactions. The server streamlines blockchain data retrieval while supporting multi-network operations and advanced actions like swaps and contract transactions when paired with wallet agents. It is designed for quick setup and seamless integration with AI tools.

    • 68
    • MCP
    • alchemyplatform/alchemy-mcp-server
  • Braintree MCP Server

    Braintree MCP Server

    Enables AI assistants to securely access and manage Braintree payment processing via MCP.

    Braintree MCP Server implements the Model Context Protocol (MCP) to provide AI assistants with structured, direct access to PayPal Braintree's payment services. It supports both STDIO and Server-Sent Events (SSE) transports, facilitating integration with AI clients and standalone web-based deployments. The server allows execution of GraphQL queries against Braintree, supports multi-client access, and handles authentication through environment-based configuration. Designed for secure, extensible, and automated payment operations in AI-driven workflows.

    • 3
    • MCP
    • QuentinCody/braintree-mcp-server
  • Bitcoin MCP Server

    Bitcoin MCP Server

    Real-time Bitcoin blockchain data server for MCP clients.

    Provides tools to deliver real-time Bitcoin blockchain data for use with Model Context Protocol (MCP) clients. Offers specialized endpoints for querying blockchain addresses, transactions, UTXOs, and block information by interfacing with the mempool.space API. Supports easy installation and integration with popular MCP clients, enabling seamless access to blockchain analytics.

    • 0
    • MCP
    • JamesANZ/bitcoin-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results