hermes-agent/website/docs/user-guide/features
Teknium 11310068c6 feat(plugins): pre_command observer hook + capability-gated ctx.call_mcp (#64204)
Part A — pre_command observer hook (observer-first per #64182 ground rule 3):
- New VALID_HOOKS event `pre_command`: fires when a recognized slash command
  is about to be dispatched, BEFORE the handler runs, on both surfaces:
  - CLI: cli.py process_command (right after alias resolution)
  - Gateway: gateway/run.py _handle_message cold-path canonical dispatch
- Payload: surface ('cli'|'gateway'), command (canonical), alias_used,
  args_raw, session_key, platform. Return values IGNORED in v1; a plugin
  returning a directive-shaped dict gets a debug log so future
  block/rewrite adopters are discoverable (#64231 taxonomy).
- Deliberately NOT fired on the gateway running-agent intercept path
  (/stop, /approve, busy_policy dispatch during an active run): those are
  control-plane escape hatches on an in-flight run and must stay outside
  plugin observation/veto reach.
- fire_pre_command_hook() helper never raises, so broken plugin infra can
  never break command dispatch.

Part B — ctx.call_mcp (capability-gated, default-off, ground rule 4):
- PluginContext.call_mcp(server, tool, arguments, timeout=30): synchronous,
  callable from plugin hooks/tools, routes through the EXISTING native MCP
  client machinery (tools.mcp_tool._make_tool_handler: background loop,
  trust-tier gates, circuit breaker, reconnect) — never a parallel client.
- Gate: plugins.entries.<id>.mcp_allowlist (list of server names).
  Absent key / unreadable config / non-list value => default-deny.
  Unlisted server raises PermissionError naming the exact config key.
  TODO seam left for the #64228 declared-capability model.
- Bounded: timeout clamped to 1-600s and forwarded to the MCP loop call;
  results capped at 64KB with truncation marker; stable
  {ok, result|error, structuredContent?, truncated?} envelope.

Tests (transport mocked, no live MCP servers):
- tests/hermes_cli/test_pre_command_hook.py: both surfaces fire, canonical
  alias reporting (/exit->quit, /q->queue), hook-before-handler ordering,
  control-plane exclusion, hook failure non-fatal, observer-only directive
  handling.
- tests/hermes_cli/test_plugin_call_mcp.py: default-deny (absent entry,
  unreadable config, non-list, '*'), allowlist enforced per-server,
  denied calls never touch transport, timeout forwarding/clamping,
  result truncation, error/structuredContent envelopes.

Docs: hooks.md shipped-catalog row for pre_command; plugins.md
"Calling MCP servers from plugins" section with the security note.

Closes #64204
2026-08-12 19:16:59 -07:00
..
_category_.json
…
acp.md feat(runtime)!: require Node 26 across all installers, heal, and upgrade paths 2026-08-01 21:17:51 -04:00
api-server.md fix(api-server): mark replayed tool calls completed in Responses output items 2026-08-08 05:22:02 -07:00
batch-processing.md
…
browser.md fix: correct Lightpanda fallback docs — remove nonexistent PDF/upload/clipboard actions 2026-08-12 20:19:26 +05:30
built-in-plugins.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
code-execution.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
codex-app-server-runtime.md
…
computer-use.md feat(computer_use): align cua-driver 0.10 permission modes 2026-07-29 12:19:37 -07:00
context-files.md Port from superagent-ai/grok-cli: directory-chain AGENTS.md loading 2026-08-08 04:31:45 -07:00
context-references.md
…
credential-pools.md docs: teach providers: dict as the canonical custom-provider format 2026-07-29 09:44:59 -07:00
cron.md feat(cron): pre-dispatch configuration validation (blocked_config + alert-once) 2026-08-07 08:57:53 -07:00
curator.md docs: sync overnight sweep with registry, gateway, curator, cron 2026-07-29 09:45:11 -07:00
delegation.md docs(delegation): document frontier-planner / inexpensive-worker cost split 2026-08-10 10:56:04 -07:00
deliverable-mode.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
document-extraction.md feat(read_extract): label each unreadable PDF gap with its preceding section text 2026-08-08 05:51:33 -07:00
extending-the-dashboard.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
fallback-providers.md feat: reset-aware primary restore — stay on fallback until the rate-limit window resets 2026-08-03 19:02:12 +05:30
goals.md feat(goals): quality gates — deterministic commands that must pass before /goal completes 2026-08-05 22:32:39 -07:00
heartbeat.md feat: /heartbeat — recurring session re-entry prompt fired when idle 2026-08-05 22:32:55 -07:00
honcho.md
…
hooks.md feat(plugins): pre_command observer hook + capability-gated ctx.call_mcp (#64204) 2026-08-12 19:16:59 -07:00
image-generation.md feat(media): default-on upscaling for sub-2MP image models (FAL + Krea) 2026-08-08 14:49:28 -07:00
kanban-tutorial.md fix(kanban): isolate review handoff ownership 2026-08-10 12:43:46 -07:00
kanban-worker-lanes.md fix(kanban): clarify downstream review inspection 2026-08-10 12:43:46 -07:00
kanban.md feat(kanban): teach workers to flag collision hotspots instead of piling on 2026-08-10 13:11:19 -07:00
lsp.md fix(lsp): expose lsp.idle_timeout in config, harden reaper, log reaps 2026-07-29 17:11:30 +05:30
mcp.md Inspired by Cursor: MCP config context variables (${userHome}, ${workspaceFolder}, ...) 2026-08-08 03:57:00 -07:00
memory-providers.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
memory.md docs: warn against pointing two agents at one Hermes home (memory, profiles, FAQ) 2026-08-05 21:33:44 +05:30
mixture-of-agents.md feat(moa): default advisor fanout to user_turn — the cheapest cadence 2026-07-23 21:07:18 -07:00
overview.md fix(wake-word): enforce single-owner lifecycle 2026-07-28 07:58:01 -07:00
personality.md fix(personality): single-owner personality state + one-time reset migration 2026-08-09 10:33:58 -07:00
pets.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
plugins.md feat(plugins): pre_command observer hook + capability-gated ctx.call_mcp (#64204) 2026-08-12 19:16:59 -07:00
provider-routing.md
…
skills.md feat(/learn): expansive knowledge-base skills for books and large corpora 2026-08-06 22:14:52 -07:00
skins.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
spotify.md
…
subscription-proxy.md
…
tool-gateway.md
…
tool-search.md perf(tools): shrink lazy tool catalog overhead 2026-08-03 19:11:30 +05:30
tools.md docs: DX sweep — 7 verified-absent documentation items 2026-08-07 08:58:08 -07:00
tts.md fix(tts): split long speech by provider and platform limits 2026-08-08 22:54:20 +05:30
vision.md
…
voice-mode.md fix(voice): full-duplex agent-turn listener — interrupt by voice during generation AND playback 2026-07-29 10:08:53 -07:00
wake-word.md feat(wake): client-capture wake word for remote desktop 2026-08-05 10:03:48 -06:00
web-dashboard.md fix(sessions): prevent oversized transcripts from exhausting memory 2026-08-08 13:36:08 +05:30
web-search.md docs: accuracy sweep + coverage for 2 months of shipped features 2026-07-29 08:48:05 -07:00
x-search.md docs(xai): clarify x_search vs xurl routing without schema cross-refs 2026-07-23 21:06:47 -07:00