You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #80. Layer 1 (packaging) merged in #81 — mcp_serve.py now ships in the wheel. Layer 2 closes the runtime gap: even with mcp_serve packaged, no auto-start path exists for a worker to actually consume its tools.
Current state (operator-side, undocumented)
For a worker to access G2/G3/G4 MCP tools today:
Operator manually runs hermes mcp serve & in background
Operator manually writes ~/.hermes/profiles/<profile>/.mcp.json referencing that server's transport
Worker session's MCP client connects on boot
None of this auto-happens. Polynomial-explorer worker boots with zero MCP tools accessible. The G2/G3/G4 plugin loads (post-#79 register fix) and the MCP tools are registered server-side (post-#81 packaging fix) — but no server is running + no .mcp.json points at one, so the worker MCP client has nothing to connect to.
Proposed fix (stdio transport, zero operator config)
MCP supports stdio transport where the client spawns the server as a subprocess + talks via stdin/stdout. No port allocation, no lifecycle daemon, no orphaned processes — when the worker exits, the subprocess exits.
Concrete plan:
Verify mcp_serve.run_mcp_server supports --transport stdio (FastMCP default; should already work — confirm in the impl).
Add stdio invocation entry: a top-level python -m mcp_serve command (or hermes mcp serve --stdio) that runs the server in stdio mode and exits cleanly when stdin closes.
Auto-write .mcp.json at session boot in agent_init.py (or equivalent init hook):
Use the same HERMES_HOME / .mcp.json pattern as existing MCP client config.
Idempotent: skip rewrite if the entry already exists.
Worker MCP client picks it up at boot (existing behavior of tools/mcp_tool.py).
Acceptance
Fresh worker session with no operator-side .mcp.json writes one auto-referencing local mcp_serve via stdio.
Worker hermes mcp status (or equivalent) shows hermes-internal connected.
Worker can invoke G2/G3/G4 tools (e.g. grafted_context_fetch) without operator config.
Existing .mcp.json files with other servers are NOT clobbered — entries merge.
Disable knob (env var HERMES_DISABLE_INTERNAL_MCP=1) for operators who want a different MCP server topology.
Why this is the right shape
stdio removes port-allocation + daemon-lifecycle complexity. Subprocess dies with the worker; no orphans.
Auto-detect from loaded plugins means new MCP-only plugins shipped later (G2b/G2c/G2d / G4 extensions) auto-surface without operator changes.
Merge-don't-clobber preserves existing MCP server config (Linear, Notion, etc. that operators may already have).
Disable knob for operators with custom MCP server topology.
Out of scope
Sidecar HTTP/SSE transport for mcp_serve (heavier; needs port management + auth on the localhost surface). Future enhancement; stdio covers 100% of single-session worker use cases.
Restart-on-crash for the spawned subprocess (worker session itself will detect MCP disconnection + retry via existing MCP client logic).
Severity
Final piece of the post-G1-G4 deploy chain. After this lands + container rebuild + worker spawn, polynomial-explorer should have full tool access end-to-end with zero operator wiring.
Follow-up to #80. Layer 1 (packaging) merged in #81 —
mcp_serve.pynow ships in the wheel. Layer 2 closes the runtime gap: even with mcp_serve packaged, no auto-start path exists for a worker to actually consume its tools.Current state (operator-side, undocumented)
For a worker to access G2/G3/G4 MCP tools today:
hermes mcp serve &in background~/.hermes/profiles/<profile>/.mcp.jsonreferencing that server's transportNone of this auto-happens. Polynomial-explorer worker boots with zero MCP tools accessible. The G2/G3/G4 plugin loads (post-#79 register fix) and the MCP tools are registered server-side (post-#81 packaging fix) — but no server is running + no .mcp.json points at one, so the worker MCP client has nothing to connect to.
Proposed fix (stdio transport, zero operator config)
MCP supports stdio transport where the client spawns the server as a subprocess + talks via stdin/stdout. No port allocation, no lifecycle daemon, no orphaned processes — when the worker exits, the subprocess exits.
Concrete plan:
mcp_serve.run_mcp_serversupports--transport stdio(FastMCP default; should already work — confirm in the impl).python -m mcp_servecommand (orhermes mcp serve --stdio) that runs the server in stdio mode and exits cleanly when stdin closes..mcp.jsonat session boot inagent_init.py(or equivalent init hook):devagentic-mutations,hermes-github,devagentic-lane-hplugins are loaded post-fix(plugins): add register(ctx) to G1/G2/G3/G4 — loader was silently skipping (closes #78) #79)..mcp.jsondoesn't already reference ahermes-internalserver: write/merge an entry like:{ "servers": [ { "name": "hermes-internal", "command": "python", "args": ["-m", "mcp_serve", "--stdio"] } ] }HERMES_HOME / .mcp.jsonpattern as existing MCP client config.tools/mcp_tool.py).Acceptance
.mcp.jsonwrites one auto-referencing local mcp_serve via stdio.hermes mcp status(or equivalent) showshermes-internalconnected.grafted_context_fetch) without operator config..mcp.jsonfiles with other servers are NOT clobbered — entries merge.HERMES_DISABLE_INTERNAL_MCP=1) for operators who want a different MCP server topology.Why this is the right shape
Out of scope
Severity
Final piece of the post-G1-G4 deploy chain. After this lands + container rebuild + worker spawn, polynomial-explorer should have full tool access end-to-end with zero operator wiring.