Skip to content

v2.25.0 — Parallel-Safe Instance Routing

Choose a tag to compare

@jcornill jcornill released this 12 Mar 11:47

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 optional port parameter 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 port parameter is automatically injected into every unity_* tool schema (except unity_list_instances, unity_select_instance, and unity_hub_*) in the ListTools handler, so AI assistants see it as a legitimate parameter and pass it consistently.

  • Enhanced unity_select_instance response — Now returns explicit routing instructions telling the AI to include port in all subsequent calls for parallel safety.

Files changed

  • src/index.js — CallTool middleware (port extraction, override, cleanup) + ListTools schema injection
  • src/instance-discovery.jssetPortOverride() / clearPortOverride() / updated getActiveBridgeUrl()
  • 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.