Bug Description
MCP server tools are successfully discovered by hermes mcp test (3 tools found), but they do not appear in the agent's available tool list during a TUI session. The agent cannot call MCP tools even though the server is connected and tools are registered.
Steps to Reproduce
- Configure an MCP server in
~/.hermes/config.yaml with HTTP transport (url-based)
- Start the MCP server (confirm the port is listening)
- Run
hermes mcp test <name> → succeeds, discovers tools
- Start a TUI session (
hermes)
- The agent does not see or cannot call MCP tools
Expected Behavior
MCP tools should be available as first-class tools in the agent session after successful discovery.
Investigation
Looking at the source code, I suspect a race condition in the TUI startup path:
hermes_cli/main.py:_prepare_agent_startup() skips inline MCP discovery for TUI launches (_is_tui_chat_launch returns True → _run_inline_mcp_discovery = False)
- The comment says: "The TUI launcher hands off to a dedicated startup path that already backgrounds MCP discovery with a bounded join before the first tool snapshot."
- In
hermes_cli/mcp_startup.py, wait_for_mcp_discovery() has a timeout of only 0.75 seconds
- If the MCP server takes longer than 0.75s to connect and enumerate tools, the tool snapshot is taken before MCP tools are registered
hermes mcp test works because it runs synchronously with its own timeout
The 0.75s timeout in wait_for_mcp_discovery() is likely too short for HTTP-based MCP servers, especially on first connection.
Environment
- OS: Windows 10
- Hermes Agent: latest (via
hermes update)
- MCP server: HTTP transport (url-based config)
- Shell: git-bash / MSYS
Possible Fix
Either increase wait_for_mcp_discovery() timeout (e.g. to 5-10s), or add a mechanism to inject MCP tools into an already-running agent session after late discovery completes (similar to what /reload-mcp does).
Bug Description
MCP server tools are successfully discovered by
hermes mcp test(3 tools found), but they do not appear in the agent's available tool list during a TUI session. The agent cannot call MCP tools even though the server is connected and tools are registered.Steps to Reproduce
~/.hermes/config.yamlwith HTTP transport (url-based)hermes mcp test <name>→ succeeds, discovers toolshermes)Expected Behavior
MCP tools should be available as first-class tools in the agent session after successful discovery.
Investigation
Looking at the source code, I suspect a race condition in the TUI startup path:
hermes_cli/main.py:_prepare_agent_startup()skips inline MCP discovery for TUI launches (_is_tui_chat_launchreturns True →_run_inline_mcp_discovery = False)hermes_cli/mcp_startup.py,wait_for_mcp_discovery()has a timeout of only 0.75 secondshermes mcp testworks because it runs synchronously with its own timeoutThe 0.75s timeout in
wait_for_mcp_discovery()is likely too short for HTTP-based MCP servers, especially on first connection.Environment
hermes update)Possible Fix
Either increase
wait_for_mcp_discovery()timeout (e.g. to 5-10s), or add a mechanism to inject MCP tools into an already-running agent session after late discovery completes (similar to what/reload-mcpdoes).