MCP server that connects AI agents to the Unity Editor. Enables AI-driven scripting, scene manipulation, asset management, and configuration changes through natural language.
16 GitHub stars
Open source under MIT license — free to use and modify
MCP server connecting AI agents to Unity Editor API
UnityCodeMCPServer gives AI agents the ability to perform any action using Unity Editor API. It provides a set of MCP tools that let AI inspect live scenes, components, assets, console output, settings, Play Mode state, and runtime values. The AI can execute generated C# scripts directly in the Editor to create and modify GameObjects, prefabs, ScriptableObjects, import settings, and more. It also supports running EditMode and PlayMode tests, capturing screenshots, simulating player input, and reading console logs. Designed for game developers who want to automate Unity workflows with AI, it works with any MCP-compatible client and includes a STDIO bridge for secure communication.
UnityCodeMCPServer is designed to work with Unity 2020.3 and newer, including Unity 6. It integrates as a plugin in your project without modifying core files.
After installing the package via UPM or Git, configure your AI client (e.g., Claude, Cursor) to use the STDIO bridge or custom transport. The server starts automatically when Unity opens if enabled in settings.
We recommend reviewing all generated scripts before execution, especially those using reflection. Use a separate Unity project or run Unity in an isolated environment (VM/container) for sensitive work.
Yes, you can extend the server by adding your own tools using the provided API. See the Extending section in the README for detailed instructions.
The server operates on the Editor process and can interact with networked scenes, but you must ensure your network code is deterministic when using play_unity_game with input simulation.
Install Unity Code MCP Server to get started:
Or visit the project page for detailed setup instructions.