Skip to content

fix(tui): show per-server MCP connection status in TUI#2280

Merged
bug-ops merged 2 commits intomainfrom
2277-tui-mcp-server-status
Mar 27, 2026
Merged

fix(tui): show per-server MCP connection status in TUI#2280
bug-ops merged 2 commits intomainfrom
2277-tui-mcp-server-status

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 27, 2026

Problem

The TUI's MCP Tools panel always showed the total tool count from successfully-connected servers only. When a server failed to connect, it silently disappeared — the Resources panel showed "2 servers, 14 tools" even if one of three configured servers failed. There was no per-server status visible anywhere.

Changes

zeph-mcp

  • Add ServerConnectOutcome { id, connected, tool_count, error } struct
  • Change connect_all() return type to (Vec<McpTool>, Vec<ServerConnectOutcome>) — all failure paths covered (connection error, list_tools error, OAuth errors, skipped servers)
  • Add configured_server_count() method
  • Update all callers (agent_setup.rs, daemon.rs, acp.rs)

zeph-core::metrics

  • Add McpServerConnectionStatus enum (Connected / Failed)
  • Add McpServerStatus { id, status, tool_count, error } struct
  • Add mcp_connected_count: usize and mcp_servers: Vec<McpServerStatus> to MetricsSnapshot
  • mcp_server_count now = total configured servers (not just connected)

zeph-core agent

  • McpState gains server_outcomes: Vec<ServerConnectOutcome>
  • New with_mcp_server_outcomes() builder method
  • with_metrics() derives counts from outcomes
  • /mcp add and /mcp remove keep mcp_connected_count and mcp_servers in sync

zeph-tui

  • Resources panel: "N/M connected, K tools" format
  • Skills panel: per-server rows with OK (green) / FAIL (red) indicator and tool count

Other

  • Add #[allow(clippy::unused_async)] on scrub_pii_union (pre-existing clippy failure that blocked -D warnings under default features)

Test plan

  • All 6293 unit tests pass (cargo nextest run --workspace --lib --bins)
  • cargo clippy --workspace -- -D warnings clean
  • cargo +nightly fmt --check clean
  • Snapshot resources_with_full_infra updated to show 2/2 connected, 14 tools

Closes #2277

@github-actions github-actions bot added bug Something isn't working size/L Large PR (201-500 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate and removed size/L Large PR (201-500 lines) labels Mar 27, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 27, 2026 21:31
@github-actions github-actions bot added the size/L Large PR (201-500 lines) label Mar 27, 2026
bug-ops added 2 commits March 27, 2026 22:43
- Add `ServerConnectOutcome` struct to `zeph-mcp` with id, connected flag,
  tool_count, and error string; `connect_all()` now returns
  `(Vec<McpTool>, Vec<ServerConnectOutcome>)` covering all failure paths
  including OAuth errors and skipped servers
- Add `McpServerConnectionStatus` enum and `McpServerStatus` struct to
  `zeph-core::metrics`; `MetricsSnapshot` gains `mcp_connected_count` and
  `mcp_servers`; `mcp_server_count` now reflects total configured servers
- Propagate outcomes through `McpState.server_outcomes`, `with_mcp_server_outcomes()`
  builder method, and `with_metrics()` in agent builder
- Keep `mcp_connected_count` and `mcp_servers` consistent on `/mcp add` and
  `/mcp remove` commands
- Resources panel: change MCP line to "N/M connected, K tools" format
- Skills panel: add per-server status rows (OK green / FAIL red) with tool
  count above the tool list
- Fix pre-existing `clippy::unused_async` on `scrub_pii_union` (blocked -D warnings)
@bug-ops bug-ops force-pushed the 2277-tui-mcp-server-status branch from 1e53638 to 9f08720 Compare March 27, 2026 21:44
@bug-ops bug-ops merged commit eeee88b into main Mar 27, 2026
25 checks passed
@bug-ops bug-ops deleted the 2277-tui-mcp-server-status branch March 27, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(tui): MCP tool count stuck at fixed value when some servers fail to connect

1 participant