@lightninglabs/lightning-mcp-server 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +36 -0
- package/.claude-plugin/plugin.json +12 -0
- package/README.md +307 -0
- package/bin/lightning-mcp-server +15 -0
- package/docs/architecture.md +455 -0
- package/docs/commerce.md +357 -0
- package/docs/l402-and-lnget.md +267 -0
- package/docs/mcp-server.md +285 -0
- package/docs/quickref.md +263 -0
- package/docs/security.md +298 -0
- package/docs/two-agent-setup.md +394 -0
- package/package.json +52 -0
- package/postinstall.js +160 -0
- package/skills/aperture/SKILL.md +330 -0
- package/skills/aperture/scripts/install.sh +68 -0
- package/skills/aperture/scripts/setup.sh +155 -0
- package/skills/aperture/scripts/start.sh +81 -0
- package/skills/aperture/scripts/stop.sh +57 -0
- package/skills/aperture/templates/aperture-regtest.yaml +36 -0
- package/skills/aperture/templates/aperture.yaml.template +64 -0
- package/skills/aperture/templates/docker-compose-aperture.yml +59 -0
- package/skills/commerce/SKILL.md +211 -0
- package/skills/lib/config-gen.sh +127 -0
- package/skills/lib/rest.sh +69 -0
- package/skills/lightning-security-module/SKILL.md +253 -0
- package/skills/lightning-security-module/references/architecture.md +133 -0
- package/skills/lightning-security-module/scripts/docker-start.sh +117 -0
- package/skills/lightning-security-module/scripts/docker-stop.sh +53 -0
- package/skills/lightning-security-module/scripts/export-credentials.sh +268 -0
- package/skills/lightning-security-module/scripts/install.sh +178 -0
- package/skills/lightning-security-module/scripts/setup-signer.sh +307 -0
- package/skills/lightning-security-module/scripts/start-signer.sh +152 -0
- package/skills/lightning-security-module/scripts/stop-signer.sh +240 -0
- package/skills/lightning-security-module/templates/docker-compose-signer.yml +35 -0
- package/skills/lightning-security-module/templates/signer-lnd.conf.template +69 -0
- package/skills/lnd/SKILL.md +441 -0
- package/skills/lnd/profiles/debug.env +4 -0
- package/skills/lnd/profiles/default.env +3 -0
- package/skills/lnd/profiles/regtest.env +4 -0
- package/skills/lnd/profiles/taproot.env +3 -0
- package/skills/lnd/profiles/wumbo.env +3 -0
- package/skills/lnd/references/security.md +156 -0
- package/skills/lnd/scripts/create-wallet.sh +464 -0
- package/skills/lnd/scripts/docker-start.sh +256 -0
- package/skills/lnd/scripts/docker-stop.sh +109 -0
- package/skills/lnd/scripts/import-credentials.sh +145 -0
- package/skills/lnd/scripts/install.sh +195 -0
- package/skills/lnd/scripts/lncli.sh +150 -0
- package/skills/lnd/scripts/start-lnd.sh +241 -0
- package/skills/lnd/scripts/stop-lnd.sh +218 -0
- package/skills/lnd/scripts/unlock-wallet.sh +134 -0
- package/skills/lnd/templates/docker-compose-regtest.yml +122 -0
- package/skills/lnd/templates/docker-compose-watchonly.yml +71 -0
- package/skills/lnd/templates/docker-compose.yml +49 -0
- package/skills/lnd/templates/litd-regtest.conf.template +61 -0
- package/skills/lnd/templates/litd-watchonly.conf.template +57 -0
- package/skills/lnd/templates/litd.conf.template +88 -0
- package/skills/lnd/templates/lnd.conf.template +91 -0
- package/skills/lnget/SKILL.md +288 -0
- package/skills/lnget/scripts/install.sh +69 -0
- package/skills/macaroon-bakery/SKILL.md +179 -0
- package/skills/macaroon-bakery/scripts/bake.sh +337 -0
- package/skills/mcp-lnc/SKILL.md +280 -0
- package/skills/mcp-lnc/scripts/configure.sh +130 -0
- package/skills/mcp-lnc/scripts/install.sh +103 -0
- package/skills/mcp-lnc/scripts/setup-claude-config.sh +162 -0
- package/skills/mcp-lnc/templates/env.template +16 -0
- package/versions.env +23 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# MCP Server
|
|
2
|
+
|
|
3
|
+
> Connecting AI assistants to Lightning nodes through the Model Context
|
|
4
|
+
> Protocol and Lightning Node Connect.
|
|
5
|
+
|
|
6
|
+
Lightning Agent Tools includes an MCP server that gives AI assistants
|
|
7
|
+
read-only access to a Lightning node. It uses Lightning Node Connect (LNC) for
|
|
8
|
+
transport, which means the assistant never needs direct network access to the
|
|
9
|
+
node, never handles TLS certificates, and never stores macaroons on disk. A
|
|
10
|
+
10-word pairing phrase is all it takes to establish an encrypted tunnel.
|
|
11
|
+
|
|
12
|
+
The server exposes 18 tools, all read-only, that let an assistant query
|
|
13
|
+
node status, inspect channels, decode invoices, look up payments, and explore
|
|
14
|
+
the network graph. It cannot send payments, open channels, or modify any node
|
|
15
|
+
state.
|
|
16
|
+
|
|
17
|
+
## How LNC Works
|
|
18
|
+
|
|
19
|
+
Lightning Node Connect establishes an end-to-end encrypted WebSocket tunnel
|
|
20
|
+
between two parties through a mailbox relay server. Both the MCP server (on the
|
|
21
|
+
agent's machine) and the lnd node (running Lightning Terminal) connect outbound
|
|
22
|
+
to the mailbox. Neither needs to accept inbound connections, which means no
|
|
23
|
+
firewall configuration and no port forwarding.
|
|
24
|
+
|
|
25
|
+
```mermaid
|
|
26
|
+
graph LR
|
|
27
|
+
CC["Claude Code<br/>(stdio)"] <--> MCP["mcp-lnc-server"]
|
|
28
|
+
MCP <-->|"encrypted<br/>WebSocket"| MB["Mailbox Relay<br/>mailbox.terminal.lightning.today"]
|
|
29
|
+
MB <-->|"encrypted<br/>WebSocket"| LND["lnd + Lightning Terminal"]
|
|
30
|
+
|
|
31
|
+
style MB fill:#f5f5f5,stroke:#999
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Authentication works through a 10-word pairing phrase generated in Lightning
|
|
35
|
+
Terminal. When the MCP server connects, it generates an ephemeral ECDSA keypair,
|
|
36
|
+
uses the pairing phrase to derive a shared secret, and establishes the encrypted
|
|
37
|
+
tunnel. The keypair exists only in memory for the duration of the session --
|
|
38
|
+
when the connection closes, the keypair is discarded and no credentials remain
|
|
39
|
+
on disk.
|
|
40
|
+
|
|
41
|
+
The mailbox relay cannot read the traffic passing through it. It sees encrypted
|
|
42
|
+
WebSocket frames and routes them between the two endpoints based on connection
|
|
43
|
+
identifiers derived from the pairing phrase.
|
|
44
|
+
|
|
45
|
+
## Setup
|
|
46
|
+
|
|
47
|
+
Three scripts handle the full setup:
|
|
48
|
+
|
|
49
|
+
### 1. Build the server
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
skills/mcp-lnc/scripts/install.sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This compiles `mcp-lnc-server` from the `mcp-server/` directory in the
|
|
56
|
+
repository and installs it to `$GOPATH/bin`. Requires Go 1.24+.
|
|
57
|
+
|
|
58
|
+
### 2. Configure the environment
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Production (Lightning Terminal on mainnet)
|
|
62
|
+
skills/mcp-lnc/scripts/configure.sh --production
|
|
63
|
+
|
|
64
|
+
# Development (local regtest)
|
|
65
|
+
skills/mcp-lnc/scripts/configure.sh --dev --mailbox aperture:11110
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This generates `mcp-server/.env` with the following variables:
|
|
69
|
+
|
|
70
|
+
| Variable | Default | Description |
|
|
71
|
+
|----------|---------|-------------|
|
|
72
|
+
| `LNC_MAILBOX_SERVER` | `mailbox.terminal.lightning.today:443` | Mailbox relay address |
|
|
73
|
+
| `LNC_DEV_MODE` | `false` | Enable development mode |
|
|
74
|
+
| `LNC_INSECURE` | `false` | Skip TLS verification (dev only) |
|
|
75
|
+
| `LNC_CONNECT_TIMEOUT` | `30` | Connection timeout in seconds |
|
|
76
|
+
|
|
77
|
+
### 3. Register with Claude Code
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Project-level (recommended)
|
|
81
|
+
skills/mcp-lnc/scripts/setup-claude-config.sh --scope project
|
|
82
|
+
|
|
83
|
+
# Global
|
|
84
|
+
skills/mcp-lnc/scripts/setup-claude-config.sh --scope global
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This adds the MCP server to `.mcp.json` (project) or `~/.claude.json` (global).
|
|
88
|
+
Restart Claude Code after running this script for the new tools to appear.
|
|
89
|
+
|
|
90
|
+
The resulting configuration looks like:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"lnc": {
|
|
96
|
+
"command": "mcp-lnc-server",
|
|
97
|
+
"env": {
|
|
98
|
+
"LNC_MAILBOX_SERVER": "mailbox.terminal.lightning.today:443"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 4. Connect
|
|
106
|
+
|
|
107
|
+
After restarting Claude Code, the `lnc_connect` tool becomes available. Connect
|
|
108
|
+
with a pairing phrase from Lightning Terminal:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Connect to my Lightning node with pairing phrase: "word1 word2 word3 word4 word5 word6 word7 word8 word9 word10"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The assistant will call `lnc_connect`, establish the tunnel, and then all 18
|
|
115
|
+
read-only tools become operational.
|
|
116
|
+
|
|
117
|
+
## Available Tools
|
|
118
|
+
|
|
119
|
+
The server organizes its 18 tools into seven categories:
|
|
120
|
+
|
|
121
|
+
### Connection
|
|
122
|
+
|
|
123
|
+
| Tool | Description |
|
|
124
|
+
|------|-------------|
|
|
125
|
+
| `lnc_connect` | Establish LNC tunnel with a pairing phrase and password |
|
|
126
|
+
| `lnc_disconnect` | Close the active tunnel and discard the ephemeral keypair |
|
|
127
|
+
|
|
128
|
+
### Node
|
|
129
|
+
|
|
130
|
+
| Tool | Description |
|
|
131
|
+
|------|-------------|
|
|
132
|
+
| `lnc_get_info` | Node alias, public key, version, sync status, current block height |
|
|
133
|
+
| `lnc_get_balance` | On-chain wallet balance and total channel balance |
|
|
134
|
+
|
|
135
|
+
### Channels
|
|
136
|
+
|
|
137
|
+
| Tool | Description |
|
|
138
|
+
|------|-------------|
|
|
139
|
+
| `lnc_list_channels` | All open channels with capacity, local/remote balances, and activity |
|
|
140
|
+
| `lnc_pending_channels` | Channels being opened, closed, or force-closed |
|
|
141
|
+
|
|
142
|
+
### Invoices
|
|
143
|
+
|
|
144
|
+
| Tool | Description |
|
|
145
|
+
|------|-------------|
|
|
146
|
+
| `lnc_decode_invoice` | Decode a BOLT11 payment request into its components |
|
|
147
|
+
| `lnc_list_invoices` | Paginated list of created invoices with status |
|
|
148
|
+
| `lnc_lookup_invoice` | Look up a specific invoice by payment hash |
|
|
149
|
+
|
|
150
|
+
### Payments
|
|
151
|
+
|
|
152
|
+
| Tool | Description |
|
|
153
|
+
|------|-------------|
|
|
154
|
+
| `lnc_list_payments` | Paginated payment history with status, amounts, and routes |
|
|
155
|
+
| `lnc_track_payment` | Track a specific in-flight or completed payment by hash |
|
|
156
|
+
|
|
157
|
+
### Peers and Network
|
|
158
|
+
|
|
159
|
+
| Tool | Description |
|
|
160
|
+
|------|-------------|
|
|
161
|
+
| `lnc_list_peers` | Connected peers with addresses, bytes sent/received, and ping times |
|
|
162
|
+
| `lnc_describe_graph` | Sample of the Lightning Network topology (nodes and channels) |
|
|
163
|
+
| `lnc_get_node_info` | Detailed information about a specific node by public key |
|
|
164
|
+
|
|
165
|
+
### On-Chain
|
|
166
|
+
|
|
167
|
+
| Tool | Description |
|
|
168
|
+
|------|-------------|
|
|
169
|
+
| `lnc_list_unspent` | Unspent transaction outputs (UTXOs) with confirmation counts |
|
|
170
|
+
| `lnc_get_transactions` | On-chain transaction history |
|
|
171
|
+
| `lnc_estimate_fee` | Fee rate estimates for target confirmation windows |
|
|
172
|
+
|
|
173
|
+
## MCP-LNC vs Direct gRPC
|
|
174
|
+
|
|
175
|
+
The MCP server and direct gRPC access (via `lncli` or the `lnd` skill) serve
|
|
176
|
+
different purposes:
|
|
177
|
+
|
|
178
|
+
| | MCP-LNC | Direct gRPC |
|
|
179
|
+
|---|---------|-------------|
|
|
180
|
+
| **Credentials** | Pairing phrase (in-memory) | TLS cert + macaroon (on disk) |
|
|
181
|
+
| **Network** | WebSocket via mailbox relay | Direct TCP to gRPC port |
|
|
182
|
+
| **Firewall** | No inbound ports needed | Port 10009 must be reachable |
|
|
183
|
+
| **Capabilities** | Read-only (18 query tools) | Full node control |
|
|
184
|
+
| **Permissions** | Hardcoded read-only | Configurable via macaroon scope |
|
|
185
|
+
| **Setup** | Pairing phrase from Lightning Terminal | Export TLS cert and macaroon files |
|
|
186
|
+
|
|
187
|
+
**Use MCP-LNC when** the agent only needs to observe node state: checking
|
|
188
|
+
balances, listing channels, monitoring payments, inspecting the network graph.
|
|
189
|
+
The read-only constraint and lack of stored credentials make it the safest
|
|
190
|
+
option for giving an AI assistant access to node data.
|
|
191
|
+
|
|
192
|
+
**Use direct gRPC when** the agent needs to perform actions: sending payments,
|
|
193
|
+
opening channels, creating invoices. Direct gRPC requires the `lnd` skill and
|
|
194
|
+
appropriate macaroons (scoped via `macaroon-bakery`).
|
|
195
|
+
|
|
196
|
+
## Server Internals
|
|
197
|
+
|
|
198
|
+
The MCP server is a Go application in the `mcp-server/` directory. It runs on
|
|
199
|
+
stdio transport. The MCP client launches it as a subprocess and communicates over
|
|
200
|
+
stdin/stdout.
|
|
201
|
+
|
|
202
|
+
The entry point (`daemon.go`) handles signal-based shutdown (SIGINT, SIGTERM)
|
|
203
|
+
with a graceful timeout. The server (`server.go`) initializes a service manager
|
|
204
|
+
(`internal/services/manager.go`) that creates one service per tool category and
|
|
205
|
+
registers all 18 tools with the
|
|
206
|
+
[MCP Go SDK](https://github.com/modelcontextprotocol/go-sdk).
|
|
207
|
+
|
|
208
|
+
When `lnc_connect` is called, the manager creates a Lightning client using the
|
|
209
|
+
LNC library (`github.com/lightninglabs/lightning-node-connect/mailbox`),
|
|
210
|
+
establishes the tunnel, and distributes the client to all services via the
|
|
211
|
+
`onLNCConnectionEstablished` callback. When `lnc_disconnect` is called, the
|
|
212
|
+
connection is closed and all services are reset.
|
|
213
|
+
|
|
214
|
+
### Building from Source
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
cd mcp-server
|
|
218
|
+
make build # debug binary
|
|
219
|
+
make build-release # optimized binary
|
|
220
|
+
make install # install to $GOPATH/bin
|
|
221
|
+
make check # run fmt, lint, mod-check, and unit tests
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Docker
|
|
225
|
+
|
|
226
|
+
For containerized deployment:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
cd mcp-server
|
|
230
|
+
make docker-build
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
The Docker configuration in `.mcp.json`:
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"mcpServers": {
|
|
238
|
+
"lnc": {
|
|
239
|
+
"command": "docker",
|
|
240
|
+
"args": [
|
|
241
|
+
"run", "--rm", "-i", "--network", "host",
|
|
242
|
+
"--env", "LNC_MAILBOX_SERVER",
|
|
243
|
+
"--env", "LNC_DEV_MODE",
|
|
244
|
+
"--env", "LNC_INSECURE",
|
|
245
|
+
"mcp-lnc-server"
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Development Setup
|
|
253
|
+
|
|
254
|
+
For local regtest environments, enable development mode to skip TLS verification
|
|
255
|
+
and connect to a local mailbox:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
skills/mcp-lnc/scripts/configure.sh --dev --mailbox localhost:11110 --insecure
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
This sets `LNC_DEV_MODE=true` and `LNC_INSECURE=true` in the `.env` file.
|
|
262
|
+
|
|
263
|
+
### Prerequisites
|
|
264
|
+
|
|
265
|
+
- **Go 1.24+** for building from source
|
|
266
|
+
- **Lightning Terminal** (litd) on the target lnd node for generating pairing
|
|
267
|
+
phrases
|
|
268
|
+
- **Claude Code** for MCP integration
|
|
269
|
+
|
|
270
|
+
### Troubleshooting
|
|
271
|
+
|
|
272
|
+
**"pairing phrase must be exactly 10 words"**: The pairing phrase is generated
|
|
273
|
+
in Lightning Terminal's Sessions UI. It must be exactly 10 space-separated
|
|
274
|
+
words.
|
|
275
|
+
|
|
276
|
+
**"connection timeout"**: Verify the mailbox server is reachable. For
|
|
277
|
+
production, this is `mailbox.terminal.lightning.today:443`. For local
|
|
278
|
+
development, ensure the local mailbox is running.
|
|
279
|
+
|
|
280
|
+
**"TLS handshake failure"**: For local regtest, enable insecure mode:
|
|
281
|
+
`skills/mcp-lnc/scripts/configure.sh --dev --insecure`
|
|
282
|
+
|
|
283
|
+
**Tools not appearing in Claude Code**: Restart Claude Code after running
|
|
284
|
+
`setup-claude-config.sh`. Verify the binary is on your PATH with
|
|
285
|
+
`which mcp-lnc-server`.
|
package/docs/quickref.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# Quick Reference
|
|
2
|
+
|
|
3
|
+
> Every important command in one place.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Docker image pull is the default; add --source to build from source instead.
|
|
9
|
+
skills/lnd/scripts/install.sh # litd container image
|
|
10
|
+
skills/lnget/scripts/install.sh # lnget CLI (always built from source)
|
|
11
|
+
skills/aperture/scripts/install.sh # aperture (always built from source)
|
|
12
|
+
skills/mcp-lnc/scripts/install.sh # MCP server (always built from source)
|
|
13
|
+
skills/lightning-security-module/scripts/install.sh # lnd signer container image
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Node Operations
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Start/stop (Docker container by default; --native for local binary)
|
|
20
|
+
skills/lnd/scripts/start-lnd.sh # start litd container (standalone)
|
|
21
|
+
skills/lnd/scripts/start-lnd.sh --watchonly # watch-only + signer containers
|
|
22
|
+
skills/lnd/scripts/start-lnd.sh --regtest # regtest + bitcoind containers
|
|
23
|
+
skills/lnd/scripts/start-lnd.sh --profile debug # start with debug logging profile
|
|
24
|
+
skills/lnd/scripts/docker-start.sh --list-profiles # list available profiles
|
|
25
|
+
skills/lnd/scripts/stop-lnd.sh # stop containers
|
|
26
|
+
skills/lnd/scripts/stop-lnd.sh --clean # stop + remove Docker volumes
|
|
27
|
+
|
|
28
|
+
# Node queries (auto-detects containers)
|
|
29
|
+
skills/lnd/scripts/lncli.sh getinfo # node status
|
|
30
|
+
skills/lnd/scripts/lncli.sh walletbalance # on-chain balance
|
|
31
|
+
skills/lnd/scripts/lncli.sh channelbalance # channel balance
|
|
32
|
+
skills/lnd/scripts/unlock-wallet.sh # unlock after restart
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Wallet
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Watch-only with Docker (signer on Docker network, no --signer-host needed)
|
|
39
|
+
skills/lnd/scripts/import-credentials.sh --bundle <path>
|
|
40
|
+
skills/lnd/scripts/create-wallet.sh # auto-detects container
|
|
41
|
+
|
|
42
|
+
# Watch-only with native (signer on separate machine)
|
|
43
|
+
skills/lnd/scripts/import-credentials.sh --bundle <path>
|
|
44
|
+
skills/lnd/scripts/create-wallet.sh --native --signer-host <ip>:10012
|
|
45
|
+
|
|
46
|
+
# Standalone (testing, generates local seed)
|
|
47
|
+
skills/lnd/scripts/create-wallet.sh --mode standalone
|
|
48
|
+
|
|
49
|
+
# Funding
|
|
50
|
+
skills/lnd/scripts/lncli.sh newaddress p2tr # generate address
|
|
51
|
+
skills/lnd/scripts/lncli.sh walletbalance # check balance
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Channels
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
skills/lnd/scripts/lncli.sh connect <pubkey>@<host>:9735 # connect to peer
|
|
58
|
+
skills/lnd/scripts/lncli.sh openchannel --node_key=<pubkey> --local_amt=N # open channel
|
|
59
|
+
skills/lnd/scripts/lncli.sh listchannels # list channels
|
|
60
|
+
skills/lnd/scripts/lncli.sh pendingchannels # pending opens/closes
|
|
61
|
+
skills/lnd/scripts/lncli.sh closechannel --funding_txid=<txid> --output_index=N # close channel
|
|
62
|
+
skills/lnd/scripts/lncli.sh listpeers # connected peers
|
|
63
|
+
skills/lnd/scripts/lncli.sh disconnect <pubkey> # disconnect peer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Payments
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
skills/lnd/scripts/lncli.sh addinvoice --amt=1000 --memo="description" # create invoice
|
|
70
|
+
skills/lnd/scripts/lncli.sh decodepayreq <bolt11> # decode invoice
|
|
71
|
+
skills/lnd/scripts/lncli.sh sendpayment --pay_req=<bolt11> # pay invoice
|
|
72
|
+
skills/lnd/scripts/lncli.sh listpayments # payment history
|
|
73
|
+
skills/lnd/scripts/lncli.sh listinvoices # invoice history
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Macaroon Bakery
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Preset roles
|
|
80
|
+
skills/macaroon-bakery/scripts/bake.sh --role pay-only
|
|
81
|
+
skills/macaroon-bakery/scripts/bake.sh --role invoice-only
|
|
82
|
+
skills/macaroon-bakery/scripts/bake.sh --role read-only
|
|
83
|
+
skills/macaroon-bakery/scripts/bake.sh --role channel-admin
|
|
84
|
+
skills/macaroon-bakery/scripts/bake.sh --role signer-only
|
|
85
|
+
|
|
86
|
+
# Custom
|
|
87
|
+
skills/macaroon-bakery/scripts/bake.sh --custom \
|
|
88
|
+
uri:/lnrpc.Lightning/SendPaymentSync \
|
|
89
|
+
uri:/lnrpc.Lightning/DecodePayReq \
|
|
90
|
+
uri:/lnrpc.Lightning/GetInfo
|
|
91
|
+
|
|
92
|
+
# Inspect
|
|
93
|
+
skills/macaroon-bakery/scripts/bake.sh --inspect <path-to-macaroon>
|
|
94
|
+
|
|
95
|
+
# List all available permissions
|
|
96
|
+
skills/macaroon-bakery/scripts/bake.sh --list-permissions
|
|
97
|
+
|
|
98
|
+
# Save to specific path
|
|
99
|
+
skills/macaroon-bakery/scripts/bake.sh --role pay-only --save-to ~/agent.macaroon
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## lnget
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Fetch
|
|
106
|
+
lnget https://api.example.com/data.json # fetch to stdout
|
|
107
|
+
lnget -o data.json https://api.example.com/data.json # fetch to file
|
|
108
|
+
lnget -q https://api.example.com/data.json | jq . # quiet mode, pipe
|
|
109
|
+
lnget -X POST -d '{"q":"test"}' https://api.example.com # POST with body
|
|
110
|
+
|
|
111
|
+
# Cost control
|
|
112
|
+
lnget --max-cost 500 https://api.example.com/data # max auto-pay amount
|
|
113
|
+
lnget --no-pay https://api.example.com/data # preview without paying
|
|
114
|
+
lnget --no-pay --json https://... | jq '.invoice_amount_sat' # check price
|
|
115
|
+
|
|
116
|
+
# Tokens
|
|
117
|
+
lnget tokens list # list cached tokens
|
|
118
|
+
lnget tokens show api.example.com # show specific token
|
|
119
|
+
lnget tokens remove api.example.com # force re-payment
|
|
120
|
+
lnget tokens clear --force # clear all tokens
|
|
121
|
+
|
|
122
|
+
# Configuration
|
|
123
|
+
lnget config init # initialize config
|
|
124
|
+
lnget config show # show current config
|
|
125
|
+
|
|
126
|
+
# Backend status
|
|
127
|
+
lnget ln status # connection status
|
|
128
|
+
lnget ln info # backend info
|
|
129
|
+
|
|
130
|
+
# LNC pairing
|
|
131
|
+
lnget ln lnc pair "ten word pairing phrase here" # pair with LNC
|
|
132
|
+
lnget ln lnc sessions # list LNC sessions
|
|
133
|
+
lnget ln lnc revoke <session-id> # revoke session
|
|
134
|
+
|
|
135
|
+
# Neutrino (embedded wallet)
|
|
136
|
+
lnget ln neutrino init # initialize
|
|
137
|
+
lnget ln neutrino fund # funding address
|
|
138
|
+
lnget ln neutrino balance # check balance
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Aperture
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
skills/aperture/scripts/setup.sh # generate config
|
|
145
|
+
skills/aperture/scripts/setup.sh --insecure --port 8081 # dev mode
|
|
146
|
+
skills/aperture/scripts/setup.sh --network testnet # testnet
|
|
147
|
+
skills/aperture/scripts/start.sh # start proxy
|
|
148
|
+
skills/aperture/scripts/stop.sh # stop proxy
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## MCP Server
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
skills/mcp-lnc/scripts/install.sh # build from source
|
|
155
|
+
skills/mcp-lnc/scripts/configure.sh # generate .env
|
|
156
|
+
skills/mcp-lnc/scripts/configure.sh --production # mainnet config
|
|
157
|
+
skills/mcp-lnc/scripts/configure.sh --dev --insecure # regtest config
|
|
158
|
+
skills/mcp-lnc/scripts/setup-claude-config.sh --scope project # add to .mcp.json
|
|
159
|
+
skills/mcp-lnc/scripts/setup-claude-config.sh --scope global # add to ~/.claude.json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Remote Signer
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# On signer machine (Docker container by default)
|
|
166
|
+
skills/lightning-security-module/scripts/install.sh # pull lnd signer image
|
|
167
|
+
skills/lightning-security-module/scripts/setup-signer.sh # create wallet + export creds (auto-detects container)
|
|
168
|
+
skills/lightning-security-module/scripts/start-signer.sh # start signer container
|
|
169
|
+
skills/lightning-security-module/scripts/stop-signer.sh # stop signer container
|
|
170
|
+
skills/lightning-security-module/scripts/stop-signer.sh --clean # stop + remove volumes
|
|
171
|
+
skills/lightning-security-module/scripts/export-credentials.sh # re-export bundle
|
|
172
|
+
|
|
173
|
+
# On agent machine (Docker)
|
|
174
|
+
skills/lnd/scripts/import-credentials.sh --bundle <path>
|
|
175
|
+
skills/lnd/scripts/create-wallet.sh # auto-detects container
|
|
176
|
+
skills/lnd/scripts/start-lnd.sh --watchonly # watch-only + signer containers
|
|
177
|
+
|
|
178
|
+
# On agent machine (native, signer on separate host)
|
|
179
|
+
skills/lnd/scripts/import-credentials.sh --bundle <path>
|
|
180
|
+
skills/lnd/scripts/create-wallet.sh --native --signer-host <ip>:10012
|
|
181
|
+
skills/lnd/scripts/start-lnd.sh --native --signer-host <ip>:10012
|
|
182
|
+
|
|
183
|
+
# Scope signer macaroon (container or native)
|
|
184
|
+
skills/macaroon-bakery/scripts/bake.sh --role signer-only --container litd-signer
|
|
185
|
+
skills/macaroon-bakery/scripts/bake.sh --role signer-only --rpc-port 10012 --lnddir ~/.lnd-signer
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Docker Containers
|
|
189
|
+
|
|
190
|
+
Docker is the default deployment method. Container lifecycle:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Lifecycle (these are the primary entry points)
|
|
194
|
+
skills/lnd/scripts/start-lnd.sh # standalone litd container
|
|
195
|
+
skills/lnd/scripts/start-lnd.sh --watchonly # litd + signer containers
|
|
196
|
+
skills/lnd/scripts/start-lnd.sh --regtest # litd + bitcoind containers
|
|
197
|
+
skills/lnd/scripts/start-lnd.sh --regtest --profile debug # regtest with debug logging
|
|
198
|
+
skills/lnd/scripts/stop-lnd.sh # stop all mode containers
|
|
199
|
+
skills/lnd/scripts/stop-lnd.sh --clean # stop + remove volumes
|
|
200
|
+
skills/lnd/scripts/docker-start.sh --list-profiles # show available profiles
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
All `lncli` and bakery commands auto-detect running containers. Use `--container`
|
|
204
|
+
to target a specific container by name:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
skills/lnd/scripts/lncli.sh getinfo # auto-detects litd container
|
|
208
|
+
skills/lnd/scripts/lncli.sh --container litd-bob getinfo # target specific container
|
|
209
|
+
skills/macaroon-bakery/scripts/bake.sh --role pay-only --container litd
|
|
210
|
+
skills/lightning-security-module/scripts/export-credentials.sh --container litd-signer
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Remote Nodes
|
|
214
|
+
|
|
215
|
+
All scripts support direct connection to remote lnd nodes:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
skills/lnd/scripts/lncli.sh \
|
|
219
|
+
--rpcserver remote-host:10009 \
|
|
220
|
+
--tlscertpath ~/remote-tls.cert \
|
|
221
|
+
--macaroonpath ~/remote-admin.macaroon \
|
|
222
|
+
getinfo
|
|
223
|
+
|
|
224
|
+
skills/macaroon-bakery/scripts/bake.sh --role pay-only \
|
|
225
|
+
--rpcserver remote-host:10009 \
|
|
226
|
+
--tlscertpath ~/remote-tls.cert \
|
|
227
|
+
--macaroonpath ~/remote-admin.macaroon \
|
|
228
|
+
--save-to ~/remote-pay-only.macaroon
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## File Paths
|
|
232
|
+
|
|
233
|
+
| Path | Purpose |
|
|
234
|
+
|------|---------|
|
|
235
|
+
| `~/.lnget/lnd/lnd.conf` | lnd configuration |
|
|
236
|
+
| `~/.lnget/lnd/wallet-password.txt` | Wallet passphrase (0600) |
|
|
237
|
+
| `~/.lnget/lnd/seed.txt` | Wallet seed, standalone only (0600) |
|
|
238
|
+
| `~/.lnget/lnd/signer-credentials/` | Imported signer credentials |
|
|
239
|
+
| `~/.lnget/signer/signer-lnd.conf` | Signer configuration |
|
|
240
|
+
| `~/.lnget/signer/wallet-password.txt` | Signer passphrase (0600) |
|
|
241
|
+
| `~/.lnget/signer/seed.txt` | Signer seed (0600) |
|
|
242
|
+
| `~/.lnget/signer/credentials-bundle/` | Exported signer credentials |
|
|
243
|
+
| `~/.lnget/config.yaml` | lnget configuration |
|
|
244
|
+
| `~/.lnget/tokens/<domain>/` | L402 cached tokens |
|
|
245
|
+
| `~/.lnd/` | lnd data (chain, macaroons, TLS) |
|
|
246
|
+
| `~/.lnd/data/chain/bitcoin/<network>/admin.macaroon` | Admin macaroon |
|
|
247
|
+
| `~/.lnd/tls.cert` | lnd TLS certificate |
|
|
248
|
+
| `~/.lnd-signer/` | Signer lnd data |
|
|
249
|
+
| `~/.aperture/aperture.yaml` | Aperture configuration |
|
|
250
|
+
| `~/.aperture/aperture.db` | Aperture token database |
|
|
251
|
+
| `mcp-server/.env` | MCP server config |
|
|
252
|
+
|
|
253
|
+
## Ports
|
|
254
|
+
|
|
255
|
+
| Port | Service | Daemon |
|
|
256
|
+
|------|---------|--------|
|
|
257
|
+
| 8443 | HTTPS (UI + gRPC + REST) | litd (container) |
|
|
258
|
+
| 9735 | Lightning P2P | lnd |
|
|
259
|
+
| 10009 | gRPC | lnd |
|
|
260
|
+
| 8080 | REST | lnd |
|
|
261
|
+
| 10012 | gRPC | signer lnd |
|
|
262
|
+
| 10013 | REST | signer lnd |
|
|
263
|
+
| 8081 | HTTP/L402 | aperture (configurable) |
|