-
Notifications
You must be signed in to change notification settings - Fork 2
bug(tui): MCP tool count stuck at fixed value when some servers fail to connect #2277
Description
Problem
The TUI's MCP Tools panel always shows the same total tool count regardless of how many MCP servers are configured in the config. Specifically, when some servers fail to connect (OAuth timeout, Docker not running), only the tools from successfully-connected servers are counted — but this is not communicated to the user.
Observed Behavior
With 3 MCP servers configured (mcpls stdio, playwright docker, todoist OAuth), the TUI shows a fixed tool count (e.g. 75) that reflects only mcpls tools. Adding or removing todoist/playwright from the config does not change the displayed count because those servers never connect.
Root Cause
mcp_tool_count in MetricsSnapshot is set once during startup from connect_all() results and updated only on /mcp add|remove commands or tools/list_changed events. Failed servers contribute 0 tools and there is no indication in the TUI that some configured servers did not connect.
crates/zeph-core/src/agent/builder.rs:841—mcp_tool_countset at build timecrates/zeph-tui/src/widgets/skills.rs:72-75—MCP Tools (active/total)widget shows only totals, no per-server status
Expected Behavior
- TUI should show per-server connection status (connected / failed / pending OAuth)
- TUI should indicate when a configured server failed to connect (with reason: OAuth required, Docker unavailable, timeout, etc.)
- OR at minimum: the Resources panel should show
N/M servers connectedinstead of only the aggregate tool count
Related
This bug is largely a symptom of #2276 (OAuth blocks startup): todoist tools are always 0 because OAuth never completes, making the total appear stuck.
Files
crates/zeph-tui/src/widgets/resources.rs:130-135— MCP server/tool count displaycrates/zeph-tui/src/widgets/skills.rs:61-78— MCP Tools panelcrates/zeph-core/src/metrics.rs:172-173—mcp_server_count,mcp_tool_countfields (no per-server status)