fix(mcp): include mcp_serve module in built wheel#22148
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a packaging issue where hermes mcp serve fails in non-editable installs because the top-level mcp_serve.py module was not included in the built wheel.
Changes:
- Add
mcp_serveto[tool.setuptools].py-modulesso it’s included in wheel builds.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e3a11b7 to
4ba8d56
Compare
|
CI audit — 3 of 4 failing checks on this PR are pre-existing baselines on clean
This PR only adds |
4ba8d56 to
d2b94a2
Compare
d2b94a2 to
51a0337
Compare
austinpickett
left a comment
There was a problem hiding this comment.
Please use .github/PULL_REQUEST_TEMPLATE.md
|
@austinpickett thanks for the flag — updated the PR body to follow |
f3bd35c to
9eaa382
Compare
The `mcp_serve` top-level module was missing from the `py-modules` list in pyproject.toml, so non-editable installs (e.g. NixOS, downstream packagers) omitted it from the built wheel. `hermes mcp serve` then crashed with `ModuleNotFoundError: No module named 'mcp_serve'` because hermes_cli/mcp_config.py imports it via `from mcp_serve import run_mcp_server`. Editable installs (`pip install -e .`) sidestep this because they add the repo root to sys.path, which is why dev workflows never noticed. Same shape of fix as the previous packaging gap caught for `minisweagent_path` (PR NousResearch#2098). Fixes NousResearch#22110 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9eaa382 to
a9db2ee
Compare
|
Duplicate of #35044, which targets current main and merged cleanly (a57cc00). Your PR was submitted first and is the identical fix — credited in the merge discussion. Thanks @briandevans. |
What does this PR do?
hermes mcp servefails on NixOS and any other non-editable install withModuleNotFoundError: No module named 'mcp_serve'. Root cause: the top-levelmcp_serve.pymodule is not listed under[tool.setuptools] py-modulesinpyproject.toml, so it is omitted from the built wheel. This PR adds it.hermes_cli/mcp_config.py:749does a top-levelfrom mcp_serve import run_mcp_server.mcp_serve.pylives at the repo root and definesrun_mcp_serverat line 866. Setuptools' wheel build only includes top-level modules listed inpy-modules. Every other top-level module that production code imports (run_agent,cli,batch_runner,hermes_bootstrap, …) is in that list —mcp_servewas the lone omission. Editable installs (pip install -e .) are unaffected because the repo root is onsys.path, which is why dev and CI did not catch it.Related Issue
Fixes #22110
Type of Change
Changes Made
pyproject.toml— add"mcp_serve"to[tool.setuptools] py-modules. Same fix shape as PR fix: : minisweagent_path.py missing from wheel #2098 (minisweagent_path).How to Test
uv build --wheelunzip -l dist/hermes_agent-*.whl | grep mcp_serve.pytop_level.txtlists it:unzip -p dist/hermes_agent-*.whl hermes_agent-*.dist-info/top_level.txt | grep mcp_servehermes mcp serve— theModuleNotFoundErroris gone.Before/after of the wheel artifact:
Checklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/ARelated / Positioning
hermes mcp servefails to start on NixOS #22110.minisweagent_path) — top-level module omitted frompy-modules, broke in non-editable installs.Screenshots / Logs