btc-lightning-mcp-server
If you are the rightful owner of btc-lightning-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This MCP server facilitates interaction with the Bitcoin Lightning Network using a local Lightning Network Daemon (lnd).
MCP Server for Bitcoin Lightning
This repository uses https://github.com/ehallmark/btc-lightning-client for communicating with a local Lightning Network Daemon (lnd
) and wraps it in a Model Context Protocol (MCP) server. This MCP server can be used with Agentic systems to interact with the Lightning Network.
Prerequisites
- Python >= 3.10
uv
for package management- You must have a running Lightning Network Daemon (
lnd
) running on your machine. For more information onlnd
, visit https://github.com/lightningnetwork/lnd.
Running the MCP Server
export LIGHTNING_RPC_PORT=<lnd_port>
export LIGHTNING_CERT_PATH="/path/to/lnd/tls.cert"
export LIGHTNING_MACAROON_PATH=/path/to/bitcoin/simnet/admin.macaroon
export UVICORN_PORT=<some port>
export UVICORN_HOST=<some host>
uv run main.py
Connecting to the MCP Server
This server uses SSE for transport.
With the LangGraph framework, you can connect to it using the following adapter:
from contextlib import asynccontextmanager
from langchain_mcp_adapters.client import MultiServerMCPClient
@asynccontextmanager
async def make_graph():
async with MultiServerMCPClient(
{
'lightning': {
'url': 'http://localhost:8000/sse',
'transport': 'sse',
}
}
) as lightning_mcp:
workflow = create_workflow(user, lightning_mcp)
graph = workflow.compile()
yield graph