Repository navigation
v1.4.0
First release after the upstream-1.3.0 baseline that adds standalone dirty-scene tools and meaningfully reduces native Unity modal interference in MCP workflows.
New tools
discard_open_scene_changes— reload dirty open scenes from disk silently (no Scene(s) Have Been Modified modal). Useful before quit / scene switch /run_testswhen a scene was unintentionally dirtied — e.g. an[ExecuteAlways]MonoBehaviour spawning children after a domain reload. Optionalscopeparameter (loadeddefault,activealt). Refuses withcannot_discard_unsaved_sceneif any loaded scene has no asset path. — d4d0241save_open_scenes— save every dirty open scene to disk silently. No parameters. Refuses withcannot_save_unsaved_sceneif any dirty scene has no asset path. — d4d0241
Both wrap the same DirtyScenePreflightService already used by run_tests / enter_play_mode preflight, so error contracts (dirty_scene_preflight_refused, cannot_*_unsaved_scene) and the preflight payload are identical across all four entry points.
Bug fixes
-
dirtyScenePolicy='discard'no longer raises the native save-changes modal on Unity 6.2. BothEditorSceneManager.OpenSceneandRestoreSceneManagerSetupprompt on dirty scenes despite documentation suggesting otherwise — empirically verified. The service now clears the dirty flag via reflection on internalEditorSceneManager.ClearSceneDirtiness(Scene)before the reload call. Wrapped in try/catch so a future Unity API rename degrades gracefully to the prompting fallback rather than crashing the preflight. — 7d1d73a -
Supervisor restart spam eliminated when two Unity Editors are open. Previously the editor that lost the race for port 8090 logged
Supervisor detected server is down+Port 8090 is already in useevery ~5s indefinitely.McpUnityServer.StartServernow does aTcpListenerbind-probe (withExclusiveAddressUse=true) before constructing the WebSocketServer, and the supervisor skips restart attempts entirely while the port is occupied. State-transition logging only: single warning on entering blocked state, single info when the port becomes free. — cd9a220
Internal / docs
- AGENTS.md release checklist extended to include
Server~/src/index.tsandEditor/UnityBridge/McpUnitySettings.cs— both surface the version string (to MCP clients and to the Editor's Server Window respectively) and were being missed in prior releases. McpUnitySettings.ServerVersionconst caught up from1.2.0(last bumped in v1.2.0; missed in v1.3.0 and v1.3.1).
Verification
- TypeScript build clean, Jest 185/185 passing (16 suites, includes 9 new tests for the two new MCP tool wrappers).
- Unity 6.2 EditMode tests 156/156 passing: 151 prior baseline + 5 new port-probe (
McpUnityServerPortProbeTests). Includes regression coverage on the existing 16DirtyScenePreflightServiceTestsafter theClearSceneDirtinessrefactor. - End-to-end MCP → Node → WebSocket → Unity smoke verified on both new tools.
Known limitations
- The reflection-based modal suppression only covers the initial reload in
discard/save_open_scenespaths. Downstream Unity-internal operations (TestRunner harness-scene swap, Play Mode entry, editor quit) can still raise the modal if a scene re-dirties immediately after reload — e.g. when an[ExecuteAlways]MonoBehaviour mutates the hierarchy inOnEnable. Tracked in #5 as a modal-watchdog follow-up that does not block this release.
Consumer pin update
- "com.gamelovers.mcp-unity": "https://github.com/st-VALVe/mcp-unity.git#v1.3.1",
+ "com.gamelovers.mcp-unity": "https://github.com/st-VALVe/mcp-unity.git#v1.4.0",