v2.25.0 — Parallel-Safe Instance Routing
Parallel-Safe Instance Routing for Multi-Agent Workflows
When multiple AI agents (e.g. Claude Cowork tasks) share the same MCP stdio process, unity_select_instance calls could overwrite each other's routing state, causing one agent's commands to be sent to the wrong Unity Editor.
What's new
-
Per-request port override — Each
unity_*tool call can now include an optionalportparameter that bypasses shared state entirely. The port is extracted by middleware before the tool handler runs, used for routing, then cleaned from the args. Safe because MCP stdio transport processes requests sequentially. -
Dynamic schema injection — The
portparameter is automatically injected into everyunity_*tool schema (exceptunity_list_instances,unity_select_instance, andunity_hub_*) in the ListTools handler, so AI assistants see it as a legitimate parameter and pass it consistently. -
Enhanced
unity_select_instanceresponse — Now returns explicit routing instructions telling the AI to includeportin all subsequent calls for parallel safety.
Files changed
src/index.js— CallTool middleware (port extraction, override, cleanup) + ListTools schema injectionsrc/instance-discovery.js—setPortOverride()/clearPortOverride()/ updatedgetActiveBridgeUrl()src/tools/instance-tools.js— Enhanced select_instance description and response
No plugin update required
This is a server-side change only. The Unity Editor plugin does not need to be updated.