A Bitcoin lightning client designed for agentic workflows and tools.
Project description
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...",
...
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lightning_client_mcp-0.0.2.tar.gz.
File metadata
- Download URL: lightning_client_mcp-0.0.2.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e54d1d583418a55dc4156da1dd68e4909e1c57b3e03784e760fd783358e11b0
|
|
| MD5 |
202302d51ad5830bec0c5a199f1bc8b0
|
|
| BLAKE2b-256 |
7ad2f4d44e05bcddfa47098b8445f7881de34916d7d85537a22e09ea987207cc
|
File details
Details for the file lightning_client_mcp-0.0.2-py3-none-any.whl.
File metadata
- Download URL: lightning_client_mcp-0.0.2-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
555299b7d811da3f124547a4c1ae8e345a00792a3ae9a0e8609a6c4b530c6b67
|
|
| MD5 |
6839ada1cba0a16df2a4da9dd686360a
|
|
| BLAKE2b-256 |
764d94ac8d2937f0d065aca061f45a9c2e1c9447b5ea6d7e69de95af6ac3bad7
|