Available Now

Unity Code MCP Server

A direct bridge between your AI agent and Unity.

Created for long running AI agents that need to do real work in your Unity project, the Unity Code MCP Server gives your agent first-class access to the Unity Editor API.

Unity Code MCP Server project visibility inside the Unity Editor

Execute

Execute directly inside the Editor

Move from recommendation to action without leaving Unity. Agents can run C# in the Editor process to create objects, wire scenes, update assets, prepare test state, and automate the repetitive project work that usually slows iteration.

For runtime workflows, the same agent can enter Play Mode and drive real input actions instead of faking success by editing transforms directly.

  • Author and update scenes, prefabs, ScriptableObjects, import settings, and components.
  • Use Unity Editor APIs through generated C# with logs and return values captured.
  • Drive gameplay and UI through input actions when validation needs player-like behavior.
Unity Code MCP Server building directly in the Unity Editor

Verify

Verify with runtime feedback

Close the loop by checking what actually happened. The agent can run Edit Mode and Play Mode tests, enter Play Mode, use play_unity_game to emulate player input, read logs, capture Game View state, and inspect live runtime data after every action.

This turns AI-assisted development into a repeatable search / execute / verify cycle: find the state, act on it, measure the result, and continue until the scenario passes or the failure is clear.

  • Validate player movement, UI flows, collisions, scoring, and scene startup behavior.
  • Combine runtime inspection, console logs, screenshots, and test results.
  • Shorten feedback loops without replacing human playtesting for feel and design judgment.

Read the gameplay automation walkthrough

Unity Code MCP Server validating gameplay in Play Mode

Release Highlights

What changed in 0.2, 0.3, and 0.4

Version 0.4

File-backed bridge and dedicated Game View screenshots

The 0.4 release makes the bundled STDIO bridge the default connection path, replacing the standard TCP setup with a file-backed transport. It also adds a dedicated Game View screenshot tool and tightens Play Mode, logging, and test automation reliability.

  • The default bridge now exchanges request and response files through .unityCodeMcpServer/messages.
  • get_unity_game_view_window_screenshot gives agents a direct way to capture the current Game View.
  • Play Mode automation, logging, and automated test handling are more defensive and easier to reason about.

Read the full v0.4 release notes

Version 0.3

Play Mode automation with play_unity_game

The 0.3 release extends the server from editor automation into gameplay validation. Agents can enter Play Mode, drive gameplay actions, collect logs, capture screenshots, and exit cleanly, making real playtesting part of the same loop as scene setup and code generation.

  • `enter_play_mode`, `play_unity_game`, and `exit_play_mode` support closed-loop gameplay automation.
  • Input System actions, screenshots, and gameplay logs give agents observable feedback.
  • Compilation guards and safer state restoration make automation more reliable in active projects.

Read the full v0.3 release notes

See play_unity_game in real gameplay tests

Version 0.2

Favourite Scripts for repeatable editor work

Favourite Scripts adds a dedicated Unity window for saving, loading, editing, and rerunning C# automation scripts directly inside the editor. That turns one-off agent output into a reusable workflow library for setup tasks, debugging routines, and project-specific automation.

  • Store named scripts in project-local JSON so common tasks stay available between sessions.
  • Run saved scripts through the same execution pipeline used by the MCP server.
  • Reduce dependence on regenerating similar scripts for repetitive editor operations.

Read the full v0.2 release notes

Built-in Tools

Core capabilities available to MCP clients

Back to products overview
Tool What it enables
execute_csharp_script_in_unity_editor Execute generated C# scripts with full Unity Editor API access for scenes, assets, components, and configuration.
read_unity_console_logs Read live Unity Console output from the current project so agents can debug against what the editor is actually showing.
run_unity_tests Run EditMode or PlayMode tests and bring the results back into the agent workflow.
enter_play_mode Move the editor safely into Play Mode as part of a gameplay automation loop.
play_unity_game Automate gameplay with input actions, screenshots, and logs so agents can validate in-game behavior instead of stopping at editor setup.
get_unity_game_view_window_screenshot Capture the current Game View as an image without routing screenshot capture through gameplay input calls.
exit_play_mode Return the editor to a stable editing state after gameplay automation or testing.
get_unity_info Return information about the current Unity Editor project and active Unity Code MCP Server settings.

Requirements

  • Unity 2022.3 LTS or higher
  • UniTask for async and editor integration support
  • Unity Input System for gameplay automation in 0.3 and later
  • uv for STDIO transport workflows

Security and Operations

Unity Code MCP Server executes AI-generated C# with Unity Editor privileges. Review generated scripts before execution, especially in shared or production-adjacent projects.

For higher-risk workflows, run Unity in an isolated environment and treat play mode automation the same way you would any other privileged test harness.

Move from suggestions to execution inside Unity.

Use Unity Code MCP Server when you need AI agents to do real work in your Unity project: automate editor tasks, reuse Favourite Scripts, and validate gameplay flows with Play Mode tooling.