Skip to content

[Bug]: hermes mcp serve crashes with ModuleNotFoundError: No module named 'mcp_serve' on standard pip install #34871

Closed

Description

@therealronin23

Summary

hermes mcp serve fails immediately on a standard pip-installed venv because hermes_cli/mcp_config.py imports a top-level module mcp_serve that is not shipped in the hermes-agent wheel.

Environment

Repro

$ hermes mcp serve
...
  File ".../hermes_cli/mcp_config.py", line 748, in mcp_command
    from mcp_serve import run_mcp_server
ModuleNotFoundError: No module named 'mcp_serve'

$ python -c "import mcp_serve"
ModuleNotFoundError: No module named 'mcp_serve'

$ ls site-packages/ | grep mcp_serve   # nothing

Root cause

hermes_cli/mcp_config.py:748:

if action == "serve":
    from mcp_serve import run_mcp_server   # <-- bare top-level import
    run_mcp_server(verbose=getattr(args, "verbose", False))
    return

mcp_serve is a top-level module name that is not packaged/installed, so the import always raises on a normal install. This looks like exactly the class of problem tracked by the packaging restructure in #14590 (top-level modules → hermes_agent/...): the module either needs to be included in the wheel or the import needs to be namespaced (e.g. from hermes_agent.mcp_serve import run_mcp_server, mirroring the lazy hermes_cli.mcp_picker imports a few lines below).

Suggested fix

Either:

  1. Ship mcp_serve in the package (add to packages/py-modules), or
  2. Move it under the package and namespace the import, consistent with the sibling subcommands:
    if action == "picker":
        from hermes_cli.mcp_picker import run_picker

Happy to test a patch.

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/cliCLI entry point, hermes_cli/, setup wizard
    tool/mcpMCP client and OAuth
    on May 29, 2026
  2. alt-glitch commented on May 29, 2026

    @alt-glitch

    Duplicate of #22110 — same root cause (mcp_serve module not included in the wheel). Fix PR #22148 is open and addresses this for all install methods, not just NixOS.

  3. added a commit that references this issue on May 30, 2026
    a57cc00
  4. teknium1 commented on May 30, 2026

    @teknium1
    Collaborator

    Note: pip-installing hermes-agent isn't a recommended or supported install path — use the official installer (install.sh / install.ps1) or hermes update. That said, the packaging gap is real and worth closing: mcp_serve is a top-level module that wasn't listed in py-modules, so it never shipped in the wheel. Fixed in PR #35044 (also reported in #22148). Thanks for the clear root-cause writeup.

  5. added a commit that references this issue on May 31, 2026
    b68f7bb
  6. added a commit that references this issue on Jun 8, 2026
    c111b5d
  7. added a commit that references this issue on Jun 14, 2026
    c9b3b25
  8. added a commit that references this issue on Jun 18, 2026
    c40739c
  9. added a commit that references this issue on Jun 25, 2026
    6b218cf
  10. added a commit that references this issue on Jul 2, 2026
    016559b
  11. added a commit that references this issue on Jul 13, 2026
    f39f9b1
  12. added a commit that references this issue on Jul 13, 2026
    20cf4db
  13. added a commit that references this issue on Jul 21, 2026
    6588772
  14. added a commit that references this issue on Aug 7, 2026
    6af78fe
  15. added a commit that references this issue on Sep 3, 2026
    b771a27
  16. added a commit that references this issue on Oct 6, 2026
    63c182b
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

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtool/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