Lightning Nostr MCP server

Integrates with Nostr to enable posting notes and interacting with relays, simplifying decentralized social network engagement and content publishing.
Back to servers
Setup instructions
Provider
Abdel Stark
Release date
Jan 31, 2025
Language
TypeScript
Package
Stats
1.2K downloads
3 stars

The Lightning Network MCP Server enables AI models to interact with the Lightning Network, allowing them to pay invoices through a Model Context Protocol (MCP) compliant API. This integration allows AI systems to initiate payments directly on the Lightning Network.

Prerequisites

  • Node.js 18+

Installation

Installing via Smithery

If you're using Claude Desktop, you can install the Lightning Network MCP Server automatically:

npx -y @smithery/cli install @AbdelStark/lightning-mcp --client claude

Manual Installation

To install manually:

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

Then create a .env file with your Lightning Network configuration:

# Bitcoin Lightning Network
## lnbits information
BITCOIN_LNBITS_NODE_URL="https://demo.lnbits.com"
BITCOIN_LNBITS_ADMIN_KEY="..."
BITCOIN_LNBITS_READ_KEY="..."

You can copy the .env.example file and modify it with your own LNbits credentials.

Usage

Starting the Server

To run the server in development mode with hot reload:

npm run dev

For production:

npm start

Available Tools

pay_invoice

This tool allows you to pay Lightning Network invoices. Here's an example of the input format:

{
  "content": "lnbc20n1pneh8papp5x0syxmdqffcltfk8mqp00qc6j4kf5elkmr5pws9gm242mw9n0ejsdqqcqzzsxqyz5vqrzjqvueefmrckfdwyyu39m0lf24sqzcr9vcrmxrvgfn6empxz7phrjxvrttncqq0lcqqyqqqqlgqqqqqqgq2qsp563lg29qthfwgynluv7fvaq5d6y2hfdl383elgc6q68lccfzvpvfs9qxpqysgq2n6yhvs8aeugvrkcx8yjzdrqqmvp237500gxkrk0fe6d6crwpvlp96uvq9z2dfeetv5n23xpjlavgf0fgy4ch980mpv2rcsjasg2hqqpalykyc"
}

The content field should contain a valid Lightning Network invoice in BOLT11 format. When you send this request to the MCP server, it will process the payment using the configured LNbits account.

Resources

For more information about the technologies used in this project:

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "lightning-mcp" '{"command":"npx","args":["-y","@smithery/cli","run","@AbdelStark/lightning-mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "lightning-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@smithery/cli",
                "run",
                "@AbdelStark/lightning-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "lightning-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@smithery/cli",
                "run",
                "@AbdelStark/lightning-mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later