Skip to content

[Bug]: TUI/CLI startup banner shows MCP servers as "failed" while async connection is still in progress #39901

Closed as not planned

Description

@redfieldchristabel

Bug Description

When starting hermes chat or hermes --tui, HTTP MCP servers (clickup, github, linear — anything using OAuth or Bearer auth over HTTP) show as (http) — failed in the startup banner. The servers actually connect fine within 3–5 seconds, but the banner renders before async MCP initialization completes.

This is a render-timing problem: the banner snapshots MCP connection states while they're still in the "connecting" phase. The servers finish connecting shortly after, but the user's first impression is that their setup is broken.

From agent.log:

WARNING tools.mcp_tool: MCP server 'phpstorm' initial connection failed (attempt 2/3)...
WARNING tools.mcp_tool: MCP server 'phpstorm' failed initial connection after 3 attempts, giving up
INFO  tools.mcp_tool: MCP: registered 260 tool(s) from 6 server(s) (1 failed)

Only phpstorm truly failed (needs PhpStorm IDE running). The other 5 (clickup, github, linear, dart-mcp-server, butterfly, gitlab) connected fine. But the banner showed ALL including clickup as "failed".

Steps to Reproduce

  1. Configure any HTTP MCP server with OAuth or Bearer auth (e.g. clickup, github via githubcopilot, linear)
  2. Run hermes chat or hermes --tui
  3. Observe the startup banner — HTTP MCP servers show as (http) — failed

Wait for the session to fully initialize (3–5s), then check:

hermes mcp list

All servers show as ✓ enabled with tools discovered.

Expected Behavior

The banner should either:

  • Show a distinct state like (http) — connecting... or (http) — pending instead of failed for servers that haven't finished async init yet
  • Or defer rendering the MCP status section until all servers have resolved (connect or fail)
  • Or update the banner dynamically as connections complete

failed should be reserved for cases where startup was attempted and threw/spawn failed.

Actual Behavior

Banner displays clickup (http) — failed for servers that connect successfully moments later. This sends users on a debugging rabbit hole investigating credentials, tokens, and network when there's nothing wrong.

Evidence

$ hermes mcp test clickup
Testing 'clickup'...
  Transport: HTTP → https://mcp.clickup.com/mcp
  Auth: OAuth 2.1 PKCE
  ✓ Connected (3452ms)
  ✓ Tools discovered: 51

$ hermes mcp list
  Name     Transport                    Tools    Status
  clickup  https://mcp.clickup.com/mcp  all      ✓ enabled
  github   https://api.githubcopilot... all      ✓ enabled
  linear   https://mcp.linear.app/mcp   all      ✓ enabled

All servers are healthy. The "failed" banner is a false negative.

Related Issues

Our case is distinct: the hermes wrapper IS calling discover_mcp_tools() correctly (the servers eventually connect and tools are registered), but the startup banner renders before async HTTP connections resolve.

Suggested Fix

In the MCP status rendering path (likely in cli.py or the startup banner code), distinguish between:

  1. failed — spawn was attempted and threw/connection was rejected
  2. connecting / pending — async init is still in progress (default initial state)
  3. connected — handshake complete, tools discovered

For HTTP MCP servers especially, the async connection can take 3–5 seconds due to TLS + OAuth overhead. The banner should not mark these as failed before they've had a chance to complete.

Alternatively, if the calling code can get a future/promise from the connection attempt, the banner could defer rendering the MCP section until all servers have resolved or a timeout elapses.

Operating System

Linux (Kali 6.18.5)

Hermes Version

v0.15.1 (2026.5.29)

Python Version

3.11.15

Additional Context

Full logs confirming:

2026-06-05 19:55:06,933 INFO tools.mcp_tool: MCP: registered 260 tool(s) from 6 server(s) (1 failed)

Only phpstorm failed. clickup, github, linear, dart-mcp-server, butterfly, gitlab — all 6 connected successfully. But the startup banner shown to the user listed all HTTP servers as "failed".

Activity

  1. added
    type/bugSomething isn't working
    tool/mcpMCP client and OAuth
    comp/cliCLI entry point, hermes_cli/, setup wizard
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    P3Low — cosmetic, nice to have
    on Jun 5, 2026
  2. yong2bba commented on Jun 6, 2026

    @yong2bba

    Additional reproduction from macOS / Hermes v0.16.0:

    • Environment: macOS 26.5, Python 3.11.15
    • Hermes: Hermes Agent v0.16.0 (2026.6.5) · upstream 15068744
    • Symptom: the startup welcome banner lists enabled MCP servers as failed immediately at launch, even though they are usable shortly after discovery completes.
    • Observed servers in the banner: context7, playwright, lazyweb, oecd, imf, korea_stats, sec_edgar, bok_ecos, penpot, magnific, openosint all displayed as failed; korean_dart correctly displayed as disabled.

    Verification that this is a false negative / startup rendering issue rather than actual MCP failure:

    hermes mcp list
    # enabled MCP servers are configured and discoverable
    
    hermes chat -Q -q 'MCP smoke: answer only OK, no tool use.' --max-turns 1
    # OK
    

    Direct MCP tool smoke tests from the same session also succeeded, e.g. Context7 library resolve, Lazyweb health, KOSIS quick stats, OECD categories, and BOK ECOS search.

    Timing observation:

    after 0s: connected=[]
    after 2s: connected=['korea_stats']
    after 5s: connected=['context7', 'playwright', 'lazyweb', 'oecd', 'imf', 'korea_stats', 'sec_edgar', 'bok_ecos', 'penpot', 'magnific', 'openosint']
    

    So this still appears to be a static startup-banner snapshot racing against async MCP discovery. Slowing down/defering the banner would hide the issue, but the better fix likely needs an explicit pending/connecting state or a post-discovery readiness update. failed should probably only be shown after discovery has resolved for that server.

  3. WuFengSheng commented on Jun 7, 2026

    @WuFengSheng

    Same issue here on macOS. Every startup shows:

    amap-maps (stdio) — failed
    playwright (stdio) — failed
    

    But the servers connect fine ~2-4 seconds later. Logs confirm:

    MCP server 'amap-maps' (stdio): registered 12 tool(s)
    MCP server 'playwright' (stdio): registered 23 tool(s)
    MCP: registered 39 tool(s) from 3 server(s)
    

    hermes mcp test amap-maps also succeeds (connected in 4578ms). The tools work perfectly in-session. The false alarm in the banner is misleading and makes users think something is broken when it isn't.

    Suggestions:

    1. Show "connecting..." instead of "failed" for servers still in initialization
    2. Or delay the banner until all MCP discovery completes (within a timeout)
    3. Or update banner status asynchronously when connections finish
  4. tkreiner commented on Jun 12, 2026

    @tkreiner

    I believe I'm having the same issue as reported above, but I'm seeing slightly different symptoms. I'm on a Mac installation. The MCP servers I'm accessing are over a VPN connection. Using hermes --tui, I see the MCP servers showing at the top in a failed state.

    Image

    Anything I try to do to get Hermes to use the MCP server tools fails. It simply doesn't get the tool context. However, if I issue a /new command and start a new session, then the MCP servers show at a valid status and the use of the tools work as expected.

    Image

    This has felt like a simple timing issue that the UI is loading before the MCP tool definitions have had a chance to fully load.

    I have tried extending both timeout and connect_timeout settings for the MCP server definitions in the .hermes/config.yaml file and those have appeared to not change the issue.

    Experienced issue on both versions 0.15.1 and on 0.16.0.

  5. teknium1 commented on Jul 14, 2026

    @teknium1
    Collaborator

    Implemented on current main by later MCP startup/status work. This is an automated hermes-sweeper review.

    • tools/mcp_tool.py:5111-5138 now returns distinct connecting, configured, and failed states; failed is reserved for recorded connection errors.
    • hermes_cli/banner.py:764-790 renders connecting/configured rather than falling through to red failed.
    • ui-tui/src/components/branding.tsx:248-268 applies the same state handling in the TUI.
    • tui_gateway/server.py:4384-4436 refreshes MCP tools that complete discovery before the first turn, addressing the related initial-session availability report.
    • Regression coverage exists in tests/tools/test_mcp_tool.py:125-172 and tests/hermes_cli/test_banner.py:171-202.

    The linked PR #39920 proposed the same status distinction; the current implementation already provides the reported behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardcomp/tuiTerminal UI (ui-tui/ + tui_gateway/)sweeper:implemented-on-mainSweeper: behavior already present on current maintool/mcpMCP client and OAuthtype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions