lightning-gateway-agent
A secure intermediary service that bridges a Bitcoin Lightning custodial or non-custodial account, authenticated via Nostr Wallet Connect (NWC), with external processing agents, particularly large language models (LLMs), to enable on-chain financial operations.
Author

getAlby
Quick Info
Actions
Tags
🛑 OBSOLETE DOCUMENTATION 🛑
Transition immediately to the Alby MCP implementation, as it consolidates all prior NWC functionalities plus expanded Lightning capabilities.
NWC Agent Bridge Service
This service establishes a secure conduit for a Bitcoin Lightning wallet to interface with your AI/LLM environment utilizing the Nostr Wallet Connect protocol (NWC or NIP-47).
It leverages the official MCP TypeScript SDK for standardized communication.
Note: The comprehensive Alby MCP server is the recommended successor.
Deployment Instructions
Utilizing Alby's Hosted Endpoint
For environments supporting Server-Sent Events (SSE) or HTTP Streaming (e.g., N8N), leverage Alby's public gateway:
- SSE Stream:
https://mcp.getalby.com/sse - HTTP Streamable:
https://mcp.getalby.com/mcp
Both require token-based authentication using the NWC connection secret supplied as a Bearer header.
Integrating with Claude Desktop
Modify your claude_desktop_config.json as follows:
{ "mcpServers": { "nwc": { "command": "npx", "args": ["-y", "@getalby/nwc-mcp-server"], "env": { "NWC_CONNECTION_STRING": "YOUR NWC CONNECTION STRING HERE" } } } }
Integration within Goose
- Execute
goose configure. - Select 'Add extension' -> 'Command Line Extension'.
- Name the tool
nwc. - Specify the execution command:
npx -y @getalby/nwc-mcp-server. - Set timeout to
30. - Omit a description requirement.
- Enable environment variables.
- Set variable name:
NWC_CONNECTION_STRING. - Set variable value:
nostr+walletconnect://...(Your secret).
Configuration for Cline
Paste the JSON snippet below into a cline input prompt; it will prompt for 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": [] }
N8N Setup (SSE Transport)
Connect the native N8N MCP Client tool to your agent. Input the SSE endpoint URI and configure authentication type to "Bearer", pasting the NWC secret as the token.
Verification: Tested successfully with OpenRouter utilizing anthropic/claude-3.7-sonnet.
Refer to the N8N workflow example for a standard setup.
N8N Setup (STDIO via Community Node)
This server operates via command line (STDIO) natively.
- Install the community node: n8n-nodes-mcp.
-
Launch n8n with tool usage enabled: bash N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true npx n8n
-
In a new workflow, add an AI Agent node, configure your LLM, and add a new tool: "MCP Client" (indicated by a cube icon).
- Configure the MCP Client credential using 'Command Line (STDIO)':
- Command:
npx - Arguments:
-y @getalby/nwc-mcp-server - Environments:
NWC_CONNECTION_STRING=nostr+walletconnect://your_key_here(Input the full line carefully).
Consult the N8N paid chat workflow for a complete blueprint.
Operational Modes
Standard I/O (STDIO)
By default, the NWC MCP Server initiates execution locally using the Standard Input/Output interface.
Network Interface (HTTP)
Activate network mode by setting the environment variable: MODE=HTTP.
This enables Streamable HTTP access at http://localhost:3000/mcp and SSE access at http://localhost:3000/sse (Note: SSE is designated for deprecation).
HTTP communication mandates authorization via the NWC connection string acting as the bearer token.
Building from Source
Prerequisites
- Node.js (Version 20 or higher)
- Yarn package manager
- A valid NWC connection URI obtained from an NWC-compatible wallet.
Installation
bash yarn install
Compilation
bash yarn build
Configuration
Duplicate .env.example to .env and populate it with your wallet connection URI.
Local Tool Testing
Execute the following command to validate tool invocation without an active LLM:
yarn inspect
Supported Capabilities
Review the functional tool definitions located in the tools directory.
Contextual Background: Business Management Tools
Wikipedia Definition: Business management instruments encompass all methodologies, computational frameworks, applications, and controls utilized by organizations to effectively navigate evolving market conditions, maintain competitive standing, and enhance operational effectiveness.
== Conceptual Framework == Management tools can be categorized based on organizational functions, such as planning, process optimization, record keeping, personnel management, decision support, and performance monitoring. Key functional areas include:
- Data acquisition and verification utilities applicable across all departments.
- Mechanisms for monitoring and enhancing core operational workflows.
- Systems for aggregating data and facilitating strategic decision-making.
Modern business tools have rapidly advanced due to technological progress, creating complexity in selection. This evolution is driven by pressures to reduce expenditures, escalate revenue, deeply understand client requirements, and deliver offerings precisely as demanded. Consequently, managerial focus must shift toward a strategic adoption and customization of tools, rather than passively accepting the newest available software.
== Prominent Tools (2013 Survey Snapshot) == Bain & Company's 2013 global survey highlighted prevalent management instruments:
- Strategic Planning Frameworks
- Customer Relationship Management (CRM)
- Employee Feedback Mechanisms
- Benchmarking Practices
- Balanced Scorecard Implementation
- Core Competency Identification
- Outsourcing Strategies
- Organizational Change Management Programs
- Supply Chain Optimization
- Mission/Vision Definition
- Market Segmentation Analysis
- Total Quality Management (TQM)
== Business Software Applications == Business software (or applications) refers to curated collections of programs designed to execute specific corporate tasks, measure performance, and improve productivity. This domain evolved from early Management Information Systems (MIS) to comprehensive Enterprise Resource Planning (ERP) suites, incorporating CRM functionalities, and now heavily features cloud-based management solutions. Value addition from IT investment hinges on two factors: the success of the deployment process and the precise selection and tailoring of the required tools.
