ln-payment-gateway-mcp
Provides an interface layer for AI agents to execute transactions over the Bitcoin Lightning Network, specifically for settling outstanding payment requests (invoices). Adheres to the Model Context Protocol standards for seamless integration.
Author

AbdelStark
Quick Info
Actions
Tags
⚡️ Lightning Payment Facilitator Service (MCP)
This service acts as a Model Context Protocol (MCP) bridge, enabling sophisticated autonomous agents to directly interface with the Lightning Network for the purpose of settling invoices.
Key Capabilities
- Invoice Settlement: Securely remit payments against provided Lightning Network invoices.
- Agent Abstraction: Exposes a compliant MCP endpoint, abstracting underlying LN node complexities from the AI consumer.
Development Roadmap
- [ ] Introduce modular support for diverse LN backend implementations (e.g., LND, CoreLN alongside LNBits).
- [ ] Integrate configuration for transport via standard input (STDIN), controlled by environment variables.
Requirements
- Runtime Environment: Node.js version 18 or newer.
Deployment Instructions
Automated Setup (Smithery)
For streamlined deployment to compatible environments (like Claude Desktop), utilize the Smithery CLI:
bash npx -y @smithery/cli install @AbdelStark/lightning-mcp --client claude
Manual Installation Guide
-
Source Acquisition: Clone the repository:
bash git clone https://github.com/AbdelStark/lightning-mcp cd lightning-mcp
-
Dependency Resolution: Install required packages:
bash npm install
-
Configuration Initialization: Establish the operational environment file (
.env). Refer to.env.examplefor structure.env
Configuration for Bitcoin Lightning Node Interface (LNBits Example)
LNBits Credentials
BITCOIN_LNBITS_NODE_URL="https://demo.lnbits.com" BITCOIN_LNBITS_ADMIN_KEY="..." BITCOIN_LNBITS_READ_KEY="..."
Operational Use
Launching the Service
Execute the appropriate command based on the deployment context:
bash
For active development cycles with automatic restarts
npm run dev
For stable, production deployment
npm start
Accessible Tooling
settle_invoice
Function designed to authorize and dispatch payment for a Lightning Network invoice string.
Input Payload Example:
{ "content": "lnbc20n1pneh8papp5x0syxmdqffcltfk8mqp00qc6j4kf5elkmr5pws9gm242mw9n0ejsdqqcqzzsxqyz5vqrzjqvueefmrckfdwyyu39m0lf24sqzcr9vcrmxrvgfn6empxz7phrjxvrttncqq0lcqqyqqqqlgqqqqqqgq2qsp563lg29qthfwgynluv7fvaq5d6y2hfdl383elgc6q68lccfzvpvfs9qxpqysgq2n6yhvs8aeugvrkcx8yjzdrqqmvp237500gxkrk0fe6d6crwpvlp96uvq9z2dfeetv5n23xpjlavgf0fgy4ch980mpv2rcsjasg2hqqpalykyc" }
Development Environment
Repository Structure
text lightning-mcp/ ├── src/ │ ├── index.ts # Primary execution script for the server │ ├── lnbits-client.ts # Implementation logic for LN communication │ └── types.ts # Protocol and data interface definitions ├── .env # Runtime environmental settings └── tsconfig.json # TypeScript compilation configuration
Quality Assurance
Execute unit and integration verification suites:
bash npm test
Collaboration Guidelines
We welcome contributions! Follow these steps to submit enhancements:
- Fork the current repository.
- Establish a dedicated feature branch (e.g.,
git checkout -b feature/novel-improvement). - Commit atomic changes (
git commit -m 'feat: implemented X feature'). - Push the branch to the remote (
git push origin feature/novel-improvement). - Submit a comprehensive Pull Request.
Legal Statement
This software is distributed under the permissive MIT License. Consult the LICENSE file for full details.
External References
- Lnbits Source Code
- Lnbits Public Demo Instance
- Model Context Protocol Specification
- MCP Server Inspection Utility
- Curated List of MCP Services
- Curated List of MCP Clients
- Official MCP TypeScript Development Kit
Connect
Find my public identifier below, or authenticate via QR code:
text npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29
Scan the accompanying graphic to establish a connection:

Crafted with dedication for the advancement of the Bitcoin ecosystem ❤️
WIKIPEDIA CONTEXT: The XMLHttpRequest (XHR) interface is a standard JavaScript object API utilized for exchanging data with web servers asynchronously after the initial page load. It forms the foundation of Asynchronous JavaScript and XML (Ajax) techniques, fundamentally shifting client-server interaction away from constant full-page reloads.
== Chronology == The genesis of XHR's functionality traces back to Microsoft Outlook developers around the year 2000, leading to its initial implementation in Internet Explorer 5 (1999). Early iterations utilized proprietary ActiveXObject identifiers (e.g., "Msxml2.XMLHTTP"). By the release of Internet Explorer 7 (2006), the standardized XMLHttpRequest object identifier became universally supported across major browser engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Efforts === The World Wide Web Consortium (W3C) published the first draft specification for XMLHttpRequest on April 5, 2006. A subsequent Level 2 draft in February 2008 introduced enhancements such as event progress monitoring, cross-site request capabilities, and byte stream handling, which were eventually merged back into the primary specification by late 2011. Development responsibility transitioned to the WHATWG in late 2012, where it is maintained as a dynamic document utilizing Web IDL definitions.
== Operational Methodology == Implementing an XHR request typically involves a sequence of programming steps:
- Instantiate the XMLHttpRequest client object via its constructor.
- Invoke the
open()method to define parameters: request method (GET/POST), target URI, and execution mode (synchronous or asynchronous). - For asynchronous operations, attach an event handler to monitor state transitions.
- Trigger the request transmission using the
send()method. - Process the response within the state change listener. Upon reaching state 4 (completion), the server response data is typically available in the
responseTextproperty.
Beyond these core stages, XHR offers granular control: custom headers can configure server expectations, data payloads can be uploaded via the send() argument, responses can be natively parsed from JSON, and requests can be prematurely terminated or subjected to timeouts.
