logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

ln-payment-gateway-mcp logo

AbdelStark

MIT License

Quick Info

GitHub GitHub Stars 3
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

apiinvoiceapisapi aiinvoice paymentsintegration lightning

⚡️ 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.

Smithery Integration Badge Language Badge Protocol Adherence Network Link

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

  1. Source Acquisition: Clone the repository:

    bash git clone https://github.com/AbdelStark/lightning-mcp cd lightning-mcp

  2. Dependency Resolution: Install required packages:

    bash npm install

  3. Configuration Initialization: Establish the operational environment file (.env). Refer to .env.example for 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:

  1. Fork the current repository.
  2. Establish a dedicated feature branch (e.g., git checkout -b feature/novel-improvement).
  3. Commit atomic changes (git commit -m 'feat: implemented X feature').
  4. Push the branch to the remote (git push origin feature/novel-improvement).
  5. Submit a comprehensive Pull Request.

This software is distributed under the permissive MIT License. Consult the LICENSE file for full details.

External References

Connect

Find my public identifier below, or authenticate via QR code:

text npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29

Scan the accompanying graphic to establish a connection:

Nostr Public Key QR Code


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:

  1. Instantiate the XMLHttpRequest client object via its constructor.
  2. Invoke the open() method to define parameters: request method (GET/POST), target URI, and execution mode (synchronous or asynchronous).
  3. For asynchronous operations, attach an event handler to monitor state transitions.
  4. Trigger the request transmission using the send() method.
  5. Process the response within the state change listener. Upon reaching state 4 (completion), the server response data is typically available in the responseText property.

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.

See Also

`