NousResearch/hermes-agent

MCP SDK missing causes unclear NameError at runtime

Cluster 30904 · hermes cli. Data as of

3 open items. Fix merged in #31450. Check it covers your case.

The short answer

1open issue
2open PRs
8items grouped
Known?
Yes. 8 related items grouped here, 2 issues already closed.
Fix event
A fix was merged to main in PR #31450. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this partially resolved, deciding PR #31450. That is separate from the fix event.
Still open
1 issue and 2 PRs.

Multiple issues and fixes address a problem where missing MCP or related SDK packages produce confusing NameError exceptions instead of clear ImportError messages. The fixes aim to provide actionable error messages when the MCP SDK is not installed.

Open issues1

  • Issue#31005Homebrew bottle 2026.5.16 missing 'mcp' and 'websockets' packages — MCP and browser tools fail at runtime

Open PRs2

  • PR#34223fix(mcp): fail fast when sdk is missing
  • PR#105586fix(mcp): fail fast with actionable error when mcp SDK missing (salvage of #34245)

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #31450 fix(mcp): raise ImportError instead of NameError when stdio SDK missing

    merged to main

    files: tests/tools/test_mcp_tool.py, tools/mcp_tool.py

    Show the diff
    • tests/tools/test_mcp_tool.py
      @@ -1462,6 +1462,27 @@ async def _test():
       
               asyncio.run(_test())
       
      +    def test_stdio_unavailable_raises_importerror_not_nameerror(self):
      +        """Regression test for #30904.
      +
      +        When the mcp SDK isn't installed, ``_run_stdio`` previously leaked a
      +        bare ``NameError: name 'StdioServerParameters' is not defined``. The
      +        gate now raises a clear ``ImportError`` with install instructions,
      +        mirroring ``_run_http``'s behaviour when the HTTP transport is
      +        unavailable.
      +        """
      +        from tools.mcp_tool import MCPServerTask
      +
      +        server = MCPServerTask("local")
      +        config = {"command": "python3", "args": ["/tmp/echo.py"]}
      +
      +        async def _test():
      +            with patch("tools.mcp_tool._MCP_AVAILABLE", False):
      +                with pytest.raises(ImportError, match=r"mcp.*SDK"):
      +                    await server._run_stdio(config)
      +
      +        asyncio.run(_test())
      +
           def test_http_seeds_initial_protocol_header(self):
               from tools.mcp_tool import LATEST_PROTOCOL_VERSION, MCPServerTask
       
    • tools/mcp_tool.py
      @@ -1255,6 +1255,15 @@ async def _wait_for_lifecycle_event(self) -> str:
       
           async def _run_stdio(self, config: dict):
               """Run the server using stdio transport."""
      +        if not _MCP_AVAILABLE:
      +            raise ImportError(
      +                f"MCP server '{self.name}' requires the 'mcp' Python SDK, but "
      +                "it is not installed. Install with:\n"
      +                "  pip install 'hermes-agent[mcp]'\n"
      +                "or (full install):\n"
      +                "  pip install 'hermes-agent[all]'"
      +            )
      +
               command = config.get("command")
               args = config.get("args", [])
               user_env = config.get("env")

2 PRs closed without merging

From the close comments: superseded by another PR 2

  • #30907 fix(mcp): raise clear ImportError in _run_stdio when SDK unavailable · superseded by another PR → 5acaeba, #31450, #30904
  • #34245 fix(mcp): fail fast with actionable error when mcp SDK missing (#34220) · superseded by another PR → #105586
Closed issues · 2
  • Closed#30904MCP stdio client raises NameError: name 'StdioServerParameters' is not defined (v0.14.0)
  • Closed#34220mcp add / mcp test raise NameError when mcp package not installed
How this cluster was grouped
  • Link evidence (partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
  • Members outside that structural core may belong to a different underlying problem.
  • Pairwise link density 0.20: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
hermes cli
Merged PRs
#31450
Closed issues
2
Attempts
2 PRs closed without merging
Fix link checked
24 May 2026

For your agent

The same facts, typed.