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.
# For Linux/macOS
tar -xzf cln-mcp-<platform>.tar.gz
# For Windows
# Use your preferred zip extractor
chmod +x cln-mcp
Before building from source, ensure you have:
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
Clone the repository:
git clone https://github.com/adi2011/cln-mcp.git
cd cln-mcp
Build the project:
cargo build --release
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
Add the --grpc-port option (default: 9736) when running Core Lightning to automatically generate the appropriate mTLS certificates.
Copy the following PEM files from your Lightning directory to a separate certificates directory:
ca.pem: CA certificateclient.pem: Client certificateclient-key.pem: Client private keyInstall Claude
Go to settings -> Developer
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").
Restart Claude
After completing the setup, you can use Claude to interact with your Core Lightning node through natural language commands.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. 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