hermes - 💡(How to fix) Fix [Bug]: `hermes mcp serve` crashes with ModuleNotFoundError: No module named 'mcp_serve' on standard pip install

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Error Message

$ 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).

Fix Action

Fix / Workaround

Happy to test a patch.

Code Example

$ 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

---

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

---

if action == "picker":
       from hermes_cli.mcp_picker import run_picker
RAW_BUFFERClick to expand / collapse

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

  • hermes-agent 0.15.0 (pip-installed into a venv)
  • Python 3.14
  • Linux — not NixOS, so distinct from #22110

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: `hermes mcp serve` crashes with ModuleNotFoundError: No module named 'mcp_serve' on standard pip install