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
{{ message }}
Repository navigation
[Request] Add explicit Unity port/URL targeting for stdio mode #697
When using mcp-for-unity in --transport stdio mode with multiple Unity Editor instances, there is currently no explicit way to pin the backend to a specific Unity endpoint by port or URL.
This makes routing ambiguous in multi-instance setups and can lead to repeated reconnect loops and lingering Python/MCP processes consuming CPU.
Current behavior
mcp-for-unity supports:
--transport stdio|http
--http-url / --http-port (HTTP transport only)
--default-instance (instance selection)
It does not support explicit Unity endpoint targeting (e.g. --unity-port or --unity-url) when using stdio.
Problem
In real workflows with two or more Unity projects/editors running simultaneously (each with different Unity MCP ports), users often need deterministic routing from one CLI session to one editor.
Instance naming / hash targeting helps, but explicit port/URL pinning would be:
simpler to reason about,
easier to automate in scripts and configs,
less error-prone in multi-instance environments.
Requested feature
Add explicit Unity endpoint targeting flags and environment variables, for example:
Thanks for filing this @gravitydeepimpactsun! This has been addressed in #772, which takes a slightly different approach than the original CLI flags — instead of requiring --unity-port / --unity-url at startup, you can now pass unity_instance as a parameter on any individual tool call to route it to a specific instance:
# Route by port (stdio only)manage_scene(action="get_active", unity_instance="6402")
# Route by hash prefixmanage_scene(action="get_active", unity_instance="abc")
# Route by full Name@hashmanage_scene(action="get_active", unity_instance="MyGame@abc123")
set_active_instance also now accepts port numbers for session pinning.
Activity
Add per-call unity_instance routing via middleware argument interception
Add per-call unity_instance routing via middleware argument interception
Add per-call unity_instance routing via middleware argument interception
Add per-call unity_instance routing via middleware argument intercept…
dsarno commentedon Feb 18, 2026
Thanks for filing this @gravitydeepimpactsun! This has been addressed in #772, which takes a slightly different approach than the original CLI flags — instead of requiring --unity-port / --unity-url at startup, you can now pass unity_instance as a parameter on any individual tool call to route it to a specific instance:
set_active_instance also now accepts port numbers for session pinning.
This is merged into the beta branch. If you'd like to try it now, you can point your Unity Package Manager at:
https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#beta
Add per-call unity_instance routing via middleware argument intercept…
Add per-call unity_instance routing via middleware argument intercept…