Skip to content

hermes -z can miss MCP tools because oneshot snapshots tools before MCP discovery #38448

@TheGoldDash

Description

@TheGoldDash

Bug

In hermes -z (oneshot mode), configured MCP servers can pass hermes mcp test <server> but their tools are missing from the agent's available tool list.

Observed

hermes mcp test camoufox succeeds and discovers 17 tools, including camoufox_status.

But running:

HERMES_HOME=~/.hermes/profiles/quinn hermes -z \
  "Call mcp_camoufox_camoufox_status"

reports that mcp_camoufox_camoufox_status was not available.

Cause

hermes_cli/oneshot.py builds AIAgent (via _get_platform_tools(...)) before MCP discovery has registered dynamic MCP toolsets and aliases. The agent's available tool list is resolved at construction time, so tools added later by MCP discovery are never seen.

Local Fix

Running discover_mcp_tools() inline in oneshot.py before resolving platform toolsets fixes it:

cfg = load_config()

if isinstance(cfg.get("mcp_servers"), dict) and cfg.get("mcp_servers"):
    from tools.mcp_tool import discover_mcp_tools
    discover_mcp_tools()

After this, the same hermes -z call successfully used mcp_camoufox_camoufox_status.

Expected

hermes -z should expose configured MCP tools consistently with hermes mcp test and gateway startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtool/mcpMCP client and OAuthtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions