Skip to content

v1.4.0

Choose a tag to compare

@st-VALVe st-VALVe released this 19 May 14:08
· 3 commits to main since this release

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_tests when a scene was unintentionally dirtied — e.g. an [ExecuteAlways] MonoBehaviour spawning children after a domain reload. Optional scope parameter (loaded default, active alt). Refuses with cannot_discard_unsaved_scene if any loaded scene has no asset path. — d4d0241
  • save_open_scenes — save every dirty open scene to disk silently. No parameters. Refuses with cannot_save_unsaved_scene if 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. Both EditorSceneManager.OpenScene and RestoreSceneManagerSetup prompt on dirty scenes despite documentation suggesting otherwise — empirically verified. The service now clears the dirty flag via reflection on internal EditorSceneManager.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 use every ~5s indefinitely. McpUnityServer.StartServer now does a TcpListener bind-probe (with ExclusiveAddressUse=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.ts and Editor/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.ServerVersion const caught up from 1.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 16 DirtyScenePreflightServiceTests after the ClearSceneDirtiness refactor.
  • 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_scenes paths. 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 in OnEnable. 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",

Full changelog

v1.3.1...v1.4.0