refactor(cli): hermes mcp serve leaves core for the mcp-serve plugin by teknium1 · Pull Request #142556 · NousResearch/hermes-agent · GitHub
Skip to content

refactor(cli): hermes mcp serve leaves core for the mcp-serve plugin - #142556

Merged
teknium1 merged 1 commit into
mainfrom
leave-core/mcp-serve
Oct 22, 2026
Merged

teknium1 merged 1 commit into
mainfrom
leave-core/mcp-serve

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

hermes mcp serve (Hermes as an MCP server) leaves core for the official mcp-serve plugin, which registers hermes mcp-serve and adds the --tools mode from #83364. The old spelling now prints the new one plus the install line.

Changes

  • Deleted mcp_serve.py and tests/test_mcp_serve.py. The code and its 80 tests moved to hermes-official-plugins/mcp-serve.
  • hermes_cli/subcommands/mcp.py, hermes_cli/mcp_config.py: removed the serve subparser, its dispatcher branch and its usage line. Also dropped the --accept-hooks flag on hermes mcp, because no mcp subcommand runs hooks any more.
  • hermes_cli/main.py: removed the mcp row from _AGENT_SUBCOMMANDS, along with the synchronous inline MCP-discovery branch and _command_has_dedicated_mcp_startup. mcp serve was the only command that reached them; None/chat/rl use background discovery and acp/gateway/cron have their own.
  • hermes_cli/left_core_migration.py: new command + old_command fields and an mcp-serve row. moved_command_hint handles two cases:
    • hermes mcp serve (with any flags) exits 2 and prints on stderr, never on stdout (the MCP wire): Hermes as an MCP server moved out of core into the 'mcp-serve' plugin: `hermes mcp serve` is now `hermes mcp-serve`. Install it with: `hermes plugins install mcp-serve`. The install sentence is dropped when the plugin is already installed.
    • hermes mcp-serve without the plugin says it is not loaded and gives the install line.
  • hermes_cli/console_engine.py: removed the blocked ("mcp", "serve") pair.
  • Docs: the MCP feature page's server section is now a short pointer to the plugin (en + zh-Hans). Also updated: cli-commands.md, hooks.md, the bundled hermes-agent skill's cli-reference, plugins/AGENTS.md (the new row fields), and the t072 tip in all 17 locales (hermes mcp-serve).

Migration: hint only, no automatic install

MCP clients that run hermes mcp serve (Claude Desktop, Claude Code, Cursor) keep their config outside Hermes. No profile home records that the feature is in use, so the row's in_use is always False: hermes update and agent start never install the plugin. The first time a client launches the old command, its stderr log shows the new spelling and the install command. The user installs the plugin and changes the client's args to ["mcp-serve"]. The ten tool names and parameters are unchanged.

What stays in core, and why

  • agent/transports/hermes_tools_mcp_server.py stays. The codex_app_server runtime launches it as its hermes-tools MCP server: codex_runtime.py, codex_app_server*.py and codex_runtime_plugin_migration.py import HERMES_TOOLS_MCP_SERVER_NAME, and the migration writes python -m agent.transports.hermes_tools_mcp_server into ~/.codex/config.toml. It is runtime plumbing, not the user-facing serve command. The plugin's --tools keeps its own allowlist instead of importing it.
  • MCP client support (hermes mcp add/list/test/..., tools/mcp_tool*.py) stays: that is Hermes connecting to MCP servers.

Validation

Check Result
scripts/run_tests.sh on the 6 touched/affected files 140 passed
scripts/run_tests.sh on the 19 files referencing left-core / mcp parser / startup / console 317 passed, 2 skipped
New test_old_mcp_serve_spelling_names_the_plugin_command on base (left_core_migration.py + subcommands/mcp.py swapped to main) fails on base, passes here
python scripts/check 12 checks, ok
Live, fresh HERMES_HOME, no plugin: hermes mcp serve exit 2, stdout 0 bytes, stderr hint with install line
Live, plugin installed: hermes mcp serve exit 2, hint without install line
Live: hermes mcp-serve with no plugin exit 2, "not loaded. Install it with: hermes plugins install mcp-serve"
Live, plugin installed from file://…#mcp-serve on this branch, real MCP client over stdio initialize ok, 10 bridge tools, conversations_list/messages_read return the seeded conversation; --tools adds 5 available allowlisted tools, skills_list dispatches

Order

The plugin and its catalog entry have landed: NousResearch/hermes-official-plugins#133 (merge 6389dd08c1e4) and #142545 (plugin-catalog/mcp-serve.yaml, pinned to that commit). This PR goes last. The hint names the plugin by its catalog name, so it resolves now.

#83364 is closed with a pointer to the plugin: its --tools mode ships there, with the safety limits listed in the plugin's README.

Infographic

mcp serve leaves core

…plugin

`hermes mcp serve` (mcp_serve.py) moves to the official mcp-serve plugin in
hermes-official-plugins, which registers `hermes mcp-serve` and also carries
the `--tools` mode from #83364.

- delete mcp_serve.py and tests/test_mcp_serve.py (the suite moved with it)
- drop the serve subparser, its dispatcher branch, the mcp agent-subcommand
  row and the inline MCP discovery path only `mcp serve` reached
- LEFT_CORE row (command + old_command): `hermes mcp serve` and a bare
  `hermes mcp-serve` without the plugin print the new spelling and the
  install line on stderr. MCP clients live outside Hermes, so no home shows
  the feature in use and nothing installs automatically.
- docs, locale tips and the bundled cli-reference point at the plugin

agent/transports/hermes_tools_mcp_server.py stays: the codex_app_server
runtime launches it as its hermes-tools MCP server.
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 6835110 — refactor(mcp): Hermes as an MCP server leaves core for the m

debug info

CI timings

CI timings · View report · View job

Wall time 8m5s vs 7m55s (+2.1%). 10 job(s) slower, 9 faster,

  • OS-specific tests / Windows-only tests (arm64, 1/2): -65.0s
  • OS-specific tests / Windows-only tests: +59.0s
  • Docs Site / docs-site-checks: +57.0s
  • Python tests / Run tests (1/2): +40.0s
  • OS-specific tests / Windows-only tests (arm64, 2/2): -36.0s

@teknium1 teknium1 added the ci-reviewed applied to manually approve dangerous changes label Oct 21, 2026
@alt-glitch alt-glitch added area/i18n Localization, locales, translations comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/mcp MCP client and OAuth type/refactor Code restructuring, no behavior change labels Oct 21, 2026
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] Appears safe to merge; no actionable correctness or structural regressions were found.

Summary

Moves the user-facing MCP server out of core and points users to mcp-serve.

  • Hermes's conversation MCP server moves from core to the mcp-serve plugin.
  • The old mcp serve command points users to the plugin's new command.

Per teknium1, manual installation and editing the MCP client’s arguments are intentional because those settings live outside Hermes. The plugin and catalog entry ship separately.

git diff --check passed. Tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Old["hermes mcp serve"] --> Hint["Migration hint on stderr; exit 2"]
  New["hermes mcp-serve"] --> Plugin["Installed mcp-serve plugin"]
  Manage["hermes mcp add / list / test / ..."] --> Core["Core MCP client commands"]
Loading

Reviews (1) · Last reviewed commit: "refactor(mcp): Hermes as an MCP server l..." · Reviewed by Greptile

@teknium1
teknium1 merged commit e3a962d into main Oct 22, 2026
62 checks passed
@teknium1
teknium1 deleted the leave-core/mcp-serve branch October 22, 2026 00:06
@kshitijk4poor

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Localization, locales, translations ci-reviewed applied to manually approve dangerous changes comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/mcp MCP client and OAuth type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants