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...",
...
}
]
}
Metadata
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 | Provenance | Actions |
|---|---|---|---|---|
| lightning_client_mcp-0.0.3.tar.gz | 49.5 kB | Without provenance | Details for lightning_client_mcp-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lightning_client_mcp-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for lightning_client_mcp-0.0.3-py3-none-any.whl |
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
|
Security for lightning-client-mcp 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.