Logo Lightning Agent Tools

Lightning Agent Tools

Tổ chức
lightninglabs

AI agent toolkit (skills+MCP server) for Lightning Network payments. Run nodes, pay for APIs (L402), host paid endpoints, and manage credentials.

Nhà phát hànhlightninglabs
Kho mãlightning-agent-tools
Ngôn ngữShell
Bản fork
18
Sao
60
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Lightning Agent Tools cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    60 sao và 18 bản fork từ kho mã được liên kết.

Lightning Agent Tools

AI agents can read documentation, write code, and orchestrate complex workflows, but they can't easily pay for things. Traditional payment rails require government IDs, bank accounts, and manual enrollment, none of which work for autonomous software. Lightning Agent Tools bridges this gap by giving agents native access to the Lightning Network, a decentralized payment protocol capable of instant, high-volume transactions with no identity requirements.

The toolkit consists of seven composable skills and an MCP server. Together they let an agent run a Lightning node, pay for resources on the web using the L402 protocol, host its own paid API endpoints, manage scoped credentials, and query node state through the Model Context Protocol. The skills work with any agent framework that can execute shell commands: Claude Code, Codex, or your own tooling. The MCP server follows the Model Context Protocol standard and works with any compatible client. The security model defaults to a remote signer architecture that keeps private keys on a separate machine, away from the agent's runtime environment.

Install

MCP server (zero-install, any MCP client):

bash
claude mcp add --transport stdio lnc -- npx -y @lightninglabs/lightning-mcp-server

Full plugin (all 7 skills via Claude Code):

bash
claude plugin marketplace add lightninglabs/lightning-agent-tools
claude plugin install lightning-agent-tools@lightninglabs

From source (requires Go 1.24+):

bash
git clone https://github.com/lightninglabs/lightning-agent-tools.git
cd lightning-agent-tools
skills/lightning-mcp-server/scripts/install.sh
skills/lightning-mcp-server/scripts/configure.sh --production
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project

See Quick Start below for detailed setup options including environment variables, regtest mode, and the full commerce stack.

How It Works

The skills break down into three functional groups:

Payment infrastructure. The lnd skill runs a Lightning node using the Neutrino light client (no full Bitcoin node required) with SQLite storage. The lightning-security-module sets up a remote signer to hold private keys on a separate machine. The macaroon-bakery bakes least-privilege credentials so agents only get the permissions they need.

Commerce. The lnget skill installs a command-line HTTP client that handles L402 payments automatically. When it hits a 402 response, it pays the embedded Lightning invoice, caches the token, and retries. The aperture skill runs an L402 reverse proxy that gates access to a backend service behind Lightning invoices. The commerce skill ties these together into buyer and seller workflows.

Node access. The lightning-mcp-server skill builds and configures an MCP server that connects to a Lightning node via Lightning Node Connect (encrypted WebSocket tunnels, pairing-phrase auth, no stored credentials). It exposes 18 read-only tools for querying node state and works with any MCP-compatible client.

Quick Start

Option A: Zero-Install MCP via claude mcp add

Register the MCP server with Claude Code in one command — no Go toolchain or git clone required:

bash
claude mcp add --transport stdio lnc -- npx -y @lightninglabs/lightning-mcp-server

With a specific mailbox server:

bash
claude mcp add --transport stdio \
  --env LNC_MAILBOX_SERVER=mailbox.terminal.lightning.today:443 \
  lnc -- npx -y @lightninglabs/lightning-mcp-server

For development/regtest:

bash
claude mcp add --transport stdio \
  --env LNC_MAILBOX_SERVER=localhost:11110 \
  --env LNC_DEV_MODE=true \
  --env LNC_INSECURE=true \
  lnc -- npx -y @lightninglabs/lightning-mcp-server

Scope options: --scope local (default, just you), --scope project (shared via .mcp.json), --scope user (all your projects).

Restart Claude Code, then:

Connect to my Lightning node with pairing phrase: "word1 word2 ... word10"

The agent can now query balances, list channels, decode invoices, and inspect the network graph. See MCP Server for details.

Option B: Full Plugin with All Skills

Install the complete plugin (all 7 skills + MCP server) via the Claude Code plugin marketplace:

bash
# Add the marketplace (one-time)
claude plugin marketplace add lightninglabs/lightning-agent-tools

# Install the plugin (gets all skills)
claude plugin install lightning-agent-tools@lightninglabs

Or load locally for development:

bash
git clone https://github.com/lightninglabs/lightning-agent-tools.git
claude --plugin-dir ./lightning-agent-tools

This gives Claude Code access to all skills: lnd node management, remote signer security, lnget L402 payments, Aperture proxy, macaroon bakery, MCP server integration, and commerce workflows.

Option C: Read-Only Node Access (from source)

Build the MCP server from source. Requires Go 1.24+.

bash
git clone https://github.com/lightninglabs/lightning-agent-tools.git
cd lightning-agent-tools

skills/lightning-mcp-server/scripts/install.sh
skills/lightning-mcp-server/scripts/configure.sh --production
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project

Restart Claude Code, then:

Connect to my Lightning node with pairing phrase: "word1 word2 ... word10"

The agent can now query balances, list channels, decode invoices, and inspect the network graph. See MCP Server for details.

Option D: Full Commerce Stack

Run your own node and start buying or selling resources over Lightning. Docker is the default deployment method — install.sh pulls a container image and start-lnd.sh launches it via Docker Compose.

bash
git clone https://github.com/lightninglabs/lightning-agent-tools.git
cd lightning-agent-tools

# Install components (pulls Docker images by default; --source to build natively)
skills/lnd/scripts/install.sh
skills/lnget/scripts/install.sh

# Create and start a node (runs in a Docker container)
skills/lnd/scripts/create-wallet.sh --mode standalone
skills/lnd/scripts/start-lnd.sh

# Configure lnget
lnget config init

# Fetch a paid resource
lnget --max-cost 500 https://api.example.com/data.json

All wrapper scripts (start-lnd.sh, stop-lnd.sh, lncli.sh) auto-detect Docker containers. Pass --native to any script to use a locally built binary instead.

For the full walkthrough including wallet funding, channel management, and hosting your own paid endpoints, see Commerce.

Natural Language

Agents with skill discovery (like Claude Code) pick up the skills automatically. You can interact through natural language:

Install Lightning Agent Tools and set up a Lightning node with
remote signer so I can start paying for L402 APIs with lnget.
Bake a pay-only macaroon on my regtest node
Export credentials from my signer and set up a watch-only node

Skills

SkillWhat it does
lndInstalls and operates an lnd Lightning node. Neutrino light client, SQLite storage. Defaults to watch-only mode with remote signer.
lightning-security-moduleSets up a remote signer node on a separate machine. Holds all private keys; the agent machine has none.
macaroon-bakeryBakes scoped macaroons (pay-only, invoice-only, read-only, channel-admin, signer-only) for least-privilege access.
lngetCommand-line HTTP client with automatic L402 payment. Pays Lightning invoices on 402 responses, caches tokens, retries.
apertureL402 reverse proxy. Sits in front of a backend service, issues invoices, validates paid tokens, proxies authorized requests.
lightning-mcp-serverBuilds and configures the MCP server for LNC-based read-only access to a Lightning node. 18 tools, no stored credentials.
commerceMeta-skill orchestrating lnd + lnget + aperture for end-to-end buyer/seller workflows.

All scripts support --container for Docker-based lnd nodes and --rpcserver / --tlscertpath / --macaroonpath for remote nodes.

Security

The kit provides three tiers of access with increasing trust requirements:

Tier 1 (default) splits the node into a watch-only instance on the agent machine and a signer on a separate machine. The agent can route payments and manage channels but cannot sign transactions. Keys never leave the signer.

Tier 2 stores keys locally. Appropriate for testnet, regtest, and small-value mainnet experiments.

Tier 3 uses the MCP server with LNC. No credentials are written to disk; the pairing phrase is handled in memory and ephemeral ECDSA keypairs are generated per session.

For all tiers, use the macaroon-bakery to scope credentials. A buyer agent gets a pay-only macaroon; a monitoring agent gets read-only. Never hand out admin.macaroon in production.

See Security for threat models, hardening, and the production checklist.

Documentation

DocumentDescription
ArchitectureSystem design, component map, plugin discovery, data flows
SecurityThree-tier security model, remote signer, macaroon scoping, production checklist
L402 and lngetThe L402 protocol, lnget usage, spending controls, token caching
MCP ServerLNC mechanics, setup walkthrough, 18-tool reference, configuration
CommerceBuyer and seller agent setup, the commerce loop, cost management
Two-Agent SetupSigner agent + node agent walkthrough for production key isolation
Quick ReferenceEvery command in one place

Each skill also has a detailed SKILL.md in its directory under skills/ with operational reference material: script options, configuration templates, file paths, and troubleshooting.

Prerequisites

  • Docker for running lnd/litd containers (the default deployment method)
  • Go 1.21+ only needed when building from source (install.sh --source) or for lnget and the MCP server
  • jq for JSON processing in shell scripts
  • Lightning Terminal (optional) for generating LNC pairing phrases

Container image versions are pinned in versions.env at the repository root and can be overridden via environment variables.

License

See LICENSE.

Cài đặt

TypingMind
{
  "mcpServers": {
    "lightning-agent-tools": {
      "command": "npx",
      "args": [
        "-y",
        "@lightninglabs/lightning-mcp-server"
      ]
    }
  }
}

Dùng MCP Lightning Agent Tools với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Lightning Agent Tools, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Lightning Agent Tools làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Lightning Agent Tools.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "lightning-agent-tools": {
      "command": "npx",
      "args": [
        "-y",
        "@lightninglabs/lightning-mcp-server"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Lightning Agent Tools, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Lightning Agent Tools.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Lightning Agent Tools giúp tôi làm việc này không?
Lightning Agent Tools
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Lightning Agent Tools.

Câu hỏi thường gặp

Máy chủ MCP Lightning Agent Tools dùng để làm gì?

Lightning Agent Tools là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Lightning Agent Tools với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Lightning Agent Tools với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Lightning Agent Tools với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Lightning Agent Tools, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Lightning Agent Tools với TypingMind?

Lightning Agent Tools hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Lightning Agent Tools cung cấp những công cụ nào trong TypingMind?

Lightning Agent Tools cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Lightning Agent Tools không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Lightning Agent Tools yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇