Skip to content

Commit 3bc8a6e

Browse files
committed
Document ldk-server-mcp in the workspace
Describe the MCP bridge as a first-class workspace member and document how to build, test, and sanity-check it alongside the rest of ldk-server. Co-Authored-By: HAL 9000
1 parent 78aedb1 commit 3bc8a6e

3 files changed

Lines changed: 49 additions & 6 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ The primary goal of LDK Server is to provide an efficient, stable, and API-first
99
a Lightning Network node. With its streamlined setup, LDK Server enables users to easily set up, configure, and run
1010
a Lightning node while exposing a robust, language-agnostic API via [Protocol Buffers (Protobuf)](https://protobuf.dev/).
1111

12+
## Workspace Crates
13+
14+
- `ldk-server`: daemon that runs the Lightning node and exposes the API
15+
- `ldk-server-cli`: CLI client for the server API
16+
- `ldk-server-client`: Rust client library for authenticated TLS gRPC calls
17+
- `ldk-server-grpc`: generated protobuf and shared gRPC types
18+
- `ldk-server-mcp`: stdio MCP bridge exposing unary `ldk-server` RPCs as MCP tools
19+
1220
### Features
1321

1422
- **Out-of-the-Box Lightning Node**:
@@ -46,6 +54,11 @@ git clone https://github.com/lightningdevkit/ldk-server.git
4654
cargo build
4755
```
4856

57+
Build just the MCP bridge:
58+
```
59+
cargo build -p ldk-server-mcp
60+
```
61+
4962
### Running
5063
- Using a config file:
5164
```
@@ -87,6 +100,18 @@ eval "$(ldk-server-cli completions zsh)"
87100
ldk-server-cli completions fish | source
88101
```
89102

103+
## MCP Bridge
104+
105+
The workspace also includes `ldk-server-mcp`, a stdio [Model Context Protocol](https://spec.modelcontextprotocol.io/) server
106+
that lets MCP-compatible clients call the unary `ldk-server` RPC surface as tools.
107+
108+
Run it directly from the workspace:
109+
```bash
110+
cargo run -p ldk-server-mcp -- --config /path/to/config.toml
111+
```
112+
113+
It is covered by both crate-local tests and an `e2e-tests` sanity suite against a live `ldk-server` instance.
114+
90115
## Contributing
91116

92117
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on building, testing, code style, and development workflow.

ldk-server-mcp/CLAUDE.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
MCP (Model Context Protocol) server that exposes LDK Server operations as tools for AI agents.
44

5+
This crate is a member of the `ldk-server` workspace and should be kept green under the workspace-wide checks.
6+
57
## Build / Test Commands
68

79
```bash
810
cargo fmt --all
911
cargo check
10-
cargo test
11-
cargo clippy
12+
cargo test -p ldk-server-mcp
13+
cargo clippy -p ldk-server-mcp --all-targets -- -D warnings
14+
15+
# MCP sanity checks against a live ldk-server instance
16+
cargo test --manifest-path e2e-tests/Cargo.toml mcp -- --nocapture
1217
```
1318

1419
## Architecture
@@ -41,6 +46,9 @@ The server reads configuration in this precedence order (highest first):
4146
2. **CLI argument**: `--config <path>` pointing to a TOML file
4247
3. **Default paths**: `~/.ldk-server/config.toml`, `~/.ldk-server/tls.crt`, `~/.ldk-server/{network}/api_key`
4348

49+
If no config path is provided explicitly, the crate uses the default `ldk-server` config location at
50+
`~/.ldk-server/config.toml`.
51+
4452
TOML config format (same as ldk-server-cli):
4553
```toml
4654
[node]
@@ -59,3 +67,5 @@ When a new endpoint is added to `ldk-server-client`:
5967
2. Add a handler function in `src/tools/handlers.rs`
6068
3. Register in `build_tool_registry()` in `src/tools/mod.rs`
6169
4. Update the expected tool surface in `tests/integration.rs`
70+
5. Add or update helper-level coverage in `src/tools/handlers.rs` when parsing or validation changes
71+
6. If the tool is suitable for live validation, extend `e2e-tests/tests/mcp.rs`

ldk-server-mcp/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
An [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"
3537
export LDK_BASE_URL="localhost:3000"
3638
export LDK_API_KEY="your_hex_encoded_api_key"
3739
export LDK_TLS_CERT_PATH="/path/to/tls.crt"
38-
./target/release/ldk-server-mcp
40+
cargo run -p ldk-server-mcp --release
3941
```
4042

4143
Or 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

4954
Add the following to your Claude Desktop MCP configuration (`claude_desktop_config.json`):
@@ -158,7 +163,10 @@ Streaming RPCs such as `subscribe_events` and non-RPC HTTP endpoints such as `me
158163
## Testing
159164

160165
```bash
161-
cargo test
166+
cargo test -p ldk-server-mcp
167+
168+
# MCP end-to-end sanity checks against a live ldk-server
169+
cargo test --manifest-path e2e-tests/Cargo.toml mcp -- --nocapture
162170
```
163171

164172
## License

0 commit comments

Comments
 (0)