NWC MCP Server
The NWC MCP Server connects a Bitcoin Lightning wallet to an LLM using Nostr Wallet Connect (NWC) and provides several functionalities:
Retrieve wallet capabilities, service information, and details about the underlying lightning node
Create lightning invoices with customizable amounts, expiry, descriptions, and metadata
Pay lightning invoices, including zero-amount invoices with specified amounts
Check the current balance of the connected Lightning wallet
Look up invoice details using BOLT-11 invoice strings or payment hashes
Connects with Alby's Lightning wallet infrastructure through the NWC protocol, as evidenced by the package name (@getalby/nwc-mcp-server) and focus on Lightning Network integration.
Enables interaction with the Bitcoin Lightning Network for payment processing, allowing AI agents to initiate transactions and manage lightning wallet operations via Nostr Wallet Connect (NWC).
Provides tools for Bitcoin Lightning Network operations, enabling payment processing and wallet management through the Nostr Wallet Connect protocol.
Integrates with Nostr Wallet Connect protocol to enable secure connections between Lightning wallets and AI agents for processing cryptocurrency transactions.
Click on "Install 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., "@NWC MCP Serversend 1000 sats to alice@getalby.com for the article"
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.
⚠️ DEPRECATED ⚠️
Please use Alby MCP instead!
This repository has been deprecated in favor of Alby MCP, which includes all the NWC tools along with additional Lightning tools.
NWC MCP Server
Connect a bitcoin lightning wallet to your LLM using Nostr Wallet Connect (NWC or NIP-47).
This MCP server uses the official MCP TypeScript SDK
See also the Alby MCP server which includes additional useful tools.
Quick Start
Use the Alby-Hosted MCP Server
If your agent supports 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
Both require providing an NWC connection secret as Bearer authentication.
Add to Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"nwc": {
"command": "npx",
"args": ["-y", "@getalby/nwc-mcp-server"],
"env": {
"NWC_CONNECTION_STRING": "YOUR NWC CONNECTION STRING HERE"
}
}
}
}Add to Goose
Type
goose configureAdd extension -> Command Line Extension
Call it
nwcWhat command should be run:
npx -y @getalby/nwc-mcp-serverTimeout: 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/nwc-mcp-server"],
"env": {
"NWC_CONNECTION_STRING": "nostr+walletconnect://..."
},
"disabled": false,
"autoApprove": []
}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/nwc-mcp-server
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
Related MCP server: Lightning Tools 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.
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
Available Tools
6 toolsget_balanceA
Get the balance of the connected lightning wallet
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves balance but does not describe any behavioral traits such as whether it requires authentication, has rate limits, returns real-time or cached data, or handles errors. This leaves significant gaps for a tool interacting with a financial system.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose with no unnecessary words. It is front-loaded and appropriately sized, making it easy to parse without sacrificing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a financial tool with no annotations and no output schema, the description is incomplete. It does not explain what the balance value represents (e.g., currency units, format), whether it includes pending transactions, or any error conditions. For a tool with zero structured coverage beyond input schema, more context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description adds no parameter information, which is appropriate here, but it does not compensate for any gaps (none exist). Baseline is 4 for zero-parameter tools as no additional semantics are needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Get') and target resource ('balance of the connected lightning wallet'), distinguishing it from sibling tools like get_info (general info) or lookup_invoice (invoice-specific). It precisely defines what the tool does without being vague or tautological.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context (when you need the wallet balance) but does not explicitly state when to use this tool versus alternatives like get_wallet_service_info or other financial tools. No exclusions or specific scenarios are mentioned, leaving usage guidance at an implied level.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_infoB
Get NWC capabilities of the connected lightning wallet, and general information about the wallet and underlying lightning node
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but lacks details on permissions, rate limits, error handling, or response format, which are critical for a tool interacting with a wallet.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the key action ('Get') and specifies the information types. It avoids unnecessary words, though it could be slightly more structured by separating the different information categories.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of interacting with a lightning wallet and the absence of annotations and output schema, the description is incomplete. It doesn't explain what specific data is returned (e.g., balance, node ID, capabilities list), error conditions, or dependencies, leaving gaps for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on the tool's purpose without redundant parameter details, aligning with the baseline expectation for zero-parameter tools.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: retrieving NWC capabilities, wallet information, and lightning node details. It specifies the resource (connected lightning wallet) and the type of information returned, though it doesn't explicitly differentiate from sibling tools like 'get_wallet_service_info' or 'get_balance'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance is provided on when to use this tool versus alternatives. While the description implies it's for general information retrieval, it doesn't specify use cases, prerequisites, or contrast with siblings such as 'get_wallet_service_info' for more specific data.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_wallet_service_infoB
Get NWC capabilities, supported encryption and notification types of the connected lightning wallet
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation ('Get') but doesn't specify whether it requires authentication, has rate limits, or details the return format. While it hints at querying a connected wallet, it lacks comprehensive behavioral context, resulting in an average score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the key action and details without any wasted words. It directly communicates the tool's function in a structured manner, making it highly concise and well-organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavioral traits, usage context, or output format, leaving gaps that could hinder an AI agent's understanding in more complex scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds no parameter-specific information, which is appropriate here, but it doesn't compensate for any gaps since there are none. A baseline of 4 is applied as per the rules for zero parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and the specific information retrieved ('NWC capabilities, supported encryption and notification types of the connected lightning wallet'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this from sibling tools like 'get_info' or 'get_balance', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_info' or 'get_balance', nor does it mention any prerequisites or contextual cues for invocation. This lack of comparative or situational advice limits its utility for an AI agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lookup_invoiceC
Look up lightning invoice details from a BOLT-11 invoice or payment hash
| Name | Required | Description | Default |
|---|---|---|---|
| payment_hash | No | The payment hash of the invoice to look up | |
| invoice | No | The BOLT 11 invoice to look up |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool is for 'look up' (implying a read operation), but doesn't clarify if it requires authentication, has rate limits, returns specific error conditions, or what 'details' include. For a tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It front-loads the core purpose and uses precise terminology ('BOLT-11 invoice', 'payment hash'), making it easy to parse quickly. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'details' are returned (e.g., status, amount, timestamps), potential errors, or behavioral aspects like idempotency. For a tool with 2 parameters and no structured output documentation, this leaves critical gaps for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description mentions the two input types ('BOLT-11 invoice or payment hash'), but the input schema already has 100% coverage with clear descriptions for 'payment_hash' and 'invoice'. The description adds minimal value beyond the schema, such as implying these are alternative inputs, but doesn't explain their relationship (e.g., if both can be used together). Baseline 3 is appropriate given high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Look up lightning invoice details from a BOLT-11 invoice or payment hash.' It specifies the verb ('look up'), resource ('lightning invoice details'), and input types. However, it doesn't explicitly differentiate from sibling tools like 'get_info' or 'make_invoice', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_info' (which might provide general info) or 'pay_invoice' (which might involve payment actions), nor does it specify prerequisites or exclusions. This leaves the agent with minimal context for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
make_invoiceC
Create a lightning invoice
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | amount in millisats | |
| expiry | No | expiry in seconds | |
| description | No | note, memo or description describing the invoice | |
| description_hash | No | hash of a note, memo or description that is too long to fit within the invoice | |
| metadata | No | Optional metadata to include with the payment |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Create') but lacks critical details: it doesn't mention whether this is a read-only or mutating operation (though 'Create' implies mutation), what permissions are required, potential side effects (e.g., generating a payment request), rate limits, or what the output looks like (especially problematic without an output schema).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise ('Create a lightning invoice')—just three words—with zero wasted language. It's front-loaded with the core action and resource, making it efficient for quick understanding, though this brevity contributes to gaps in other dimensions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (a financial transaction tool with 5 parameters, no annotations, and no output schema), the description is incomplete. It doesn't address behavioral aspects like mutation effects, authentication needs, or output format, nor does it provide usage context. For a tool that creates invoices in a payment system, more detail is warranted to ensure safe and correct use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain relationships between parameters like 'description' and 'description_hash'). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Create') and the resource ('a lightning invoice'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling tools like 'lookup_invoice' or 'pay_invoice', which would require mentioning that this generates new invoices rather than querying or paying existing ones.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a lightning wallet), contrast with sibling tools (e.g., 'lookup_invoice' for querying, 'pay_invoice' for paying), or specify appropriate contexts (e.g., for receiving payments).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pay_invoiceC
Pay a lightning invoice
| Name | Required | Description | Default |
|---|---|---|---|
| invoice | Yes | The lightning invoice to pay | |
| amount | No | Optional amount in millisats to pay a zero-amount invoice | |
| metadata | No | Optional metadata to include with the payment |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but lacks critical details like whether this is a destructive operation, what permissions are needed, potential side effects (e.g., fund transfer), or error handling, leaving significant gaps for a payment tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste, front-loading the core action. It's appropriately sized for the tool's complexity, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (a payment operation with financial implications), no annotations, and no output schema, the description is incomplete. It fails to address behavioral aspects, return values, or error cases, leaving the agent with insufficient context for safe and effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning beyond the schema, such as explaining the 'amount' parameter's role with zero-amount invoices or 'metadata' usage. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('pay') and resource ('a lightning invoice'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'make_invoice' or 'lookup_invoice' beyond the verb, which keeps it from a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as having sufficient balance, or clarify scenarios like paying zero-amount invoices with the 'amount' parameter, leaving usage context ambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Most tools have distinct purposes, but get_info and get_wallet_service_info overlap significantly in functionality, which could cause confusion for an agent. The other tools (balance, invoice operations) are clearly differentiated.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., get_balance, make_invoice, pay_invoice). This predictability makes the set easy to navigate and understand.
With 6 tools, this server is well-scoped for managing a lightning wallet, covering key operations like balance, info, and invoice handling. The count is neither too sparse nor overwhelming for the domain.
The toolset covers essential lightning wallet operations, but there are minor gaps, such as no explicit tools for managing notifications or encryption settings, which are mentioned in get_wallet_service_info. Core workflows like invoice creation and payment are well-supported.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Personal finance, bank account, and shared memory connector for Claude, ChatGPT, Gemini Spark & more
Non-custodial crypto payments for AI assistants: balances, payments, and create payment links.
Connects AI assistants to CloudQuell multi-cloud and AI cost, savings, anomaly, and budget data.
Monetize and manage your Tip4Serv store directly from your LLM.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI models to interact with the Lightning Network by providing an MCP-compliant API to pay invoices.206MIT
- AlicenseBqualityFmaintenanceEnables interaction with lightning addresses and common lightning tools via your LLM, providing Lightning Network functionality through natural language.3211MIT
- 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.30Apache 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.1317MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/getAlby/nwc-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server