You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Exa MCP Server - hermes mcp test passes but tool calls fail #36264
Run hermes mcp test exa → shows ✅ Connected, discovers 3 tools
Call any exa tool (e.g., mcp_exa_web_search_exa) → fails with "MCP server 'exa' is not connected"
Expected
Both test AND tool calls should succeed for HTTP-based MCP servers.
Environment
Hermes v0.15.x (latest)
macOS
HTTP transport MCP server (Exa)
Root Cause (suspected)
HTTP transport MCP servers: hermes mcp test uses HTTP GET to verify connectivity, but actual tool calls use JSON-RPC over HTTP POST. The test succeeds but tool calls fail because the transport layer doesn't properly bridge to the JSON-RPC protocol for HTTP-based servers like Exa.
Additional Context
Other HTTP-based MCP servers likely affected. The issue seems to be in how Hermes handles the transport layer for HTTP vs stdio MCP servers.
This is the same root cause as #37768. In register_mcp_servers() (tools/mcp_tool.py), the skip condition checks k not in _servers — so a server that disconnects and remains in _servers with session=None is permanently skipped on subsequent startups. The tool handlers then return "not connected" forever until the agent restarts.
Both use the same logic change: allow reconnection when getattr(_servers[k], "session", None) is None.
Neither PR has been reviewed or merged yet. The fix is straightforward but has two edge cases worth addressing before merge:
TOCTOU race — the session is None check runs inside _lock, but the background MCPServerTask mutates session without holding _lock. A stale server could reconnect between the check and the connection attempt, spawning duplicate tasks.
Old task cleanup — neither PR cancels the lingering MCPServerTask._task before creating a new connection, which could lead to resource leaks and two concurrent loops fighting over the same server entry.
Recommendation: land one of these PRs (likely #37899 for better test coverage) with the above two issues addressed. Happy to help polish the fix if needed.
This is implemented on current main; closing via automated hermes-sweeper review.
43a425632 (fix(mcp): wake stale cached servers on session startup) detects cached MCP entries with session is None and signals their existing reconnect task rather than treating their _servers presence as permanently connected.
Current implementation: tools/mcp_tool.py:4910-4926.
Regression coverage: tests/tools/test_mcp_register_wakes_stale.py:14-59 verifies stale cached entries are woken while healthy entries are not.
Activity
DavidMetcalfe commentedon Jun 28, 2026
This is the same root cause as #37768. In
register_mcp_servers()(tools/mcp_tool.py), the skip condition checksk not in _servers— so a server that disconnects and remains in_serverswithsession=Noneis permanently skipped on subsequent startups. The tool handlers then return "not connected" forever until the agent restarts.Two open PRs address this:
Both use the same logic change: allow reconnection when
getattr(_servers[k], "session", None) is None.Neither PR has been reviewed or merged yet. The fix is straightforward but has two edge cases worth addressing before merge:
session is Nonecheck runs inside_lock, but the backgroundMCPServerTaskmutatessessionwithout holding_lock. A stale server could reconnect between the check and the connection attempt, spawning duplicate tasks.MCPServerTask._taskbefore creating a new connection, which could lead to resource leaks and two concurrent loops fighting over the same server entry.Recommendation: land one of these PRs (likely #37899 for better test coverage) with the above two issues addressed. Happy to help polish the fix if needed.
teknium1 commentedon Jul 13, 2026
This is implemented on current
main; closing via automated hermes-sweeper review.43a425632(fix(mcp): wake stale cached servers on session startup) detects cached MCP entries withsession is Noneand signals their existing reconnect task rather than treating their_serverspresence as permanently connected.tools/mcp_tool.py:4910-4926.tests/tools/test_mcp_register_wakes_stale.py:14-59verifies stale cached entries are woken while healthy entries are not.v2026.7.7(Hermes Agent v0.18.1).