Bitcoin Lightning Client for Agentic Workflows
GitHub: https://github.com/ehallmark/btc-lightning-client
Motivation
This repository exists as a lightweight Python client to easily connect with a Lightning Network Daemon (lnd). This library is used by https://github.com/ehallmark/btc-lightning-tools for wrapping lnd in an MCP (Model Context Protocol) server to be used with Agentic systems.
Prerequisites
- You must have a running Lightning Network Daemon (
lnd) running on your machine. For more information onlnd, visit https://github.com/lightningnetwork/lnd. - Python >= 3.9
pip,uv, or similar for package management.
Installation
# with pip
pip install lightning-client-mcp
# or with uv
uv add lightning-client-mcp
Example Usage
import os
from google.protobuf.json_format import MessageToJson
from lightning_client import LightningClient
# Initialize the client
client = LightningClient(
rpc_port=10003,
cert_path=os.path.expanduser('~/Library/Application Support/Lnd/tls.cert'),
macaroon_path=os.path.expanduser('~/repos/lightning-ai/dev/charlie/data/chain/bitcoin/simnet/admin.macaroon')
)
# Call an RPC method
print(MessageToJson(client.ListChannels(client.ListChannelsRequest())))
# Output
{
"channels": [
{
"active": true,
"remotePubkey": "abc...",
...
}
]
}
Release files for lightning-client-mcp 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lightning_client_mcp-0.0.3.tar.gz | 49.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lightning_client_mcp-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.6 kB
Release files / lightning_client_mcp-0.0.3.tar.gz
| Download URL | lightning_client_mcp-0.0.3.tar.gz |
|---|---|
| Size | 49.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad183863c20ea1ddc44605232d9318653221523ca67734445b87031436b0677f
|
|
BLAKE2b-256 checksum How to use checksums |
c9a77bad7382a432d20e562883ac48ee5fed133869007efec05d9ade798b6ab1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / lightning_client_mcp-0.0.3-py3-none-any.whl
| Download URL | lightning_client_mcp-0.0.3-py3-none-any.whl |
|---|---|
| Size | 50.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c7e09e2aa8aa3065b3085ac5ae8adf2e06ca12f11fc90f365acc582a9bb3a97
|
|
BLAKE2b-256 checksum How to use checksums |
022f652e2bcce93dbf9b7e9ec9ffbbea71227e4e7810e4754a18f320b962fdbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|