Skip to main content

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 on lnd, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightning_client_mcp-0.0.2.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lightning_client_mcp-0.0.2-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file lightning_client_mcp-0.0.2.tar.gz.

File metadata

File hashes

Hashes for lightning_client_mcp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2e54d1d583418a55dc4156da1dd68e4909e1c57b3e03784e760fd783358e11b0
MD5 202302d51ad5830bec0c5a199f1bc8b0
BLAKE2b-256 7ad2f4d44e05bcddfa47098b8445f7881de34916d7d85537a22e09ea987207cc

See more details on using hashes here.

File details

Details for the file lightning_client_mcp-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lightning_client_mcp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 555299b7d811da3f124547a4c1ae8e345a00792a3ae9a0e8609a6c4b530c6b67
MD5 6839ada1cba0a16df2a4da9dd686360a
BLAKE2b-256 764d94ac8d2937f0d065aca061f45a9c2e1c9447b5ea6d7e69de95af6ac3bad7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page