Skip to content

Unity Code MCP Server 0.5

Latest

Choose a tag to compare

@machinedawn machinedawn released this 10 Jul 09:58

Unity Code MCP Server 0.5 Release Changes

TL;DR

  • UniTask is no longer required, making installation and upgrades simpler.
  • play_unity_game now delivers more reliable simulated input when Unity is unfocused or regains focus.
  • Tool execution is more robust through main-thread-safe async handling and Unity-supported JSON dependencies.

✨ What's New for You?

The 0.5 release focuses on a leaner setup and more dependable automation, especially for agents that test gameplay while working outside the Unity window.

  • One less package to install: UniTask has been removed from the package and from the setup flow. Unity Code MCP Server now uses a focused built-in async layer based on standard .NET tasks.
  • Input that keeps working in the background: play_unity_game now handles focus changes, re-enables affected input devices, and temporarily applies the runtime settings needed for reliable simulated actions.
  • Cleaner gameplay runs: Each run safely unpauses the Editor, clears stale device state, releases simulated inputs, and restores the previous pause and input settings afterward.
  • More predictable Editor execution: MCP tools are marshalled onto Unity's main thread, reducing threading-related failures during scene, asset, test, and Play Mode operations.
  • Better package compatibility: JSON handling now uses Unity's Newtonsoft Json package instead of bundled System.Text.Json assemblies, reducing assembly conflicts in host projects.

⚠️ Breaking Changes & Migration

Most users can upgrade directly; the required Unity packages are installed automatically. Custom MCP tool authors need to update their implementations.

  • Remove manual UniTask setup: UniTask is no longer a requirement. You may remove it if no other package or project code depends on it.
  • Async tool API changed: IToolAsync.ExecuteAsync now returns Task<ToolsCallResult> instead of UniTask<ToolsCallResult>.
  • JSON API changed: Tool schemas and arguments now use Newtonsoft JToken instead of System.Text.Json.JsonElement. Update custom tools to import Newtonsoft.Json.Linq and use the current README examples.
  • Dependencies are package-managed: Unity Input System 1.19.0 and Newtonsoft Json 3.2.2 are declared by the package. Existing projects should let Unity resolve them during the upgrade.

🚀 Key Improvements

🎮 Gameplay automation

  • Focus-resilient simulated input: Press and hold actions remain reliable after Unity loses focus or cycles between focused and unfocused states.
  • Safer state restoration: Temporary changes to Application.runInBackground, Input System background behavior, Game View input routing, Editor pause state, and time scale are cleaned up after every run.
  • No stuck controls between calls: Input devices and queued actions are reset and released so previous gameplay commands do not leak into later runs.
  • Stronger regression coverage: Expanded Play Mode tests cover repeated input, focus changes, presses, holds, and state cleanup.

⚙️ Runtime and compatibility

  • Built-in Editor async support: A small task-based layer now handles Editor updates, real-time delays, cancellation, exceptions, coroutines, and main-thread dispatch without UniTask.
  • Unity-native JSON dependency: MCP requests, responses, schemas, prompts, resources, and tool arguments now use Newtonsoft Json supplied through Unity Package Manager.
  • Cleaner package imports: Bundled skills now live under Skills~, preventing Unity from unnecessarily importing and compiling their support files.

🤖 Agent experience

  • Sharper tool contracts: Guidance for C# execution and gameplay simulation is shorter, clearer, and better aligned with each tool's actual responsibilities.
  • Updated bundled skills: Script-execution and gameplay skills document the new contracts and more reliable Play Mode workflow.
  • More accurate setup examples: README configuration and custom-tool samples now reflect the 0.5 APIs, with additional MCPorter CLI examples for direct tool calls.