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.3.tar.gz (49.5 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.3-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for lightning_client_mcp-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ad183863c20ea1ddc44605232d9318653221523ca67734445b87031436b0677f
MD5 8a1b31fc212f9f7c7aafe32eac0c9489
BLAKE2b-256 c9a77bad7382a432d20e562883ac48ee5fed133869007efec05d9ade798b6ab1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lightning_client_mcp-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4c7e09e2aa8aa3065b3085ac5ae8adf2e06ca12f11fc90f365acc582a9bb3a97
MD5 768b15e6b6a645152d6be1d82216e615
BLAKE2b-256 022f652e2bcce93dbf9b7e9ec9ffbbea71227e4e7810e4754a18f320b962fdbf

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