T-130: MCP server over HTTP+SSE for /ide integration
test / unit + widget + golden + a11y (push) Failing after 27s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 27s
test / unit + widget + golden + a11y (push) Failing after 27s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 27s
Seventh slice of T-99. clide now advertises itself to Claude Code's /ide command and serves a working MCP endpoint over HTTP+SSE per D-73 (the Q-33 transport decision, locked in this commit). What lands: * D-73 — MCP transport for /ide is SSE over HTTP. Resolves Q-33; references D-68 + D-72. * lib/src/ipc/mcp_server.dart — McpServer class. localhost HTTP listener on a random port; GET /sse opens a long-lived SSE stream with an initial endpoint event carrying the session id; POST /messages?sessionId=... accepts JSON-RPC requests and replies via the matching SSE stream. JSON-RPC handlers for initialize, tools/list, tools/call. * Discovery file at $HOME/.claude/ide/<pid>.lock with the workspace + url so `/ide` can find us. Removed on stop. * The two /ide minimum tools (mcp__ide__getDiagnostics, mcp__ide__executeCode) ship as stubs — real implementations need the analyzer integration / a clide eval surface, both follow-ups. * main.dart starts the MCP server alongside the unix IPC server on daemonClientFactory and project switch. Failure non-fatal — the UI runs without MCP. * 12 server tests cover lifecycle (start/stop, lock file), unknown paths, full JSON-RPC round-trip for all four methods, error responses, and edge cases (unknown session, malformed JSON, notification without id). The "Claude Code's /ide discovers and connects" smoke is deferred to T-131 wrap-up since it needs a real Claude Code session against the running app — out of scope for unit/widget tests. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,12 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
|
||||
to 16 recent matching events per subsystem (D-6), and streams new
|
||||
ones as JSON lines. C client loops on `data.streaming` ack. Slow /
|
||||
broken subscribers drop themselves without blocking the bus.
|
||||
- MCP server over HTTP+SSE (T-99 / T-130, per D-68 / D-73). Localhost
|
||||
HTTP listener advertises via `$HOME/.claude/ide/<pid>.lock` so
|
||||
Claude Code's `/ide` discovers it. JSON-RPC 2.0 with the two
|
||||
minimum `/ide` tools shipped as stubs
|
||||
(`mcp__ide__getDiagnostics`, `mcp__ide__executeCode`); real
|
||||
implementations follow.
|
||||
- C `clide` shell client at `native/clide-cli/clide.c`. Walks CWD up
|
||||
to the git root, hashes to the per-workspace socket (D-70), ships
|
||||
argv. `make clide-cli` builds it; on PATH, `clide status` works
|
||||
|
||||
Reference in New Issue
Block a user