Skip to content

Commit 6706d52

Browse files
committed
docs(plan): mark mcp transport plan completed
1 parent 0609812 commit 6706d52

1 file changed

Lines changed: 34 additions & 24 deletions

File tree

docs/plans/2026-03-11-mcp-transport.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# MCP Transport (stdio) Implementation Plan
22

3-
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
3+
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if available) or superpowers:executing-plans to implement this plan. Steps use markdown checkboxes for tracking.
44
55
**Goal:** Add MCP client support (stdio transport) so LoopForge can load an `mcp-servers.json`, expose MCP tools to the model, and route tool calls/resources/prompts through MCP.
66

77
**Architecture:** Session-scoped MCP config is stored in runtime KV. Toolset owns MCP transports and exposes namespaced tool definitions (`mcp_<server>__<tool>`) plus wrapper tools for resources/prompts.
88

99
**Tech Stack:** Rust, tokio, serde_json, newline-delimited JSON-RPC over stdio.
1010

11+
**Execution Status (2026-04-07):** Completed and merged on `main` (initial landing: `f33803e`; follow-up hardening and coverage included up to `0609812`).
12+
13+
**Re-Verification (2026-04-07):**
14+
- `cargo test -p loopforge-cli --locked cli::tests -q`
15+
- `cargo test -p rexos-tools --locked mcp -q`
16+
- `cargo test -p rexos-tools --locked -q`
17+
- `cargo test -p rexos --locked agent_loop -q`
18+
- `python3 -m mkdocs build --strict`
19+
- `make check`
20+
1121
---
1222

1323
## Chunk 1: CLI + session storage plumbing
@@ -20,20 +30,20 @@
2030
- Modify: `crates/rexos-runtime/src/session_skills/storage.rs`
2131
- Test: `crates/loopforge-cli/src/cli/tests.rs` (CLI parse)
2232

23-
- [ ] **Step 1: Add `--mcp-config` to `loopforge agent run`**
33+
- [x] **Step 1: Add `--mcp-config` to `loopforge agent run`**
2434
- Add `mcp_config: Option<PathBuf>` argument.
2535

26-
- [ ] **Step 2: CLI reads JSON file and stores content for the session**
36+
- [x] **Step 2: CLI reads JSON file and stores content for the session**
2737
- Read file bytes, parse JSON for validity, store normalized string in runtime session KV.
2838

29-
- [ ] **Step 3: Add runtime APIs**
39+
- [x] **Step 3: Add runtime APIs**
3040
- `set_session_mcp_config(session_id, raw_json)`
3141
- `load_session_mcp_config(session_id) -> Option<String>`
3242

33-
- [ ] **Step 4: Update CLI tests**
43+
- [x] **Step 4: Update CLI tests**
3444
- Ensure the new flag parses.
3545

36-
- [ ] **Step 5: Run focused tests**
46+
- [x] **Step 5: Run focused tests**
3747
- Run: `cargo test -p loopforge-cli cli::tests -q`
3848
- Expected: PASS
3949

@@ -51,24 +61,24 @@
5161
- Create: `crates/rexos-tools/src/mcp/types.rs`
5262
- Test: `crates/rexos-tools/src/mcp/tests.rs`
5363

54-
- [ ] **Step 1: Define config types**
64+
- [x] **Step 1: Define config types**
5565
- `McpServersConfig { servers: BTreeMap<String, McpServerConfig> }`
5666
- `McpServerConfig { command, args, env, cwd }`
5767

58-
- [ ] **Step 2: Implement JSON-RPC client helper**
68+
- [x] **Step 2: Implement JSON-RPC client helper**
5969
- `send_request(method, params) -> Result<Value>`
6070
- background read loop, oneshot per id, timeout support.
6171

62-
- [ ] **Step 3: Implement stdio transport**
72+
- [x] **Step 3: Implement stdio transport**
6373
- spawn child, newline-delimited JSON, capture stderr tail on failure.
6474

65-
- [ ] **Step 4: Implement MCP handshake**
75+
- [x] **Step 4: Implement MCP handshake**
6676
- `initialize` then `initialized` notification.
6777

68-
- [ ] **Step 5: Unit tests for JSON-RPC routing**
78+
- [x] **Step 5: Unit tests for JSON-RPC routing**
6979
- use a minimal in-process “fake transport” (or spawn stub binary) to validate request/response matching.
7080

71-
- [ ] **Step 6: Run focused tests**
81+
- [x] **Step 6: Run focused tests**
7282
- Run: `cargo test -p rexos-tools mcp -q`
7383
- Expected: PASS
7484

@@ -92,20 +102,20 @@
92102
- Create: `crates/rexos-tools/src/dispatch/mcp/mod.rs`
93103
- Test: `crates/rexos-tools/src/tests/compat.rs` (definitions include MCP wrappers when enabled)
94104

95-
- [ ] **Step 1: Add MCP wrapper tool defs**
105+
- [x] **Step 1: Add MCP wrapper tool defs**
96106
- `mcp_resources_list`, `mcp_resources_read`, `mcp_prompts_list`, `mcp_prompts_get`, `mcp_servers_list`
97107

98-
- [ ] **Step 2: Extend Toolset with optional MCP hub**
108+
- [x] **Step 2: Extend Toolset with optional MCP hub**
99109
- On build: parse raw JSON from runtime, initialize servers, list tools.
100110

101-
- [ ] **Step 3: Flatten remote MCP tools into `ToolDefinition`s**
111+
- [x] **Step 3: Flatten remote MCP tools into `ToolDefinition`s**
102112
- name: `mcp_<server>__<tool>`
103113
- parameters: remote `inputSchema` (default `{ "type": "object" }`)
104114

105-
- [ ] **Step 4: Add dispatch routing**
115+
- [x] **Step 4: Add dispatch routing**
106116
- New domain `ToolCallDomain::Mcp` and route calls to MCP hub.
107117

108-
- [ ] **Step 5: Run focused tests**
118+
- [x] **Step 5: Run focused tests**
109119
- Run: `cargo test -p rexos-tools -q`
110120
- Expected: PASS
111121

@@ -120,16 +130,16 @@
120130
- Modify: `crates/rexos-runtime/src/session_skills/storage.rs`
121131
- Test: `crates/rexos/tests/agent_loop.rs` (add a small case with MCP stub)
122132

123-
- [ ] **Step 1: Load session MCP config in `run_session`**
133+
- [x] **Step 1: Load session MCP config in `run_session`**
124134
- If present, build Toolset with MCP enabled.
125135

126-
- [ ] **Step 2: Ensure tool defs include MCP tools**
136+
- [x] **Step 2: Ensure tool defs include MCP tools**
127137
- Toolset initializes MCP before `tool_defs` is computed.
128138

129-
- [ ] **Step 3: Add an integration-ish test**
139+
- [x] **Step 3: Add an integration-ish test**
130140
- Spawn MCP stdio stub, configure via `--mcp-config`-equivalent session KV, verify a tool call succeeds.
131141

132-
- [ ] **Step 4: Run runtime tests**
142+
- [x] **Step 4: Run runtime tests**
133143
- Run: `cargo test -p rexos agent_loop -q`
134144
- Expected: PASS
135145

@@ -143,15 +153,15 @@
143153
- Modify: `docs-site/blog/mcp-integration-guide.md`
144154
- Modify: `docs-site/reference/config.md` (optional: mention session flag, not TOML)
145155

146-
- [ ] **Step 1: Update MCP blog to match real CLI**
156+
- [x] **Step 1: Update MCP blog to match real CLI**
147157
- Keep `--mcp-config` example, remove commands that do not exist (`config add-mcp-server`).
148158

149-
- [ ] **Step 2: Verify docs build**
159+
- [x] **Step 2: Verify docs build**
150160
- Run: `python3 -m mkdocs build --strict`
151161
- Expected: PASS
152162

153163
### Task 6: Full verification
154164

155-
- [ ] **Step 1: Run full checks**
165+
- [x] **Step 1: Run full checks**
156166
- Run: `make check`
157167
- Expected: PASS

0 commit comments

Comments
 (0)