feat(settings): read-only MCP Servers tab in the settings modal#28
Merged
Conversation
Mirror the web's "🔌 MCP Servers" settings surface in the TUI, so the cross-backend MCP registry is visible from every frontend (not just web). - protocol: `McpServerStatus` + a `mcp_servers` field on `SettingsSnapshot` (`#[serde(default)]` → forward-compatible; older daemons deserialize fine). - state: `has_mcp_tab()` / `on_mcp_tab()` + `tab_count()` appends the synthetic MCP tab after the manifest tabs when the daemon reports servers. `tab_fields()` is already empty there, so field nav/edit/save no-op on the read-only tab. - ui: a header pill + a body renderer (`mcp_server_rows`) showing each server's health (connected/error/idle/disabled, colour-coded), transport · trust · tool count, error text, tool list, and backends; `built-in` badge for memory. Test: the synthetic tab appears only when servers exist, sits after the manifest tabs, exposes no fields, and disappears when the list empties. fmt clean; 284 tests pass; clippy advisory (no new error-level lints). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🤖 Gemini code reviewThis PR introduces a read-only 'MCP Servers' tab to the TUI settings modal, bringing feature parity with the web interface. It appends a synthetic tab when the daemon reports registry MCP servers and displays their health status, tools, and error messages. Findings: 🔴 0 · 🟠 0 · 🟡 0 · 🟢 1 Tokens spent · ⬆️ Input: 3,919 · ⬇️ Output: 318 · Σ Total: 7,462 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 68.78% 70.30% +1.51%
==========================================
Files 31 31
Lines 9659 9862 +203
==========================================
+ Hits 6644 6933 +289
+ Misses 3015 2929 -86
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…r path) Renders the settings modal on the synthetic MCP tab via TestBackend and asserts the pill, server names, built-in badge, health chip, and tool list appear — covering mcp_server_rows + the header pill branch (lifts patch coverage).
If parked on the synthetic MCP tab and a fresh snapshot drops mcp_servers, the tab index was left out of range (safe .get() → blank body until next ←/→). Add SettingsModal::clamp_tab() and call it whenever the snapshot updates (settings.get/set results). No panic before; this removes the blank-body papercut. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
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.
What
Brings the cross-backend MCP registry surface to the TUI, matching the web's "🔌 MCP Servers" settings tab (codeoid #203). Until now the daemon emitted
mcpServerson the settings snapshot but only the web rendered it — the TUI was blind to it (unbroken, just no view). Now every frontend shows it.Changes
McpServerStatusstruct + amcp_serversfield onSettingsSnapshot.#[serde(default)]keeps it forward-compatible: an older daemon that doesn't send the field deserializes fine (empty).has_mcp_tab()/on_mcp_tab()andtab_count()appends a synthetic MCP tab after the manifest tabs only when the daemon reports servers.tab_fields()is already empty there, so field navigation / edit / save no-op on the read-only tab — zero changes needed in the key handlers.mcp_server_rows: per server, a colour-coded health chip (connected/error/idle/disabled),transport · trust · N tools, error text, tool list, backends, and abuilt-inbadge forcodeoid_memory.Tests
A state test asserts the synthetic tab appears only when servers exist, sits after the manifest tabs, exposes no fields, and disappears when the list empties.
cargo fmt --checkclean; 284 tests pass; clippy is advisory (no new error-level lints).Note
This depends on the daemon sending
mcpServersin the settings snapshot (codeoid #203). The Rust struct is a hand-maintained mirror of the TSMcpServerStatus— the usual codeoid-protocol convention.🤖 Generated with Claude Code