@lightninglabs/lightning-mcp-server 0.2.0 → 0.2.5
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/README.md +39 -11
- package/docs/architecture.md +9 -9
- package/docs/mcp-server.md +16 -16
- package/docs/quickref.md +8 -8
- package/docs/security.md +1 -1
- package/package.json +3 -3
- package/postinstall.js +1 -1
- package/skills/aperture/SKILL.md +24 -2
- package/skills/aperture/scripts/install.sh +3 -0
- package/skills/aperture/scripts/setup.sh +23 -0
- package/skills/lib/config-gen.sh +120 -2
- package/skills/{mcp-lnc → lightning-mcp-server}/SKILL.md +22 -22
- package/skills/{mcp-lnc → lightning-mcp-server}/scripts/configure.sh +5 -5
- package/skills/{mcp-lnc → lightning-mcp-server}/scripts/install.sh +15 -15
- package/skills/{mcp-lnc → lightning-mcp-server}/scripts/setup-claude-config.sh +5 -5
- package/skills/{mcp-lnc → lightning-mcp-server}/templates/env.template +1 -1
- package/skills/lightning-security-module/SKILL.md +1 -1
- package/skills/lightning-security-module/scripts/docker-start.sh +33 -5
- package/skills/lnd/SKILL.md +7 -7
- package/skills/lnd/scripts/docker-start.sh +50 -14
- package/skills/lnd/templates/litd-regtest.conf.template +5 -4
- package/skills/lnget/SKILL.md +6 -0
- package/skills/lnget/scripts/install.sh +3 -0
- package/skills/macaroon-bakery/scripts/bake.sh +5 -0
package/README.md
CHANGED
|
@@ -20,6 +20,34 @@ and works with any compatible client. The security model defaults to a remote
|
|
|
20
20
|
signer architecture that keeps private keys on a separate machine, away from the
|
|
21
21
|
agent's runtime environment.
|
|
22
22
|
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
**MCP server** (zero-install, any MCP client):
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
claude mcp add --transport stdio lnc -- npx -y @lightninglabs/lightning-mcp-server
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Full plugin** (all 7 skills via Claude Code):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
claude plugin marketplace add lightninglabs/lightning-agent-tools
|
|
35
|
+
claude plugin install lightning-agent-tools@lightninglabs
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**From source** (requires Go 1.24+):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/lightninglabs/lightning-agent-tools.git
|
|
42
|
+
cd lightning-agent-tools
|
|
43
|
+
skills/lightning-mcp-server/scripts/install.sh
|
|
44
|
+
skills/lightning-mcp-server/scripts/configure.sh --production
|
|
45
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
See [Quick Start](#quick-start) below for detailed setup options including
|
|
49
|
+
environment variables, regtest mode, and the full commerce stack.
|
|
50
|
+
|
|
23
51
|
## How It Works
|
|
24
52
|
|
|
25
53
|
```mermaid
|
|
@@ -32,7 +60,7 @@ graph TD
|
|
|
32
60
|
mb["macaroon-bakery<br/><i>scoped credentials</i>"]
|
|
33
61
|
lg["lnget<br/><i>L402 HTTP client</i>"]
|
|
34
62
|
ap["aperture<br/><i>L402 reverse proxy</i>"]
|
|
35
|
-
mcp["mcp-
|
|
63
|
+
mcp["lightning-mcp-server<br/><i>MCP server</i>"]
|
|
36
64
|
com["commerce<br/><i>buyer/seller workflows</i>"]
|
|
37
65
|
end
|
|
38
66
|
|
|
@@ -41,7 +69,7 @@ graph TD
|
|
|
41
69
|
signer_d["lnd signer"]
|
|
42
70
|
aperture_d["aperture proxy"]
|
|
43
71
|
lnget_d["lnget CLI"]
|
|
44
|
-
mcp_d["mcp-
|
|
72
|
+
mcp_d["lightning-mcp-server"]
|
|
45
73
|
end
|
|
46
74
|
|
|
47
75
|
lnd --> lnd_d
|
|
@@ -75,7 +103,7 @@ L402 reverse proxy that gates access to a backend service behind Lightning
|
|
|
75
103
|
invoices. The `commerce` skill ties these together into buyer and seller
|
|
76
104
|
workflows.
|
|
77
105
|
|
|
78
|
-
**Node access.** The `mcp-
|
|
106
|
+
**Node access.** The `lightning-mcp-server` skill builds and configures an MCP server that
|
|
79
107
|
connects to a Lightning node via Lightning Node Connect (encrypted WebSocket
|
|
80
108
|
tunnels, pairing-phrase auth, no stored credentials). It exposes 18 read-only
|
|
81
109
|
tools for querying node state and works with any MCP-compatible client.
|
|
@@ -128,10 +156,10 @@ plugin marketplace:
|
|
|
128
156
|
|
|
129
157
|
```bash
|
|
130
158
|
# Add the marketplace (one-time)
|
|
131
|
-
|
|
159
|
+
claude plugin marketplace add lightninglabs/lightning-agent-tools
|
|
132
160
|
|
|
133
161
|
# Install the plugin (gets all skills)
|
|
134
|
-
|
|
162
|
+
claude plugin install lightning-agent-tools@lightninglabs
|
|
135
163
|
```
|
|
136
164
|
|
|
137
165
|
Or load locally for development:
|
|
@@ -153,9 +181,9 @@ Build the MCP server from source. Requires Go 1.24+.
|
|
|
153
181
|
git clone https://github.com/lightninglabs/lightning-agent-tools.git
|
|
154
182
|
cd lightning-agent-tools
|
|
155
183
|
|
|
156
|
-
skills/mcp-
|
|
157
|
-
skills/mcp-
|
|
158
|
-
skills/mcp-
|
|
184
|
+
skills/lightning-mcp-server/scripts/install.sh
|
|
185
|
+
skills/lightning-mcp-server/scripts/configure.sh --production
|
|
186
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project
|
|
159
187
|
```
|
|
160
188
|
|
|
161
189
|
Restart Claude Code, then:
|
|
@@ -167,7 +195,7 @@ Connect to my Lightning node with pairing phrase: "word1 word2 ... word10"
|
|
|
167
195
|
The agent can now query balances, list channels, decode invoices, and inspect
|
|
168
196
|
the network graph. See [MCP Server](docs/mcp-server.md) for details.
|
|
169
197
|
|
|
170
|
-
### Option
|
|
198
|
+
### Option D: Full Commerce Stack
|
|
171
199
|
|
|
172
200
|
Run your own node and start buying or selling resources over Lightning. Docker
|
|
173
201
|
is the default deployment method — `install.sh` pulls a container image and
|
|
@@ -226,7 +254,7 @@ Export credentials from my signer and set up a watch-only node
|
|
|
226
254
|
| **macaroon-bakery** | Bakes scoped macaroons (pay-only, invoice-only, read-only, channel-admin, signer-only) for least-privilege access. |
|
|
227
255
|
| **lnget** | Command-line HTTP client with automatic L402 payment. Pays Lightning invoices on 402 responses, caches tokens, retries. |
|
|
228
256
|
| **aperture** | L402 reverse proxy. Sits in front of a backend service, issues invoices, validates paid tokens, proxies authorized requests. |
|
|
229
|
-
| **mcp-
|
|
257
|
+
| **lightning-mcp-server** | Builds and configures the MCP server for LNC-based read-only access to a Lightning node. 18 tools, no stored credentials. |
|
|
230
258
|
| **commerce** | Meta-skill orchestrating lnd + lnget + aperture for end-to-end buyer/seller workflows. |
|
|
231
259
|
|
|
232
260
|
All scripts support `--container` for Docker-based lnd nodes and `--rpcserver`
|
|
@@ -304,4 +332,4 @@ can be overridden via environment variables.
|
|
|
304
332
|
|
|
305
333
|
## License
|
|
306
334
|
|
|
307
|
-
See [LICENSE](mcp-server/LICENSE).
|
|
335
|
+
See [LICENSE](lightning-mcp-server/LICENSE).
|
package/docs/architecture.md
CHANGED
|
@@ -26,7 +26,7 @@ graph TD
|
|
|
26
26
|
mb["macaroon-bakery"]
|
|
27
27
|
lnget_skill["lnget"]
|
|
28
28
|
ap["aperture"]
|
|
29
|
-
mcp["mcp-
|
|
29
|
+
mcp["lightning-mcp-server"]
|
|
30
30
|
com["commerce"]
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ graph TD
|
|
|
34
34
|
lnd_daemon["litd (Lightning Terminal)<br/>HTTPS :8443 / gRPC :10009 / P2P :9735"]
|
|
35
35
|
signer["lnd signer<br/>gRPC :10012"]
|
|
36
36
|
aperture_daemon["aperture proxy<br/>HTTP :8081"]
|
|
37
|
-
mcp_server["mcp-
|
|
37
|
+
mcp_server["lightning-mcp-server<br/>stdio"]
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
subgraph External["External"]
|
|
@@ -96,7 +96,7 @@ to each skill's directory under `skills/`:
|
|
|
96
96
|
├── lnd → ../../skills/lnd
|
|
97
97
|
├── lnget → ../../skills/lnget
|
|
98
98
|
├── macaroon-bakery → ../../skills/macaroon-bakery
|
|
99
|
-
└── mcp-
|
|
99
|
+
└── lightning-mcp-server → ../../skills/lightning-mcp-server
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
Each skill directory contains a `SKILL.md` file with YAML frontmatter declaring
|
|
@@ -285,7 +285,7 @@ graph TD
|
|
|
285
285
|
|
|
286
286
|
## MCP Server
|
|
287
287
|
|
|
288
|
-
The MCP server (`mcp-server/`) connects AI assistants to a Lightning node
|
|
288
|
+
The MCP server (`lightning-mcp-server/`) connects AI assistants to a Lightning node
|
|
289
289
|
through the [Model Context Protocol](https://modelcontextprotocol.io). It uses
|
|
290
290
|
[Lightning Node Connect](https://docs.lightning.engineering/lightning-network-tools/lightning-terminal/lightning-node-connect)
|
|
291
291
|
(LNC) to reach the node, which means the assistant never needs direct network
|
|
@@ -299,7 +299,7 @@ authenticated by a 10-word pairing phrase generated in Lightning Terminal.
|
|
|
299
299
|
```mermaid
|
|
300
300
|
sequenceDiagram
|
|
301
301
|
participant CC as Claude Code
|
|
302
|
-
participant MCP as mcp-
|
|
302
|
+
participant MCP as lightning-mcp-server
|
|
303
303
|
participant MB as Mailbox Relay
|
|
304
304
|
participant LND as lnd + Lightning Terminal
|
|
305
305
|
|
|
@@ -322,8 +322,8 @@ sequenceDiagram
|
|
|
322
322
|
The server runs on stdio transport. The MCP client (Claude Code or any other
|
|
323
323
|
MCP-compatible host) launches it as a subprocess and communicates over
|
|
324
324
|
stdin/stdout. No HTTP server, no port binding. The server's Go implementation
|
|
325
|
-
lives under `mcp-server/` and is built via
|
|
326
|
-
`skills/mcp-
|
|
325
|
+
lives under `lightning-mcp-server/` and is built via
|
|
326
|
+
`skills/lightning-mcp-server/scripts/install.sh`.
|
|
327
327
|
|
|
328
328
|
The server exposes 18 read-only tools organized into seven categories:
|
|
329
329
|
Connection, Node, Channels, Invoices, Payments, Peers/Network, and On-Chain.
|
|
@@ -333,7 +333,7 @@ open channels, or change configuration. See [MCP Server](mcp-server.md) for the
|
|
|
333
333
|
full tool reference.
|
|
334
334
|
|
|
335
335
|
Internally, the server uses a service manager
|
|
336
|
-
(`mcp-server/internal/services/manager.go`) that initializes one service per
|
|
336
|
+
(`lightning-mcp-server/internal/services/manager.go`) that initializes one service per
|
|
337
337
|
tool category and registers their tools with the MCP SDK. When `lnc_connect`
|
|
338
338
|
is called, the manager creates a Lightning client via LNC and distributes it to
|
|
339
339
|
all services. When `lnc_disconnect` is called, the connection is closed and the
|
|
@@ -407,7 +407,7 @@ managed by their respective daemons.
|
|
|
407
407
|
| `~/.lnget/signer/credentials-bundle/` | security module | Exported credentials for agent |
|
|
408
408
|
| `~/.lnget/config.yaml` | lnget | lnget client configuration |
|
|
409
409
|
| `~/.lnget/tokens/<domain>/` | lnget | Cached L402 tokens per domain |
|
|
410
|
-
| `mcp-server/.env` | mcp-
|
|
410
|
+
| `lightning-mcp-server/.env` | lightning-mcp-server | MCP server environment config |
|
|
411
411
|
|
|
412
412
|
### Daemon Data (native mode: filesystem; container mode: Docker volumes)
|
|
413
413
|
|
package/docs/mcp-server.md
CHANGED
|
@@ -24,7 +24,7 @@ firewall configuration and no port forwarding.
|
|
|
24
24
|
|
|
25
25
|
```mermaid
|
|
26
26
|
graph LR
|
|
27
|
-
CC["Claude Code<br/>(stdio)"] <--> MCP["mcp-
|
|
27
|
+
CC["Claude Code<br/>(stdio)"] <--> MCP["lightning-mcp-server"]
|
|
28
28
|
MCP <-->|"encrypted<br/>WebSocket"| MB["Mailbox Relay<br/>mailbox.terminal.lightning.today"]
|
|
29
29
|
MB <-->|"encrypted<br/>WebSocket"| LND["lnd + Lightning Terminal"]
|
|
30
30
|
|
|
@@ -49,23 +49,23 @@ Three scripts handle the full setup:
|
|
|
49
49
|
### 1. Build the server
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
skills/mcp-
|
|
52
|
+
skills/lightning-mcp-server/scripts/install.sh
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
This compiles `mcp-
|
|
55
|
+
This compiles `lightning-mcp-server` from the `lightning-mcp-server/` directory in the
|
|
56
56
|
repository and installs it to `$GOPATH/bin`. Requires Go 1.24+.
|
|
57
57
|
|
|
58
58
|
### 2. Configure the environment
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
# Production (Lightning Terminal on mainnet)
|
|
62
|
-
skills/mcp-
|
|
62
|
+
skills/lightning-mcp-server/scripts/configure.sh --production
|
|
63
63
|
|
|
64
64
|
# Development (local regtest)
|
|
65
|
-
skills/mcp-
|
|
65
|
+
skills/lightning-mcp-server/scripts/configure.sh --dev --mailbox aperture:11110
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
This generates `mcp-server/.env` with the following variables:
|
|
68
|
+
This generates `lightning-mcp-server/.env` with the following variables:
|
|
69
69
|
|
|
70
70
|
| Variable | Default | Description |
|
|
71
71
|
|----------|---------|-------------|
|
|
@@ -78,10 +78,10 @@ This generates `mcp-server/.env` with the following variables:
|
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
80
|
# Project-level (recommended)
|
|
81
|
-
skills/mcp-
|
|
81
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project
|
|
82
82
|
|
|
83
83
|
# Global
|
|
84
|
-
skills/mcp-
|
|
84
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope global
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
This adds the MCP server to `.mcp.json` (project) or `~/.claude.json` (global).
|
|
@@ -93,7 +93,7 @@ The resulting configuration looks like:
|
|
|
93
93
|
{
|
|
94
94
|
"mcpServers": {
|
|
95
95
|
"lnc": {
|
|
96
|
-
"command": "mcp-
|
|
96
|
+
"command": "lightning-mcp-server",
|
|
97
97
|
"env": {
|
|
98
98
|
"LNC_MAILBOX_SERVER": "mailbox.terminal.lightning.today:443"
|
|
99
99
|
}
|
|
@@ -195,7 +195,7 @@ appropriate macaroons (scoped via `macaroon-bakery`).
|
|
|
195
195
|
|
|
196
196
|
## Server Internals
|
|
197
197
|
|
|
198
|
-
The MCP server is a Go application in the `mcp-server/` directory. It runs on
|
|
198
|
+
The MCP server is a Go application in the `lightning-mcp-server/` directory. It runs on
|
|
199
199
|
stdio transport. The MCP client launches it as a subprocess and communicates over
|
|
200
200
|
stdin/stdout.
|
|
201
201
|
|
|
@@ -214,7 +214,7 @@ connection is closed and all services are reset.
|
|
|
214
214
|
### Building from Source
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
cd mcp-server
|
|
217
|
+
cd lightning-mcp-server
|
|
218
218
|
make build # debug binary
|
|
219
219
|
make build-release # optimized binary
|
|
220
220
|
make install # install to $GOPATH/bin
|
|
@@ -226,7 +226,7 @@ make check # run fmt, lint, mod-check, and unit tests
|
|
|
226
226
|
For containerized deployment:
|
|
227
227
|
|
|
228
228
|
```bash
|
|
229
|
-
cd mcp-server
|
|
229
|
+
cd lightning-mcp-server
|
|
230
230
|
make docker-build
|
|
231
231
|
```
|
|
232
232
|
|
|
@@ -242,7 +242,7 @@ The Docker configuration in `.mcp.json`:
|
|
|
242
242
|
"--env", "LNC_MAILBOX_SERVER",
|
|
243
243
|
"--env", "LNC_DEV_MODE",
|
|
244
244
|
"--env", "LNC_INSECURE",
|
|
245
|
-
"mcp-
|
|
245
|
+
"lightning-mcp-server"
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
}
|
|
@@ -255,7 +255,7 @@ For local regtest environments, enable development mode to skip TLS verification
|
|
|
255
255
|
and connect to a local mailbox:
|
|
256
256
|
|
|
257
257
|
```bash
|
|
258
|
-
skills/mcp-
|
|
258
|
+
skills/lightning-mcp-server/scripts/configure.sh --dev --mailbox localhost:11110 --insecure
|
|
259
259
|
```
|
|
260
260
|
|
|
261
261
|
This sets `LNC_DEV_MODE=true` and `LNC_INSECURE=true` in the `.env` file.
|
|
@@ -278,8 +278,8 @@ production, this is `mailbox.terminal.lightning.today:443`. For local
|
|
|
278
278
|
development, ensure the local mailbox is running.
|
|
279
279
|
|
|
280
280
|
**"TLS handshake failure"**: For local regtest, enable insecure mode:
|
|
281
|
-
`skills/mcp-
|
|
281
|
+
`skills/lightning-mcp-server/scripts/configure.sh --dev --insecure`
|
|
282
282
|
|
|
283
283
|
**Tools not appearing in Claude Code**: Restart Claude Code after running
|
|
284
284
|
`setup-claude-config.sh`. Verify the binary is on your PATH with
|
|
285
|
-
`which mcp-
|
|
285
|
+
`which lightning-mcp-server`.
|
package/docs/quickref.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
skills/lnd/scripts/install.sh # litd container image
|
|
10
10
|
skills/lnget/scripts/install.sh # lnget CLI (always built from source)
|
|
11
11
|
skills/aperture/scripts/install.sh # aperture (always built from source)
|
|
12
|
-
skills/mcp-
|
|
12
|
+
skills/lightning-mcp-server/scripts/install.sh # MCP server (always built from source)
|
|
13
13
|
skills/lightning-security-module/scripts/install.sh # lnd signer container image
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -151,12 +151,12 @@ skills/aperture/scripts/stop.sh # stop proxy
|
|
|
151
151
|
## MCP Server
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
|
-
skills/mcp-
|
|
155
|
-
skills/mcp-
|
|
156
|
-
skills/mcp-
|
|
157
|
-
skills/mcp-
|
|
158
|
-
skills/mcp-
|
|
159
|
-
skills/mcp-
|
|
154
|
+
skills/lightning-mcp-server/scripts/install.sh # build from source
|
|
155
|
+
skills/lightning-mcp-server/scripts/configure.sh # generate .env
|
|
156
|
+
skills/lightning-mcp-server/scripts/configure.sh --production # mainnet config
|
|
157
|
+
skills/lightning-mcp-server/scripts/configure.sh --dev --insecure # regtest config
|
|
158
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project # add to .mcp.json
|
|
159
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope global # add to ~/.claude.json
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
## Remote Signer
|
|
@@ -248,7 +248,7 @@ skills/macaroon-bakery/scripts/bake.sh --role pay-only \
|
|
|
248
248
|
| `~/.lnd-signer/` | Signer lnd data |
|
|
249
249
|
| `~/.aperture/aperture.yaml` | Aperture configuration |
|
|
250
250
|
| `~/.aperture/aperture.db` | Aperture token database |
|
|
251
|
-
| `mcp-server/.env` | MCP server config |
|
|
251
|
+
| `lightning-mcp-server/.env` | MCP server config |
|
|
252
252
|
|
|
253
253
|
## Ports
|
|
254
254
|
|
package/docs/security.md
CHANGED
|
@@ -100,7 +100,7 @@ payments, open channels, or modify any node state.
|
|
|
100
100
|
node's state for the duration of the active LNC session. Once the session is
|
|
101
101
|
closed, no credentials remain to reconnect.
|
|
102
102
|
|
|
103
|
-
**Setup:** Use the `mcp-
|
|
103
|
+
**Setup:** Use the `lightning-mcp-server` skill. See [MCP Server](mcp-server.md) for the
|
|
104
104
|
setup walkthrough.
|
|
105
105
|
|
|
106
106
|
## Remote Signer in Depth
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightninglabs/lightning-mcp-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Lightning Network agent toolkit for Claude Code — MCP server, L402 payments, node operations, and 7 composable skills",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/lightninglabs/lightning-agent-
|
|
8
|
+
"url": "https://github.com/lightninglabs/lightning-agent-tools"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://github.com/lightninglabs/lightning-agent-
|
|
10
|
+
"homepage": "https://github.com/lightninglabs/lightning-agent-tools#quick-start",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"lightning",
|
|
13
13
|
"lightning-network",
|
package/postinstall.js
CHANGED
|
@@ -26,7 +26,7 @@ const PLATFORM_MAP = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
// REPO is the GitHub repository that hosts the release binaries.
|
|
29
|
-
const REPO = "lightninglabs/lightning-agent-
|
|
29
|
+
const REPO = "lightninglabs/lightning-agent-tools";
|
|
30
30
|
|
|
31
31
|
// BINARY_NAME is the name of the binary inside the release tarball.
|
|
32
32
|
const BINARY_NAME = "lightning-mcp-server";
|
package/skills/aperture/SKILL.md
CHANGED
|
@@ -20,10 +20,15 @@ skills/aperture/scripts/install.sh
|
|
|
20
20
|
# 2. Generate config (connects to local lnd)
|
|
21
21
|
skills/aperture/scripts/setup.sh
|
|
22
22
|
|
|
23
|
-
# 3.
|
|
23
|
+
# 3. Ensure invoice.macaroon exists (required for L402 invoice creation)
|
|
24
|
+
# If not present, bake one with the macaroon-bakery skill:
|
|
25
|
+
skills/macaroon-bakery/scripts/bake.sh --role invoice-only \
|
|
26
|
+
--save-to ~/.lnd/data/chain/bitcoin/mainnet/invoice.macaroon
|
|
27
|
+
|
|
28
|
+
# 4. Start aperture
|
|
24
29
|
skills/aperture/scripts/start.sh
|
|
25
30
|
|
|
26
|
-
#
|
|
31
|
+
# 5. Test with lnget
|
|
27
32
|
lnget -k --no-pay https://localhost:8081/api/test
|
|
28
33
|
```
|
|
29
34
|
|
|
@@ -118,6 +123,23 @@ skills/aperture/scripts/stop.sh
|
|
|
118
123
|
|
|
119
124
|
Config file: `~/.aperture/aperture.yaml`
|
|
120
125
|
|
|
126
|
+
### Invoice Macaroon Requirement
|
|
127
|
+
|
|
128
|
+
Aperture requires `invoice.macaroon` in the configured `macdir` to create
|
|
129
|
+
Lightning invoices for L402 challenges. This is **not** the same as
|
|
130
|
+
`admin.macaroon`. If the macaroon is missing, aperture will fail to start or
|
|
131
|
+
will return errors when clients request paid resources.
|
|
132
|
+
|
|
133
|
+
To bake an invoice macaroon with the macaroon-bakery skill:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
skills/macaroon-bakery/scripts/bake.sh --role invoice-only \
|
|
137
|
+
--save-to ~/.lnd/data/chain/bitcoin/mainnet/invoice.macaroon
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The `setup.sh` script will warn you if `invoice.macaroon` is not found at the
|
|
141
|
+
expected path.
|
|
142
|
+
|
|
121
143
|
### Minimal Agent Configuration
|
|
122
144
|
|
|
123
145
|
This is the minimal config for an agent hosting paid endpoints with a local
|
|
@@ -149,6 +149,29 @@ YAML
|
|
|
149
149
|
|
|
150
150
|
echo "Config written to $CONFIG_FILE"
|
|
151
151
|
echo ""
|
|
152
|
+
|
|
153
|
+
# Warn if invoice.macaroon is missing (required for aperture to create invoices).
|
|
154
|
+
if [ "$NO_AUTH" != true ]; then
|
|
155
|
+
INVOICE_MACAROON="$LND_MACDIR/invoice.macaroon"
|
|
156
|
+
if [ ! -f "$INVOICE_MACAROON" ]; then
|
|
157
|
+
echo "WARNING: invoice.macaroon not found at $INVOICE_MACAROON"
|
|
158
|
+
echo ""
|
|
159
|
+
echo "Aperture requires invoice.macaroon in the macdir to create invoices."
|
|
160
|
+
echo "Without it, aperture will fail to generate L402 challenges."
|
|
161
|
+
echo ""
|
|
162
|
+
|
|
163
|
+
BAKERY_SCRIPT="$SCRIPT_DIR/../../macaroon-bakery/scripts/bake.sh"
|
|
164
|
+
if [ -x "$BAKERY_SCRIPT" ]; then
|
|
165
|
+
echo "To bake one automatically:"
|
|
166
|
+
echo " $BAKERY_SCRIPT --role invoice-only --save-to $INVOICE_MACAROON"
|
|
167
|
+
else
|
|
168
|
+
echo "To create one, use the macaroon-bakery skill:"
|
|
169
|
+
echo " skills/macaroon-bakery/scripts/bake.sh --role invoice-only --save-to $INVOICE_MACAROON"
|
|
170
|
+
fi
|
|
171
|
+
echo ""
|
|
172
|
+
fi
|
|
173
|
+
fi
|
|
174
|
+
|
|
152
175
|
echo "Next steps:"
|
|
153
176
|
echo " 1. Start a backend on port $SERVICE_PORT"
|
|
154
177
|
echo " 2. Start aperture: skills/aperture/scripts/start.sh"
|
package/skills/lib/config-gen.sh
CHANGED
|
@@ -7,8 +7,18 @@
|
|
|
7
7
|
#
|
|
8
8
|
# Usage:
|
|
9
9
|
# source skills/lib/config-gen.sh
|
|
10
|
-
# generate_litd_config <template> <output> [network] [debug] [alias] [uipass] [extra_args]
|
|
11
|
-
# generate_lnd_config <template> <output> [network] [debug] [extra_args]
|
|
10
|
+
# generate_litd_config <template> <output> [network] [debug] [alias] [uipass] [extra_args] [bitcoind_opts]
|
|
11
|
+
# generate_lnd_config <template> <output> [network] [debug] [extra_args] [bitcoind_opts]
|
|
12
|
+
|
|
13
|
+
# Default bitcoind connection values used when switching to regtest.
|
|
14
|
+
# Uses the container name (litd-bitcoind) rather than the compose service name
|
|
15
|
+
# (bitcoind) so that containers joining via `docker network connect` can
|
|
16
|
+
# resolve the host — service aliases only work within the originating compose.
|
|
17
|
+
_BITCOIND_RPCHOST="${BITCOIND_RPCHOST:-litd-bitcoind:18443}"
|
|
18
|
+
_BITCOIND_RPCUSER="${BITCOIND_RPCUSER:-devuser}"
|
|
19
|
+
_BITCOIND_RPCPASS="${BITCOIND_RPCPASS:-devpass}"
|
|
20
|
+
_BITCOIND_ZMQPUBRAWBLOCK="${BITCOIND_ZMQPUBRAWBLOCK:-tcp://litd-bitcoind:28332}"
|
|
21
|
+
_BITCOIND_ZMQPUBRAWTX="${BITCOIND_ZMQPUBRAWTX:-tcp://litd-bitcoind:28333}"
|
|
12
22
|
|
|
13
23
|
# generate_litd_config produces a litd runtime config from a template.
|
|
14
24
|
#
|
|
@@ -18,6 +28,10 @@
|
|
|
18
28
|
# config file format (lnd.flag=value). Boolean flags without a value
|
|
19
29
|
# get =true appended.
|
|
20
30
|
#
|
|
31
|
+
# When network=regtest, the function automatically swaps
|
|
32
|
+
# lnd.bitcoin.node=neutrino to lnd.bitcoin.node=bitcoind, comments out
|
|
33
|
+
# neutrino and fee.url lines, and appends bitcoind connection defaults.
|
|
34
|
+
#
|
|
21
35
|
# Arguments:
|
|
22
36
|
# $1 - template Path to the .conf.template file.
|
|
23
37
|
# $2 - output Path to write the generated config.
|
|
@@ -26,6 +40,7 @@
|
|
|
26
40
|
# $5 - alias Node alias (default: litd-agent).
|
|
27
41
|
# $6 - uipass litd UI password (default: empty, keeps template value).
|
|
28
42
|
# $7 - extra Space-separated extra CLI flags to append.
|
|
43
|
+
# $8 - bitcoind Bitcoind connection overrides (host:user:pass). Optional.
|
|
29
44
|
generate_litd_config() {
|
|
30
45
|
local template="$1"
|
|
31
46
|
local output="$2"
|
|
@@ -34,6 +49,7 @@ generate_litd_config() {
|
|
|
34
49
|
local alias="${5:-litd-agent}"
|
|
35
50
|
local ui_password="${6:-}"
|
|
36
51
|
local extra_args="${7:-}"
|
|
52
|
+
local bitcoind_opts="${8:-}"
|
|
37
53
|
|
|
38
54
|
cp "$template" "$output"
|
|
39
55
|
|
|
@@ -61,6 +77,11 @@ generate_litd_config() {
|
|
|
61
77
|
fi
|
|
62
78
|
fi
|
|
63
79
|
|
|
80
|
+
# Regtest: swap neutrino backend for bitcoind.
|
|
81
|
+
if [ "$network" = "regtest" ]; then
|
|
82
|
+
_apply_regtest_bitcoind_litd "$output" "$bitcoind_opts"
|
|
83
|
+
fi
|
|
84
|
+
|
|
64
85
|
# Append extra args as config-file lines.
|
|
65
86
|
_append_extra_args "$output" "$extra_args"
|
|
66
87
|
}
|
|
@@ -69,18 +90,24 @@ generate_litd_config() {
|
|
|
69
90
|
# template. Same pattern as generate_litd_config but for lnd-style
|
|
70
91
|
# configs that use unprefixed keys (bitcoin.active, debuglevel, etc.).
|
|
71
92
|
#
|
|
93
|
+
# When network=regtest, the function automatically swaps
|
|
94
|
+
# bitcoin.node=neutrino to bitcoin.node=bitcoind, comments out neutrino
|
|
95
|
+
# and fee.url lines, and appends bitcoind connection defaults.
|
|
96
|
+
#
|
|
72
97
|
# Arguments:
|
|
73
98
|
# $1 - template Path to the .conf.template file.
|
|
74
99
|
# $2 - output Path to write the generated config.
|
|
75
100
|
# $3 - network Bitcoin network (default: testnet).
|
|
76
101
|
# $4 - debug Debug level string (default: info).
|
|
77
102
|
# $5 - extra Space-separated extra CLI flags to append.
|
|
103
|
+
# $6 - bitcoind Bitcoind connection overrides (host:user:pass). Optional.
|
|
78
104
|
generate_lnd_config() {
|
|
79
105
|
local template="$1"
|
|
80
106
|
local output="$2"
|
|
81
107
|
local network="${3:-testnet}"
|
|
82
108
|
local debug_level="${4:-info}"
|
|
83
109
|
local extra_args="${5:-}"
|
|
110
|
+
local bitcoind_opts="${6:-}"
|
|
84
111
|
|
|
85
112
|
cp "$template" "$output"
|
|
86
113
|
|
|
@@ -95,10 +122,101 @@ generate_lnd_config() {
|
|
|
95
122
|
sed -i.bak 's/^debuglevel=.*/debuglevel='"$debug_level"'/' "$output"
|
|
96
123
|
rm -f "$output.bak"
|
|
97
124
|
|
|
125
|
+
# Regtest: swap neutrino backend for bitcoind.
|
|
126
|
+
if [ "$network" = "regtest" ]; then
|
|
127
|
+
_apply_regtest_bitcoind_lnd "$output" "$bitcoind_opts"
|
|
128
|
+
fi
|
|
129
|
+
|
|
98
130
|
# Append extra args as config-file lines.
|
|
99
131
|
_append_extra_args "$output" "$extra_args"
|
|
100
132
|
}
|
|
101
133
|
|
|
134
|
+
# _apply_regtest_bitcoind_lnd rewrites an lnd config (unprefixed keys) to use
|
|
135
|
+
# bitcoind instead of neutrino. Called automatically when network=regtest.
|
|
136
|
+
_apply_regtest_bitcoind_lnd() {
|
|
137
|
+
local output="$1"
|
|
138
|
+
local bitcoind_opts="$2"
|
|
139
|
+
|
|
140
|
+
# Parse optional overrides (host:user:pass).
|
|
141
|
+
local rpchost="$_BITCOIND_RPCHOST"
|
|
142
|
+
local rpcuser="$_BITCOIND_RPCUSER"
|
|
143
|
+
local rpcpass="$_BITCOIND_RPCPASS"
|
|
144
|
+
local zmqblock="$_BITCOIND_ZMQPUBRAWBLOCK"
|
|
145
|
+
local zmqtx="$_BITCOIND_ZMQPUBRAWTX"
|
|
146
|
+
if [ -n "$bitcoind_opts" ]; then
|
|
147
|
+
IFS=':' read -r _h _u _p <<< "$bitcoind_opts"
|
|
148
|
+
[ -n "$_h" ] && rpchost="$_h"
|
|
149
|
+
[ -n "$_u" ] && rpcuser="$_u"
|
|
150
|
+
[ -n "$_p" ] && rpcpass="$_p"
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Swap neutrino for bitcoind.
|
|
154
|
+
sed -i.bak 's/^bitcoin\.node=neutrino/bitcoin.node=bitcoind/' "$output"
|
|
155
|
+
rm -f "$output.bak"
|
|
156
|
+
|
|
157
|
+
# Comment out neutrino lines.
|
|
158
|
+
sed -i.bak 's/^neutrino\./#neutrino./' "$output"
|
|
159
|
+
rm -f "$output.bak"
|
|
160
|
+
|
|
161
|
+
# Comment out fee.url line (not needed for regtest).
|
|
162
|
+
sed -i.bak 's/^fee\.url=/#fee.url=/' "$output"
|
|
163
|
+
rm -f "$output.bak"
|
|
164
|
+
|
|
165
|
+
# Append bitcoind connection settings if not already present.
|
|
166
|
+
if ! grep -q '^bitcoind\.rpchost=' "$output"; then
|
|
167
|
+
echo "" >> "$output"
|
|
168
|
+
echo "# Bitcoind connection settings (regtest)." >> "$output"
|
|
169
|
+
echo "bitcoind.rpchost=$rpchost" >> "$output"
|
|
170
|
+
echo "bitcoind.rpcuser=$rpcuser" >> "$output"
|
|
171
|
+
echo "bitcoind.rpcpass=$rpcpass" >> "$output"
|
|
172
|
+
echo "bitcoind.zmqpubrawblock=$zmqblock" >> "$output"
|
|
173
|
+
echo "bitcoind.zmqpubrawtx=$zmqtx" >> "$output"
|
|
174
|
+
fi
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# _apply_regtest_bitcoind_litd rewrites a litd config (lnd.-prefixed keys) to
|
|
178
|
+
# use bitcoind instead of neutrino. Called automatically when network=regtest.
|
|
179
|
+
_apply_regtest_bitcoind_litd() {
|
|
180
|
+
local output="$1"
|
|
181
|
+
local bitcoind_opts="$2"
|
|
182
|
+
|
|
183
|
+
# Parse optional overrides (host:user:pass).
|
|
184
|
+
local rpchost="$_BITCOIND_RPCHOST"
|
|
185
|
+
local rpcuser="$_BITCOIND_RPCUSER"
|
|
186
|
+
local rpcpass="$_BITCOIND_RPCPASS"
|
|
187
|
+
local zmqblock="$_BITCOIND_ZMQPUBRAWBLOCK"
|
|
188
|
+
local zmqtx="$_BITCOIND_ZMQPUBRAWTX"
|
|
189
|
+
if [ -n "$bitcoind_opts" ]; then
|
|
190
|
+
IFS=':' read -r _h _u _p <<< "$bitcoind_opts"
|
|
191
|
+
[ -n "$_h" ] && rpchost="$_h"
|
|
192
|
+
[ -n "$_u" ] && rpcuser="$_u"
|
|
193
|
+
[ -n "$_p" ] && rpcpass="$_p"
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
# Swap neutrino for bitcoind.
|
|
197
|
+
sed -i.bak 's/^lnd\.bitcoin\.node=neutrino/lnd.bitcoin.node=bitcoind/' "$output"
|
|
198
|
+
rm -f "$output.bak"
|
|
199
|
+
|
|
200
|
+
# Comment out lnd.neutrino lines.
|
|
201
|
+
sed -i.bak 's/^lnd\.neutrino\./#lnd.neutrino./' "$output"
|
|
202
|
+
rm -f "$output.bak"
|
|
203
|
+
|
|
204
|
+
# Comment out lnd.fee.url line (not needed for regtest).
|
|
205
|
+
sed -i.bak 's/^lnd\.fee\.url=/#lnd.fee.url=/' "$output"
|
|
206
|
+
rm -f "$output.bak"
|
|
207
|
+
|
|
208
|
+
# Append bitcoind connection settings if not already present.
|
|
209
|
+
if ! grep -q '^lnd\.bitcoind\.rpchost=' "$output"; then
|
|
210
|
+
echo "" >> "$output"
|
|
211
|
+
echo "# Bitcoind connection settings (regtest)." >> "$output"
|
|
212
|
+
echo "lnd.bitcoind.rpchost=$rpchost" >> "$output"
|
|
213
|
+
echo "lnd.bitcoind.rpcuser=$rpcuser" >> "$output"
|
|
214
|
+
echo "lnd.bitcoind.rpcpass=$rpcpass" >> "$output"
|
|
215
|
+
echo "lnd.bitcoind.zmqpubrawblock=$zmqblock" >> "$output"
|
|
216
|
+
echo "lnd.bitcoind.zmqpubrawtx=$zmqtx" >> "$output"
|
|
217
|
+
fi
|
|
218
|
+
}
|
|
219
|
+
|
|
102
220
|
# _append_extra_args converts CLI-style flags to config-file lines and
|
|
103
221
|
# appends them to the output file. Each --flag=value becomes flag=value;
|
|
104
222
|
# bare --flag becomes flag=true.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: mcp-
|
|
2
|
+
name: lightning-mcp-server
|
|
3
3
|
description: Build and configure the MCP server for Lightning Node Connect (LNC). Connects AI assistants to lnd nodes via encrypted WebSocket tunnels using pairing phrases — no direct network access or TLS certs needed. Read-only by default (18 tools for querying node state, channels, payments, invoices, peers, on-chain data).
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -18,13 +18,13 @@ node state but cannot send payments or modify channels.
|
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
# 1. Build the MCP server binary
|
|
21
|
-
skills/mcp-
|
|
21
|
+
skills/lightning-mcp-server/scripts/install.sh
|
|
22
22
|
|
|
23
23
|
# 2. Configure environment (mailbox server, dev mode, etc.)
|
|
24
|
-
skills/mcp-
|
|
24
|
+
skills/lightning-mcp-server/scripts/configure.sh
|
|
25
25
|
|
|
26
26
|
# 3. Add to Claude Code as an MCP server
|
|
27
|
-
skills/mcp-
|
|
27
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
Then restart Claude Code. The `lnc_connect` tool will be available to connect
|
|
@@ -33,10 +33,10 @@ to any lnd node using a pairing phrase.
|
|
|
33
33
|
## How It Works
|
|
34
34
|
|
|
35
35
|
```
|
|
36
|
-
Claude Code <--stdio--> mcp-
|
|
36
|
+
Claude Code <--stdio--> lightning-mcp-server <--LNC WebSocket--> Mailbox <--> lnd
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
1. Claude Code launches `mcp-
|
|
39
|
+
1. Claude Code launches `lightning-mcp-server` as a subprocess (stdio transport)
|
|
40
40
|
2. Agent calls `lnc_connect` with a pairing phrase and password
|
|
41
41
|
3. Server generates an ephemeral ECDSA keypair and opens an encrypted WebSocket
|
|
42
42
|
tunnel through the mailbox relay
|
|
@@ -50,28 +50,28 @@ only credential, and it's handled in-memory only.
|
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
# Build from source (requires Go 1.24+)
|
|
53
|
-
skills/mcp-
|
|
53
|
+
skills/lightning-mcp-server/scripts/install.sh
|
|
54
54
|
|
|
55
55
|
# Verify
|
|
56
|
-
mcp-
|
|
56
|
+
lightning-mcp-server -version
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
The install script builds from the `mcp-server/` directory in this repo.
|
|
59
|
+
The install script builds from the `lightning-mcp-server/` directory in this repo.
|
|
60
60
|
|
|
61
61
|
## Configuration
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
# Generate .env with defaults
|
|
65
|
-
skills/mcp-
|
|
65
|
+
skills/lightning-mcp-server/scripts/configure.sh
|
|
66
66
|
|
|
67
67
|
# Production (mainnet via Lightning Terminal)
|
|
68
|
-
skills/mcp-
|
|
68
|
+
skills/lightning-mcp-server/scripts/configure.sh --production
|
|
69
69
|
|
|
70
70
|
# Development (local regtest)
|
|
71
|
-
skills/mcp-
|
|
71
|
+
skills/lightning-mcp-server/scripts/configure.sh --dev --mailbox aperture:11110
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Configuration is stored in `mcp-server/.env`. Key settings:
|
|
74
|
+
Configuration is stored in `lightning-mcp-server/.env`. Key settings:
|
|
75
75
|
|
|
76
76
|
| Variable | Default | Description |
|
|
77
77
|
|----------|---------|-------------|
|
|
@@ -109,14 +109,14 @@ via `.mcp.json`), `--scope user` (all your projects).
|
|
|
109
109
|
### Option 2: Setup script (from source)
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
|
-
# Add mcp-
|
|
113
|
-
skills/mcp-
|
|
112
|
+
# Add lightning-mcp-server to Claude Code's MCP config
|
|
113
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh
|
|
114
114
|
|
|
115
115
|
# Project-level config (current project only)
|
|
116
|
-
skills/mcp-
|
|
116
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope project
|
|
117
117
|
|
|
118
118
|
# Global config (all projects)
|
|
119
|
-
skills/mcp-
|
|
119
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh --scope global
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
This adds the server to Claude Code's `.mcp.json` (project) or
|
|
@@ -147,7 +147,7 @@ Or with a locally built binary:
|
|
|
147
147
|
{
|
|
148
148
|
"mcpServers": {
|
|
149
149
|
"lnc": {
|
|
150
|
-
"command": "mcp-
|
|
150
|
+
"command": "lightning-mcp-server",
|
|
151
151
|
"env": {
|
|
152
152
|
"LNC_MAILBOX_SERVER": "mailbox.terminal.lightning.today:443"
|
|
153
153
|
}
|
|
@@ -168,7 +168,7 @@ Or run via Docker:
|
|
|
168
168
|
"--env", "LNC_MAILBOX_SERVER",
|
|
169
169
|
"--env", "LNC_DEV_MODE",
|
|
170
170
|
"--env", "LNC_INSECURE",
|
|
171
|
-
"mcp-
|
|
171
|
+
"lightning-mcp-server"
|
|
172
172
|
]
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -269,12 +269,12 @@ Check that the mailbox server is reachable. For production, ensure
|
|
|
269
269
|
### "TLS handshake failure"
|
|
270
270
|
If using a local regtest setup, enable dev mode and insecure mode:
|
|
271
271
|
```bash
|
|
272
|
-
skills/mcp-
|
|
272
|
+
skills/lightning-mcp-server/scripts/configure.sh --dev --insecure
|
|
273
273
|
```
|
|
274
274
|
|
|
275
275
|
### Tools not appearing in Claude Code
|
|
276
276
|
Restart Claude Code after running `setup-claude-config.sh`. Check that
|
|
277
|
-
`mcp-
|
|
277
|
+
`lightning-mcp-server` is on your `$PATH`:
|
|
278
278
|
```bash
|
|
279
|
-
which mcp-
|
|
279
|
+
which lightning-mcp-server
|
|
280
280
|
```
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
# configure.sh --dev --mailbox host # Custom mailbox server
|
|
9
9
|
# configure.sh --dev --insecure # Dev mode with TLS verification disabled
|
|
10
10
|
#
|
|
11
|
-
# Writes to mcp-server/.env in the lightning-agent-kit repo.
|
|
11
|
+
# Writes to lightning-mcp-server/.env in the lightning-agent-kit repo.
|
|
12
12
|
|
|
13
13
|
set -e
|
|
14
14
|
|
|
15
15
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
16
|
-
MCP_SERVER_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)/mcp-server"
|
|
16
|
+
MCP_SERVER_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)/lightning-mcp-server"
|
|
17
17
|
|
|
18
18
|
MAILBOX=""
|
|
19
19
|
DEV_MODE=""
|
|
@@ -66,9 +66,9 @@ while [[ $# -gt 0 ]]; do
|
|
|
66
66
|
esac
|
|
67
67
|
done
|
|
68
68
|
|
|
69
|
-
# Verify mcp-server directory exists.
|
|
69
|
+
# Verify lightning-mcp-server directory exists.
|
|
70
70
|
if [ ! -d "$MCP_SERVER_DIR" ]; then
|
|
71
|
-
echo "Error: mcp-server/ directory not found at $MCP_SERVER_DIR" >&2
|
|
71
|
+
echo "Error: lightning-mcp-server/ directory not found at $MCP_SERVER_DIR" >&2
|
|
72
72
|
exit 1
|
|
73
73
|
fi
|
|
74
74
|
|
|
@@ -126,5 +126,5 @@ chmod 600 "$ENV_FILE"
|
|
|
126
126
|
echo "Configuration written to $ENV_FILE (mode 0600)"
|
|
127
127
|
echo ""
|
|
128
128
|
echo "Next steps:"
|
|
129
|
-
echo " 1. Add to Claude Code: skills/mcp-
|
|
129
|
+
echo " 1. Add to Claude Code: skills/lightning-mcp-server/scripts/setup-claude-config.sh"
|
|
130
130
|
echo " 2. Restart Claude Code to pick up the new MCP server"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Build and install the MCP LNC server from source.
|
|
3
3
|
#
|
|
4
4
|
# Usage:
|
|
5
|
-
# install.sh # Build from mcp-server/ in this repo
|
|
5
|
+
# install.sh # Build from lightning-mcp-server/ in this repo
|
|
6
6
|
# install.sh --release # Build optimized release binary
|
|
7
7
|
#
|
|
8
8
|
# Prerequisites: Go 1.24+
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
set -e
|
|
11
11
|
|
|
12
12
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
13
|
-
MCP_SERVER_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)/mcp-server"
|
|
13
|
+
MCP_SERVER_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)/lightning-mcp-server"
|
|
14
14
|
RELEASE=false
|
|
15
15
|
|
|
16
16
|
# Parse arguments.
|
|
@@ -49,9 +49,9 @@ fi
|
|
|
49
49
|
GO_VERSION=$(go version | grep -oE 'go[0-9]+\.[0-9]+' | head -1)
|
|
50
50
|
echo "Go version: $GO_VERSION"
|
|
51
51
|
|
|
52
|
-
# Verify mcp-server directory exists.
|
|
52
|
+
# Verify lightning-mcp-server directory exists.
|
|
53
53
|
if [ ! -d "$MCP_SERVER_DIR" ]; then
|
|
54
|
-
echo "Error: mcp-server/ directory not found at $MCP_SERVER_DIR" >&2
|
|
54
|
+
echo "Error: lightning-mcp-server/ directory not found at $MCP_SERVER_DIR" >&2
|
|
55
55
|
echo "Are you running this from the lightning-agent-kit repo?" >&2
|
|
56
56
|
exit 1
|
|
57
57
|
fi
|
|
@@ -72,25 +72,25 @@ cd "$MCP_SERVER_DIR"
|
|
|
72
72
|
if [ "$RELEASE" = true ]; then
|
|
73
73
|
echo "Building release binary..."
|
|
74
74
|
COMMIT=$(git describe --abbrev=40 --always --dirty 2>/dev/null || echo "unknown")
|
|
75
|
-
PKG="github.com/lightninglabs/lightning-agent-kit/mcp-server"
|
|
76
|
-
go build -v -ldflags "-X ${PKG}.Commit=${COMMIT}" -o "$GOBIN/mcp-
|
|
75
|
+
PKG="github.com/lightninglabs/lightning-agent-kit/lightning-mcp-server"
|
|
76
|
+
go build -v -ldflags "-X ${PKG}.Commit=${COMMIT}" -o "$GOBIN/lightning-mcp-server" .
|
|
77
77
|
else
|
|
78
78
|
echo "Building debug binary..."
|
|
79
79
|
COMMIT=$(git describe --abbrev=40 --always --dirty 2>/dev/null || echo "unknown")
|
|
80
|
-
PKG="github.com/lightninglabs/lightning-agent-kit/mcp-server"
|
|
81
|
-
go build -v -tags "dev" -ldflags "-X ${PKG}.Commit=${COMMIT}" -o "$GOBIN/mcp-
|
|
80
|
+
PKG="github.com/lightninglabs/lightning-agent-kit/lightning-mcp-server"
|
|
81
|
+
go build -v -tags "dev" -ldflags "-X ${PKG}.Commit=${COMMIT}" -o "$GOBIN/lightning-mcp-server" .
|
|
82
82
|
fi
|
|
83
83
|
|
|
84
84
|
echo "Done."
|
|
85
85
|
echo ""
|
|
86
86
|
|
|
87
87
|
# Verify installation.
|
|
88
|
-
if command -v mcp-
|
|
89
|
-
echo "mcp-
|
|
90
|
-
mcp-
|
|
88
|
+
if command -v lightning-mcp-server &>/dev/null; then
|
|
89
|
+
echo "lightning-mcp-server installed: $(which lightning-mcp-server)"
|
|
90
|
+
lightning-mcp-server -version 2>/dev/null || true
|
|
91
91
|
else
|
|
92
|
-
echo "Warning: mcp-
|
|
93
|
-
echo "Binary built at: $GOBIN/mcp-
|
|
92
|
+
echo "Warning: lightning-mcp-server not found on PATH." >&2
|
|
93
|
+
echo "Binary built at: $GOBIN/lightning-mcp-server" >&2
|
|
94
94
|
echo "Ensure \$GOPATH/bin is in your PATH." >&2
|
|
95
95
|
echo " export PATH=\$PATH:\$(go env GOPATH)/bin" >&2
|
|
96
96
|
fi
|
|
@@ -99,5 +99,5 @@ echo ""
|
|
|
99
99
|
echo "Installation complete."
|
|
100
100
|
echo ""
|
|
101
101
|
echo "Next steps:"
|
|
102
|
-
echo " 1. Configure: skills/mcp-
|
|
103
|
-
echo " 2. Add to Claude Code: skills/mcp-
|
|
102
|
+
echo " 1. Configure: skills/lightning-mcp-server/scripts/configure.sh"
|
|
103
|
+
echo " 2. Add to Claude Code: skills/lightning-mcp-server/scripts/setup-claude-config.sh"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
set -e
|
|
13
13
|
|
|
14
14
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
15
|
-
MCP_SERVER_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)/mcp-server"
|
|
15
|
+
MCP_SERVER_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)/lightning-mcp-server"
|
|
16
16
|
|
|
17
17
|
SCOPE="project"
|
|
18
18
|
USE_DOCKER=false
|
|
@@ -108,7 +108,7 @@ if [ "$USE_DOCKER" = true ]; then
|
|
|
108
108
|
"--env", "LNC_MAILBOX_SERVER",
|
|
109
109
|
"--env", "LNC_DEV_MODE",
|
|
110
110
|
"--env", "LNC_INSECURE",
|
|
111
|
-
"mcp-
|
|
111
|
+
"lightning-mcp-server"],
|
|
112
112
|
env: {
|
|
113
113
|
LNC_MAILBOX_SERVER: $mailbox,
|
|
114
114
|
LNC_DEV_MODE: $devmode,
|
|
@@ -117,12 +117,12 @@ if [ "$USE_DOCKER" = true ]; then
|
|
|
117
117
|
}')
|
|
118
118
|
else
|
|
119
119
|
# Check that binary exists.
|
|
120
|
-
BINARY_PATH=$(command -v mcp-
|
|
120
|
+
BINARY_PATH=$(command -v lightning-mcp-server 2>/dev/null || echo "")
|
|
121
121
|
if [ -z "$BINARY_PATH" ]; then
|
|
122
|
-
echo "Warning: mcp-
|
|
122
|
+
echo "Warning: lightning-mcp-server not found on PATH." >&2
|
|
123
123
|
echo "Run install.sh first, or use --docker." >&2
|
|
124
124
|
echo ""
|
|
125
|
-
BINARY_PATH="mcp-
|
|
125
|
+
BINARY_PATH="lightning-mcp-server"
|
|
126
126
|
fi
|
|
127
127
|
|
|
128
128
|
MCP_ENTRY=$(jq -n \
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# MCP LNC Server Configuration
|
|
2
|
-
# Copy this file to mcp-server/.env and customize for your environment.
|
|
2
|
+
# Copy this file to lightning-mcp-server/.env and customize for your environment.
|
|
3
3
|
|
|
4
4
|
# Default mailbox server address
|
|
5
5
|
# Production: mailbox.terminal.lightning.today:443
|
|
@@ -218,7 +218,7 @@ differences from a standard lnd node:
|
|
|
218
218
|
- Replace admin macaroon with a signer-only macaroon (see `macaroon-bakery`)
|
|
219
219
|
- Restrict signer RPC to specific IP addresses via firewall
|
|
220
220
|
- Run signer on dedicated hardware or a hardened VM
|
|
221
|
-
- Use Lightning Node Connect (LNC) via `mcp-
|
|
221
|
+
- Use Lightning Node Connect (LNC) via `lightning-mcp-server` for read-only agent access
|
|
222
222
|
|
|
223
223
|
## Macaroon Bakery for Signer
|
|
224
224
|
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
# Usage:
|
|
5
5
|
# docker-start.sh # Default (testnet, background)
|
|
6
6
|
# docker-start.sh --network mainnet # Mainnet (real coins)
|
|
7
|
+
# docker-start.sh --regtest # Regtest with bitcoind backend
|
|
7
8
|
# docker-start.sh --foreground # Run in foreground (show logs)
|
|
8
9
|
# docker-start.sh --build # Rebuild before starting
|
|
10
|
+
# docker-start.sh --docker-network NAME # Join an existing Docker network
|
|
9
11
|
|
|
10
12
|
set -e
|
|
11
13
|
|
|
@@ -17,6 +19,7 @@ LIB_DIR="$SCRIPT_DIR/../../lib"
|
|
|
17
19
|
DETACH=true
|
|
18
20
|
BUILD=false
|
|
19
21
|
CUSTOM_NETWORK=""
|
|
22
|
+
DOCKER_NETWORK=""
|
|
20
23
|
|
|
21
24
|
# Source pinned versions so compose files pick them up as env vars.
|
|
22
25
|
if [ -f "$VERSIONS_FILE" ]; then
|
|
@@ -34,6 +37,14 @@ while [[ $# -gt 0 ]]; do
|
|
|
34
37
|
CUSTOM_NETWORK="$2"
|
|
35
38
|
shift 2
|
|
36
39
|
;;
|
|
40
|
+
--regtest)
|
|
41
|
+
CUSTOM_NETWORK="regtest"
|
|
42
|
+
shift
|
|
43
|
+
;;
|
|
44
|
+
--docker-network)
|
|
45
|
+
DOCKER_NETWORK="$2"
|
|
46
|
+
shift 2
|
|
47
|
+
;;
|
|
37
48
|
--build)
|
|
38
49
|
BUILD=true
|
|
39
50
|
shift
|
|
@@ -48,9 +59,11 @@ while [[ $# -gt 0 ]]; do
|
|
|
48
59
|
echo "Start the remote signer container."
|
|
49
60
|
echo ""
|
|
50
61
|
echo "Options:"
|
|
51
|
-
echo " --network NET
|
|
52
|
-
echo " --
|
|
53
|
-
echo " --
|
|
62
|
+
echo " --network NET Override network (testnet, mainnet, signet, regtest)"
|
|
63
|
+
echo " --regtest Shorthand for --network regtest"
|
|
64
|
+
echo " --docker-network NET Join an existing Docker network (e.g., regtest bitcoind)"
|
|
65
|
+
echo " --build Rebuild images before starting"
|
|
66
|
+
echo " --foreground, -f Run in foreground (show logs)"
|
|
54
67
|
exit 0
|
|
55
68
|
;;
|
|
56
69
|
*)
|
|
@@ -65,6 +78,8 @@ if [ -n "$CUSTOM_NETWORK" ]; then
|
|
|
65
78
|
NETWORK="$CUSTOM_NETWORK"
|
|
66
79
|
fi
|
|
67
80
|
|
|
81
|
+
EFFECTIVE_NETWORK="${NETWORK:-testnet}"
|
|
82
|
+
|
|
68
83
|
# --- Generate runtime config from template ---
|
|
69
84
|
|
|
70
85
|
LNGET_LND_DIR="${LNGET_LND_DIR:-$HOME/.lnget/lnd}"
|
|
@@ -73,7 +88,7 @@ mkdir -p "$LNGET_LND_DIR"
|
|
|
73
88
|
generate_lnd_config \
|
|
74
89
|
"$TEMPLATE_DIR/signer-lnd.conf.template" \
|
|
75
90
|
"$LNGET_LND_DIR/signer-lnd.conf" \
|
|
76
|
-
"$
|
|
91
|
+
"$EFFECTIVE_NETWORK" \
|
|
77
92
|
"${LND_DEBUG:-info}" \
|
|
78
93
|
""
|
|
79
94
|
|
|
@@ -85,7 +100,7 @@ cd "$TEMPLATE_DIR"
|
|
|
85
100
|
|
|
86
101
|
echo "=== Starting signer container ==="
|
|
87
102
|
echo " Config: $SIGNER_CONF_PATH"
|
|
88
|
-
echo " Network: $
|
|
103
|
+
echo " Network: $EFFECTIVE_NETWORK"
|
|
89
104
|
echo " Image: ${LND_IMAGE:-lightninglabs/lnd}:${LND_VERSION:-v0.20.0-beta}"
|
|
90
105
|
echo ""
|
|
91
106
|
|
|
@@ -105,6 +120,19 @@ fi
|
|
|
105
120
|
echo "Running: $CMD"
|
|
106
121
|
eval "$CMD"
|
|
107
122
|
|
|
123
|
+
# When running on regtest, connect the signer to the regtest Docker network
|
|
124
|
+
# so it can reach bitcoind.
|
|
125
|
+
if [ "$EFFECTIVE_NETWORK" = "regtest" ] && [ "$DETACH" = true ]; then
|
|
126
|
+
REGTEST_NETWORK="${DOCKER_NETWORK:-$(docker network ls --filter name=regtest --format '{{.Name}}' | head -1)}"
|
|
127
|
+
if [ -n "$REGTEST_NETWORK" ]; then
|
|
128
|
+
echo "Connecting signer to regtest network: $REGTEST_NETWORK"
|
|
129
|
+
docker network connect "$REGTEST_NETWORK" litd-signer 2>/dev/null || true
|
|
130
|
+
else
|
|
131
|
+
echo "Warning: No regtest Docker network found." >&2
|
|
132
|
+
echo "Start regtest bitcoind first, or use --docker-network to specify." >&2
|
|
133
|
+
fi
|
|
134
|
+
fi
|
|
135
|
+
|
|
108
136
|
if [ "$DETACH" = true ]; then
|
|
109
137
|
echo ""
|
|
110
138
|
echo "Signer started in background."
|
package/skills/lnd/SKILL.md
CHANGED
|
@@ -186,15 +186,15 @@ skills/lnd/scripts/lncli.sh \
|
|
|
186
186
|
|
|
187
187
|
## MCP / Lightning Node Connect
|
|
188
188
|
|
|
189
|
-
For read-only access without direct gRPC connectivity, use the
|
|
190
|
-
with Lightning Node Connect (LNC). LNC uses
|
|
191
|
-
certs, macaroons, or open ports needed.
|
|
192
|
-
Terminal.
|
|
189
|
+
For read-only access without direct gRPC connectivity, use the
|
|
190
|
+
`lightning-mcp-server` skill with Lightning Node Connect (LNC). LNC uses
|
|
191
|
+
encrypted WebSocket tunnels — no TLS certs, macaroons, or open ports needed.
|
|
192
|
+
Just a pairing phrase from Lightning Terminal.
|
|
193
193
|
|
|
194
194
|
```bash
|
|
195
|
-
skills/mcp-
|
|
196
|
-
skills/mcp-
|
|
197
|
-
skills/mcp-
|
|
195
|
+
skills/lightning-mcp-server/scripts/install.sh
|
|
196
|
+
skills/lightning-mcp-server/scripts/configure.sh
|
|
197
|
+
skills/lightning-mcp-server/scripts/setup-claude-config.sh
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
## Wallet Setup
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
# docker-start.sh # Standalone litd, testnet (default)
|
|
6
6
|
# docker-start.sh --watchonly # Watch-only + signer (production)
|
|
7
7
|
# docker-start.sh --regtest # Regtest with bitcoind (dev)
|
|
8
|
+
# docker-start.sh --watchonly --regtest # Watch-only + signer on regtest
|
|
8
9
|
# docker-start.sh --network mainnet # Override network
|
|
9
10
|
# docker-start.sh --profile taproot # Load profile
|
|
10
11
|
# docker-start.sh --foreground # Run in foreground (show logs)
|
|
@@ -21,11 +22,13 @@ VERSIONS_FILE="$SCRIPT_DIR/../../../versions.env"
|
|
|
21
22
|
LIB_DIR="$SCRIPT_DIR/../../lib"
|
|
22
23
|
|
|
23
24
|
MODE="standalone"
|
|
25
|
+
REGTEST=false
|
|
24
26
|
BUILD=false
|
|
25
27
|
DETACH=true
|
|
26
28
|
PROFILE=""
|
|
27
29
|
CUSTOM_ARGS=""
|
|
28
30
|
CUSTOM_NETWORK=""
|
|
31
|
+
DOCKER_NETWORK=""
|
|
29
32
|
|
|
30
33
|
# Source pinned versions so compose files pick them up as env vars.
|
|
31
34
|
if [ -f "$VERSIONS_FILE" ]; then
|
|
@@ -45,7 +48,7 @@ while [[ $# -gt 0 ]]; do
|
|
|
45
48
|
shift
|
|
46
49
|
;;
|
|
47
50
|
--regtest)
|
|
48
|
-
|
|
51
|
+
REGTEST=true
|
|
49
52
|
shift
|
|
50
53
|
;;
|
|
51
54
|
--build)
|
|
@@ -64,6 +67,10 @@ while [[ $# -gt 0 ]]; do
|
|
|
64
67
|
CUSTOM_NETWORK="$2"
|
|
65
68
|
shift 2
|
|
66
69
|
;;
|
|
70
|
+
--docker-network)
|
|
71
|
+
DOCKER_NETWORK="$2"
|
|
72
|
+
shift 2
|
|
73
|
+
;;
|
|
67
74
|
--args|-a)
|
|
68
75
|
CUSTOM_ARGS="$2"
|
|
69
76
|
shift 2
|
|
@@ -86,19 +93,21 @@ while [[ $# -gt 0 ]]; do
|
|
|
86
93
|
echo "Start litd (Lightning Terminal) containers."
|
|
87
94
|
echo ""
|
|
88
95
|
echo "Modes:"
|
|
89
|
-
echo " (default)
|
|
90
|
-
echo " --watchonly
|
|
91
|
-
echo " --regtest
|
|
96
|
+
echo " (default) Standalone litd with neutrino (testnet)"
|
|
97
|
+
echo " --watchonly Watch-only litd + remote signer"
|
|
98
|
+
echo " --regtest litd + bitcoind for local development"
|
|
99
|
+
echo " --watchonly --regtest Watch-only + signer on regtest"
|
|
92
100
|
echo ""
|
|
93
101
|
echo "Configuration:"
|
|
94
|
-
echo " --profile, -p
|
|
95
|
-
echo " --network NET
|
|
96
|
-
echo " --
|
|
97
|
-
echo " --
|
|
102
|
+
echo " --profile, -p Load profile (taproot, wumbo, debug, regtest)"
|
|
103
|
+
echo " --network NET Override network (testnet, mainnet, signet)"
|
|
104
|
+
echo " --docker-network NET Docker network to join (for external bitcoind)"
|
|
105
|
+
echo " --args, -a Extra litd arguments (quoted string)"
|
|
106
|
+
echo " --list-profiles Show available profiles"
|
|
98
107
|
echo ""
|
|
99
108
|
echo "Options:"
|
|
100
|
-
echo " --build
|
|
101
|
-
echo " --foreground, -f
|
|
109
|
+
echo " --build Rebuild images before starting"
|
|
110
|
+
echo " --foreground, -f Run in foreground (show logs)"
|
|
102
111
|
exit 0
|
|
103
112
|
;;
|
|
104
113
|
*)
|
|
@@ -108,6 +117,12 @@ while [[ $# -gt 0 ]]; do
|
|
|
108
117
|
esac
|
|
109
118
|
done
|
|
110
119
|
|
|
120
|
+
# Handle --regtest flag: if MODE is still standalone, set to regtest.
|
|
121
|
+
# If MODE is watchonly, keep it as watchonly but set network to regtest.
|
|
122
|
+
if [ "$REGTEST" = true ] && [ "$MODE" = "standalone" ]; then
|
|
123
|
+
MODE="regtest"
|
|
124
|
+
fi
|
|
125
|
+
|
|
111
126
|
# Load profile if specified.
|
|
112
127
|
if [ -n "$PROFILE" ]; then
|
|
113
128
|
PROFILE_FILE="$PROFILE_DIR/$PROFILE.env"
|
|
@@ -149,6 +164,13 @@ case "$MODE" in
|
|
|
149
164
|
;;
|
|
150
165
|
esac
|
|
151
166
|
|
|
167
|
+
# Determine effective network (regtest flag overrides for watchonly mode).
|
|
168
|
+
if [ "$REGTEST" = true ]; then
|
|
169
|
+
EFFECTIVE_NETWORK="regtest"
|
|
170
|
+
else
|
|
171
|
+
EFFECTIVE_NETWORK="${NETWORK:-testnet}"
|
|
172
|
+
fi
|
|
173
|
+
|
|
152
174
|
# --- Generate runtime config from template ---
|
|
153
175
|
|
|
154
176
|
LNGET_LND_DIR="${LNGET_LND_DIR:-$HOME/.lnget/lnd}"
|
|
@@ -179,7 +201,7 @@ case "$MODE" in
|
|
|
179
201
|
generate_litd_config \
|
|
180
202
|
"$TEMPLATE_DIR/litd-watchonly.conf.template" \
|
|
181
203
|
"$LNGET_LND_DIR/litd.conf" \
|
|
182
|
-
"$
|
|
204
|
+
"$EFFECTIVE_NETWORK" \
|
|
183
205
|
"${LND_DEBUG:-info}" \
|
|
184
206
|
"${NODE_ALIAS:-litd-agent}" \
|
|
185
207
|
"${UI_PASSWORD:-agent-litd-password}" \
|
|
@@ -189,7 +211,7 @@ case "$MODE" in
|
|
|
189
211
|
generate_lnd_config \
|
|
190
212
|
"$SIGNER_TEMPLATE_DIR/signer-lnd.conf.template" \
|
|
191
213
|
"$LNGET_LND_DIR/signer-lnd.conf" \
|
|
192
|
-
"$
|
|
214
|
+
"$EFFECTIVE_NETWORK" \
|
|
193
215
|
"${SIGNER_DEBUG:-info}" \
|
|
194
216
|
""
|
|
195
217
|
|
|
@@ -203,10 +225,10 @@ export LITD_CONF_PATH="$LNGET_LND_DIR/litd.conf"
|
|
|
203
225
|
|
|
204
226
|
cd "$TEMPLATE_DIR"
|
|
205
227
|
|
|
206
|
-
echo "=== Starting litd ($MODE mode) ==="
|
|
228
|
+
echo "=== Starting litd ($MODE mode$([ "$REGTEST" = true ] && [ "$MODE" = "watchonly" ] && echo " + regtest")) ==="
|
|
207
229
|
echo " Compose: $COMPOSE_FILE"
|
|
208
230
|
echo " Config: $LITD_CONF_PATH"
|
|
209
|
-
echo " Network: $
|
|
231
|
+
echo " Network: $EFFECTIVE_NETWORK"
|
|
210
232
|
if [ -n "$PROFILE" ]; then
|
|
211
233
|
echo " Profile: $PROFILE"
|
|
212
234
|
fi
|
|
@@ -231,6 +253,20 @@ fi
|
|
|
231
253
|
echo "Running: $CMD"
|
|
232
254
|
eval "$CMD"
|
|
233
255
|
|
|
256
|
+
# When watchonly + regtest, join the regtest Docker network so the signer and
|
|
257
|
+
# litd can reach the existing bitcoind container.
|
|
258
|
+
if [ "$REGTEST" = true ] && [ "$MODE" = "watchonly" ]; then
|
|
259
|
+
REGTEST_NETWORK="${DOCKER_NETWORK:-$(docker network ls --filter name=regtest --format '{{.Name}}' | head -1)}"
|
|
260
|
+
if [ -n "$REGTEST_NETWORK" ]; then
|
|
261
|
+
echo "Connecting containers to regtest network: $REGTEST_NETWORK"
|
|
262
|
+
docker network connect "$REGTEST_NETWORK" litd-signer 2>/dev/null || true
|
|
263
|
+
docker network connect "$REGTEST_NETWORK" litd 2>/dev/null || true
|
|
264
|
+
else
|
|
265
|
+
echo "Warning: No regtest Docker network found." >&2
|
|
266
|
+
echo "Start regtest bitcoind first, or use --docker-network to specify." >&2
|
|
267
|
+
fi
|
|
268
|
+
fi
|
|
269
|
+
|
|
234
270
|
if [ "$DETACH" = true ]; then
|
|
235
271
|
echo ""
|
|
236
272
|
echo "litd started in background."
|
|
@@ -44,12 +44,13 @@ lnd.bitcoin.basefee=1000
|
|
|
44
44
|
lnd.bitcoin.feerate=1
|
|
45
45
|
lnd.bitcoin.timelockdelta=80
|
|
46
46
|
|
|
47
|
-
# bitcoind connection (
|
|
48
|
-
|
|
47
|
+
# bitcoind connection (container name — works both within compose and for
|
|
48
|
+
# containers joining the network externally via docker network connect).
|
|
49
|
+
lnd.bitcoind.rpchost=litd-bitcoind:18443
|
|
49
50
|
lnd.bitcoind.rpcuser=devuser
|
|
50
51
|
lnd.bitcoind.rpcpass=devpass
|
|
51
|
-
lnd.bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
|
52
|
-
lnd.bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
|
52
|
+
lnd.bitcoind.zmqpubrawblock=tcp://litd-bitcoind:28332
|
|
53
|
+
lnd.bitcoind.zmqpubrawtx=tcp://litd-bitcoind:28333
|
|
53
54
|
|
|
54
55
|
lnd.db.backend=sqlite
|
|
55
56
|
|
package/skills/lnget/SKILL.md
CHANGED
|
@@ -185,6 +185,12 @@ lnget ln neutrino status
|
|
|
185
185
|
|
|
186
186
|
Config lives at `~/.lnget/config.yaml`. Run `lnget config init` to create it.
|
|
187
187
|
|
|
188
|
+
**Note:** `lnget config init` may generate incorrect YAML key names (e.g.,
|
|
189
|
+
`tlscertpath` and `macaroonpath` instead of `tls_cert` and `macaroon`) due to
|
|
190
|
+
missing yaml struct tags in the lnget source. Use the example below as the
|
|
191
|
+
reference config format. If your config was generated by `lnget config init`,
|
|
192
|
+
verify the `ln.lnd` keys match the format shown here.
|
|
193
|
+
|
|
188
194
|
```yaml
|
|
189
195
|
l402:
|
|
190
196
|
max_cost_sats: 1000 # Max invoice to auto-pay
|
|
@@ -211,6 +211,7 @@ if [ -n "$ROLE" ]; then
|
|
|
211
211
|
"uri:/routerrpc.Router/SendPaymentV2"
|
|
212
212
|
"uri:/lnrpc.Lightning/DecodePayReq"
|
|
213
213
|
"uri:/lnrpc.Lightning/GetInfo"
|
|
214
|
+
"uri:/verrpc.Versioner/GetVersion"
|
|
214
215
|
)
|
|
215
216
|
;;
|
|
216
217
|
invoice-only)
|
|
@@ -220,6 +221,7 @@ if [ -n "$ROLE" ]; then
|
|
|
220
221
|
"uri:/lnrpc.Lightning/LookupInvoice"
|
|
221
222
|
"uri:/lnrpc.Lightning/ListInvoices"
|
|
222
223
|
"uri:/lnrpc.Lightning/GetInfo"
|
|
224
|
+
"uri:/verrpc.Versioner/GetVersion"
|
|
223
225
|
)
|
|
224
226
|
;;
|
|
225
227
|
read-only)
|
|
@@ -233,6 +235,7 @@ if [ -n "$ROLE" ]; then
|
|
|
233
235
|
"uri:/lnrpc.Lightning/ListInvoices"
|
|
234
236
|
"uri:/lnrpc.Lightning/GetNodeInfo"
|
|
235
237
|
"uri:/lnrpc.Lightning/GetChanInfo"
|
|
238
|
+
"uri:/verrpc.Versioner/GetVersion"
|
|
236
239
|
)
|
|
237
240
|
;;
|
|
238
241
|
channel-admin)
|
|
@@ -249,6 +252,7 @@ if [ -n "$ROLE" ]; then
|
|
|
249
252
|
"uri:/lnrpc.Lightning/ClosedChannels"
|
|
250
253
|
"uri:/lnrpc.Lightning/GetNodeInfo"
|
|
251
254
|
"uri:/lnrpc.Lightning/GetChanInfo"
|
|
255
|
+
"uri:/verrpc.Versioner/GetVersion"
|
|
252
256
|
)
|
|
253
257
|
;;
|
|
254
258
|
signer-only)
|
|
@@ -263,6 +267,7 @@ if [ -n "$ROLE" ]; then
|
|
|
263
267
|
"uri:/walletrpc.WalletKit/DeriveKey"
|
|
264
268
|
"uri:/walletrpc.WalletKit/DeriveNextKey"
|
|
265
269
|
"uri:/lnrpc.Lightning/GetInfo"
|
|
270
|
+
"uri:/verrpc.Versioner/GetVersion"
|
|
266
271
|
)
|
|
267
272
|
;;
|
|
268
273
|
*)
|