22
33An [ MCP (Model Context Protocol)] ( https://spec.modelcontextprotocol.io/ ) server that exposes [ LDK Server] ( https://github.com/lightningdevkit/ldk-server ) operations as tools for AI agents. It communicates over JSON-RPC 2.0 via stdio and connects to an LDK Server instance over TLS using the [ ` ldk-server-client ` ] ( https://github.com/lightningdevkit/ldk-server/tree/main/ldk-server-client ) library.
44
5+ This crate lives inside the ` ldk-server ` workspace.
6+
57## Building
68
79``` bash
8- cargo build --release
10+ cargo build -p ldk-server-mcp - -release
911```
1012
1113## Configuration
@@ -35,15 +37,18 @@ cert_path = "/path/to/tls.crt"
3537export LDK_BASE_URL=" localhost:3000"
3638export LDK_API_KEY=" your_hex_encoded_api_key"
3739export LDK_TLS_CERT_PATH=" /path/to/tls.crt"
38- ./target/release/ ldk-server-mcp
40+ cargo run -p ldk-server-mcp --release
3941```
4042
4143Or using a config file:
4244
4345``` bash
44- ./target/release/ ldk-server-mcp --config /path/to/config.toml
46+ cargo run -p ldk-server-mcp -- --config /path/to/config.toml
4547```
4648
49+ If ` --config ` is omitted, ` ldk-server-mcp ` falls back to the same default config path as
50+ ` ldk-server ` and ` ldk-server-cli ` : ` ~/.ldk-server/config.toml ` .
51+
4752### With Claude Desktop
4853
4954Add the following to your Claude Desktop MCP configuration (` claude_desktop_config.json ` ):
@@ -84,71 +89,10 @@ Add to your Claude Code MCP settings (`.claude/settings.json`):
8489
8590## Available Tools
8691
87- The server exposes 37 unary LDK Server RPCs as MCP tools.
92+ All unary LDK Server RPCs are exposed as MCP tools. Use ` tools/list ` to discover the current set .
8893
8994Streaming RPCs such as ` subscribe_events ` and non-RPC HTTP endpoints such as ` metrics ` are not exposed as tools.
9095
91- ### Node
92- | Tool | Description |
93- | ------| -------------|
94- | ` get_node_info ` | Retrieve node info including node_id, sync status, and best block |
95- | ` get_balances ` | Retrieve an overview of all known balances (on-chain and Lightning) |
96-
97- ### On-chain
98- | Tool | Description |
99- | ------| -------------|
100- | ` onchain_receive ` | Generate a new on-chain Bitcoin funding address |
101- | ` onchain_send ` | Send an on-chain Bitcoin payment to an address |
102-
103- ### Payments
104- | Tool | Description |
105- | ------| -------------|
106- | ` bolt11_receive ` | Create a BOLT11 Lightning invoice to receive a payment |
107- | ` bolt11_receive_for_hash ` | Create a BOLT11 Lightning invoice for a specific payment hash |
108- | ` bolt11_claim_for_hash ` | Manually claim a BOLT11 payment for a specific payment hash |
109- | ` bolt11_fail_for_hash ` | Manually fail a BOLT11 payment for a specific payment hash |
110- | ` bolt11_receive_via_jit_channel ` | Create a BOLT11 Lightning invoice to receive via an LSPS2 JIT channel |
111- | ` bolt11_receive_variable_amount_via_jit_channel ` | Create a variable-amount BOLT11 Lightning invoice to receive via an LSPS2 JIT channel |
112- | ` bolt11_send ` | Pay a BOLT11 Lightning invoice |
113- | ` bolt12_receive ` | Create a BOLT12 offer for receiving Lightning payments |
114- | ` bolt12_send ` | Pay a BOLT12 Lightning offer |
115- | ` spontaneous_send ` | Send a spontaneous (keysend) payment to a Lightning node |
116- | ` unified_send ` | Send a payment given a BIP 21 URI or BIP 353 Human-Readable Name |
117-
118- ### Channels
119- | Tool | Description |
120- | ------| -------------|
121- | ` open_channel ` | Open a new Lightning channel with a remote node |
122- | ` close_channel ` | Cooperatively close a Lightning channel |
123- | ` force_close_channel ` | Force close a Lightning channel unilaterally |
124- | ` list_channels ` | List all known Lightning channels |
125- | ` update_channel_config ` | Update forwarding fees and CLTV delta for a channel |
126- | ` splice_in ` | Increase a channel's balance by splicing in on-chain funds |
127- | ` splice_out ` | Decrease a channel's balance by splicing out to on-chain |
128-
129- ### Payment History
130- | Tool | Description |
131- | ------| -------------|
132- | ` list_payments ` | List all payments (supports pagination via page_token) |
133- | ` get_payment_details ` | Get details of a specific payment by its ID |
134- | ` list_forwarded_payments ` | List all forwarded payments (supports pagination via page_token) |
135-
136- ### Peers
137- | Tool | Description |
138- | ------| -------------|
139- | ` connect_peer ` | Connect to a Lightning peer without opening a channel |
140- | ` disconnect_peer ` | Disconnect from a Lightning peer |
141- | ` list_peers ` | List all known Lightning peers |
142-
143- ### Utilities
144- | Tool | Description |
145- | ------| -------------|
146- | ` decode_invoice ` | Decode a BOLT11 invoice and return its parsed fields |
147- | ` decode_offer ` | Decode a BOLT12 offer and return its parsed fields |
148- | ` sign_message ` | Sign a message with the node's secret key |
149- | ` verify_signature ` | Verify a signature against a message and public key |
150- | ` export_pathfinding_scores ` | Export the pathfinding scores used by the Lightning router |
151-
15296## MCP Protocol
15397
15498- ** Protocol version** : ` 2025-11-25 `
@@ -158,7 +102,10 @@ Streaming RPCs such as `subscribe_events` and non-RPC HTTP endpoints such as `me
158102## Testing
159103
160104``` bash
161- cargo test
105+ cargo test -p ldk-server-mcp
106+
107+ # MCP end-to-end sanity checks against a live ldk-server
108+ cargo test --manifest-path e2e-tests/Cargo.toml mcp -- --nocapture
162109```
163110
164111## License
0 commit comments