Motivation
Iterating on a plugin that is installed and in active use in real hosts (Claude Code, Codex, Cursor) currently requires: agent-bundle build → copy/reinstall artifact per host → restart the host or start a new session so the stdio MCP server respawns. Every cycle kills open MCP connections and loses host-side session state. What we want is the webpack-HMR analog: the host's connection stays open while the plugin's code hot-swaps behind it.
What exists today (verified on agent-bundle dev, cargo-conductor project, 2026-09-01)
agent-bundle dev serves the loopback workbench and (with AGENT_BUNDLE_AGENT_API_TOKEN + --agent-api) an authenticated /mcp endpoint — but that endpoint exposes the workbench's control tools (project_status, skills_list, skill_inspect, …), not the developed plugin's own MCP tools, so a host cannot attach to a live dev instance of the plugin.
- The dev server does not watch source: editing a file under
src/ does not advance activeEpoch / projectRevision in project_status output (verified by polling before/after an edit).
- Host installs consume a built artifact (stdio MCP + copied skills/mcp-apps), so there is no live link back to the project at all.
The epoch model (activeEpoch, epoch-scoped workbench tools) looks like it was built for exactly this — the missing pieces are the file-watch rebuild and a host-facing stable endpoint that swaps epochs without dropping connections.
Proposed design
- Watch mode:
agent-bundle dev --watch rebuilds a new epoch on source change (debounced), keeping the last-good epoch active when the build fails (diagnostics surface in the workbench, never a dead server).
- Host dev proxy:
agent-bundle dev --install-host <claude|codex|cursor> installs a thin, stable stdio proxy as the plugin's MCP server in the host. The proxy connects to the dev server and forwards the plugin's MCP surface. On epoch swap the proxy keeps the host pipe open, re-resolves tools against the new epoch, and emits notifications/tools/list_changed (the server already advertises tools.listChanged: true) — the host never sees a disconnect.
- Hooks: generated hook commands in the host point at the dev proxy too; since hooks are spawned per event they pick up the new epoch naturally on the next event.
- Skills / mcp-apps: re-sync copied assets on epoch swap for hosts that read them from disk (Cursor), or serve them through the proxy where the host supports it.
- Session semantics: in-flight tool calls run to completion against the epoch they started on; new calls bind to the active epoch (same rule webpack uses for module disposal).
Why the proxy indirection
Hosts spawn stdio MCP servers themselves and cache the connection per session; only a process that outlives rebuilds can keep that connection stable. A ~zero-dependency proxy binary whose behavior never changes is the smallest thing a host can hold onto while everything behind it stays fluid.
Environment
agent-bundle dev workbench serving /fast/projects/agent-plugins/cargo-conductor, Node 22.23.1, Linux.
Motivation
Iterating on a plugin that is installed and in active use in real hosts (Claude Code, Codex, Cursor) currently requires:
agent-bundle build→ copy/reinstall artifact per host → restart the host or start a new session so the stdio MCP server respawns. Every cycle kills open MCP connections and loses host-side session state. What we want is the webpack-HMR analog: the host's connection stays open while the plugin's code hot-swaps behind it.What exists today (verified on agent-bundle dev, cargo-conductor project, 2026-09-01)
agent-bundle devserves the loopback workbench and (withAGENT_BUNDLE_AGENT_API_TOKEN+--agent-api) an authenticated/mcpendpoint — but that endpoint exposes the workbench's control tools (project_status,skills_list,skill_inspect, …), not the developed plugin's own MCP tools, so a host cannot attach to a live dev instance of the plugin.src/does not advanceactiveEpoch/projectRevisioninproject_statusoutput (verified by polling before/after an edit).The epoch model (
activeEpoch, epoch-scoped workbench tools) looks like it was built for exactly this — the missing pieces are the file-watch rebuild and a host-facing stable endpoint that swaps epochs without dropping connections.Proposed design
agent-bundle dev --watchrebuilds a new epoch on source change (debounced), keeping the last-good epoch active when the build fails (diagnostics surface in the workbench, never a dead server).agent-bundle dev --install-host <claude|codex|cursor>installs a thin, stable stdio proxy as the plugin's MCP server in the host. The proxy connects to the dev server and forwards the plugin's MCP surface. On epoch swap the proxy keeps the host pipe open, re-resolves tools against the new epoch, and emitsnotifications/tools/list_changed(the server already advertisestools.listChanged: true) — the host never sees a disconnect.Why the proxy indirection
Hosts spawn stdio MCP servers themselves and cache the connection per session; only a process that outlives rebuilds can keep that connection stable. A ~zero-dependency proxy binary whose behavior never changes is the smallest thing a host can hold onto while everything behind it stays fluid.
Environment
agent-bundle dev workbench serving
/fast/projects/agent-plugins/cargo-conductor, Node 22.23.1, Linux.