Core Lightning MCP server

Provides direct access to Core Lightning nodes through gRPC interface, enabling Lightning Network operations including channel management, payment tracking, invoice handling, node monitoring, and financial analysis of routing fees and channel profitability.
Back to servers
Setup instructions
Provider
adi2011
Release date
Jun 12, 2025
Language
TypeScript
Stats
2 stars

Core Lightning MCP Server provides a standardized interface to Core Lightning nodes implementing the Model Context Protocol (MCP) specification. This Rust-based gRPC server enables control of Core Lightning nodes using Large Language Models, offering a user-friendly way to interact with your Lightning node.

Installation Options

Using Pre-built Binaries

  1. Download the appropriate binary from the latest release
  2. Extract the archive:
    # For Linux/macOS
    tar -xzf cln-mcp-<platform>.tar.gz
    
    # For Windows
    # Use your preferred zip extractor
    
  3. Make the binary executable (Linux/macOS only):
    chmod +x cln-mcp
    

Building from Source

Prerequisites

Before building from source, ensure you have:

  • Rust 1.80 or higher
  • Protocol Buffers Compiler (protoc)
  • Core Lightning (with gRPC enabled)
  • MCP clients (Claude, Goose, etc.)

Installing Protocol Buffers Compiler

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y protobuf-compiler

macOS:

brew install protobuf

Windows:

choco install protoc

Verify your installation:

protoc --version  # Should show version 3.0.0 or higher

Build Steps

  1. Clone the repository:

    git clone https://github.com/adi2011/cln-mcp.git
    cd cln-mcp
    
  2. Build the project:

    cargo build --release
    

Configuration and Usage

Command-Line Options

The server can be configured using command-line arguments:

cln-mcp [OPTIONS]

Options:
  --certs-dir <path>    Path to certificates directory
  --node-address <url>  Node address (default: https://localhost:9736)
  --help                Shows help message

TLS Certificate Setup

  1. Add the --grpc-port option (default: 9736) when running Core Lightning to automatically generate the appropriate mTLS certificates.

  2. Copy the following PEM files from your Lightning directory to a separate certificates directory:

    • ca.pem: CA certificate
    • client.pem: Client certificate
    • client-key.pem: Client private key

Configuring Claude for MCP

  1. Install Claude

  2. Go to settings -> Developer

  3. Edit Config by adding:

    {
        "mcpServers": {
            "cln-mcp": {
                "command": "Path/to/cln-mcp",
                "args": [
                    "--certs-dir",
                    "Path/to/certificates"
                ]
            }
        }
    }
    

    Replace "Path/to/cln-mcp" with the absolute path to the executable (e.g., "/Users/MyPC/cln-mcp/target/release/cln-mcp" or the path to the unzipped release executable).

    Replace "Path/to/certificates" with the absolute path to your certificates directory (e.g., "/Users/MyPC/cln-mcp/certs").

  4. Restart Claude

After completing the setup, you can use Claude to interact with your Core Lightning node through natural language commands.

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 "cln-mcp" '{"command":"cln-mcp","args":["--certs-dir","Path/to/certificates"]}'

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": {
        "cln-mcp": {
            "command": "cln-mcp",
            "args": [
                "--certs-dir",
                "Path/to/certificates"
            ]
        }
    }
}

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": {
        "cln-mcp": {
            "command": "cln-mcp",
            "args": [
                "--certs-dir",
                "Path/to/certificates"
            ]
        }
    }
}

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