feat(mcp): /mcp panel + status-bar slot + tool/serverUpdated handler#2
Open
ssjoleary wants to merge 3 commits into
Open
feat(mcp): /mcp panel + status-bar slot + tool/serverUpdated handler#2ssjoleary wants to merge 3 commits into
ssjoleary wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
There was a problem hiding this comment.
Pull request overview
Adds MCP awareness to the CLI by tracking server updates, exposing a /mcp status panel, and surfacing aggregate MCP health in the status bar.
Changes:
- Introduces
eca-cli.mcpfor MCP state handling, panel rendering, status-bar fragments, and connect dispatch. - Wires
tool/serverUpdatednotifications,/mcpcommand registration, andmcp/connectServerprotocol notification. - Adds MCP-focused tests and includes them in the Babashka test task.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/eca_cli/mcp.clj |
Adds MCP state, rendering, status summary, and connect handling. |
src/eca_cli/view.clj |
Renders the MCP picker panel and inserts MCP status into the status bar. |
src/eca_cli/state.clj |
Routes MCP notifications and MCP picker Enter handling. |
src/eca_cli/protocol.clj |
Adds mcp/connectServer notification helper. |
src/eca_cli/commands.clj |
Registers the /mcp command. |
test/eca_cli/mcp_test.clj |
Adds tests for MCP updates, rendering, connect dispatch, and command registration. |
bb.edn |
Includes MCP tests in the test task. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+69
to
+73
| (let [{:keys [kind query list]} (:picker state)] | ||
| (if (= :mcp kind) | ||
| (str "MCP servers\n" | ||
| (divider (:width state)) "\n" | ||
| (str/join "\n" (mcp/render-mcp-panel-lines state))) |
| (update :tools #(or % [])) | ||
| (update :prompts #(or % [])) | ||
| (update :resources #(or % []))) | ||
| state' (assoc-in state [:mcps name] entry)] |
Addresses PR #2 review: - Panel now renders from picker's :filtered, not :mcps directly, so display matches Enter target after filter typing. - tool/serverUpdated refreshes picker :all/:filtered when the panel is open, preserving query/selection where possible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace three copies of `(and (= :picking (:mode state)) (= :mcp (get-in state [:picker :kind])))` (two in mcp.clj, one in state.clj) with `mcp/picker-open?`. Policy of "MCP picker is the active overlay" lives in one place. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/eca_cli/mcp.clj— MCP state slice,tool/serverUpdatedhandler,/mcppanel, status-bar fragment, andmcp/connectServerdispatch onrequires-authactivation.MCPs: 3/4 ⚠(wide) /M:3/4(narrow); hidden when no MCPs configured.[connect]affordance onrequires-authrows.tool/serverUpdatedper configured MCP at startup, no client pre-population needed.Tracks Phase 7 in
docs/roadmap.md.Decisions worth flagging
tool/serverUpdated— protocol confirms (noerrorfield). Failed rows render(check ~/.cache/eca/eca-cli.log)as a generic hint, matching the eca-emacs UX (eca-mcp.el:250-256).requires-authrows show a generic[connect]button that dispatchesmcp/connectServer {name}./mcpshows a system message rather than opening an empty picker, mirroring the existingcmd-open-model-pickerempty-state pattern.Status-bar slot order
Frozen as part of Wave 1 architecture decision:
```
workspace · loading · model · agent · variant · [MCPs:n/m] · [N jobs] · tokens · cost · ctx% · title · trust
```
This PR owns the `[MCPs:n/m]` slot. The `[N jobs]` slot is delivered by the Phase 11b PR.
Test plan
brepl smoke
```
AC4 (160 cols, 3/4 running): "MCPs: 3/4 ⚠"
AC5 (160 cols, 4/4 running): "MCPs: 4/4 ✓"
AC6 (80 cols, 3/4 running): "M:3/4"
Panel rows:
🟠 alpha · 0 tools · requires-auth [connect]
🔴 bravo · 1 tools · failed (check ~/.cache/eca/eca-cli.log)
🟢 charlie · 2 tools · running
```