✨ AI Game Developer — Unity MCP 中文 | 日本語 | Español Unity MCP is an AI-powered game development assistant for Editor & Runtime. Connect Claude, Cursor, & Windsurf to Unity via MCP. Automate workflows, generate code, and enable AI within your games. Unlike other tools, this plugin works inside your compiled game, allowing for real-time AI debugging and player-AI interaction. - ✔️ Runtime AI - Use LL
Add this skill
npx mdskills install IvanMurzak/unity-mcpComprehensive Unity MCP server enabling AI agents to control Unity Editor and runtime with extensive tool coverage
✨ AI Game Developer — Unity MCP

Unity MCP is an AI-powered game development assistant for Editor & Runtime. Connect Claude, Cursor, & Windsurf to Unity via MCP. Automate workflows, generate code, and enable AI within your games.
Unlike other tools, this plugin works inside your compiled game, allowing for real-time AI debugging and player-AI interaction.
💬 Join our Discord Server - Ask questions, showcase your work, and connect with other developers!

Assets
copy - Copy the asset at path and stores it at newPath
create-folder - Creates a new folder in the specified parent folder
delete - Delete the assets at paths from the project
find - Search the asset database using the search filter string
get-data - Get asset data from the asset file including all serializable fields and properties
modify - Modify asset file in the project
move - Move the assets at paths in the project (also used for rename)
refresh - Refreshes the AssetDatabase
Assets / Material
create - Create new material asset with default parameters
Assets / Shader
list-all - List all available shaders in the project assets and packages
Assets / Prefab
create - Create a prefab from a GameObject in the current active scene
instantiate - Instantiates prefab in the current active scene
open - Open prefab edit mode for a specific GameObject
close - Close currently opened prefab
save - Save a prefab in prefab editing mode
GameObject
create - Create a new GameObject in opened Prefab or in a Scene
destroy - Destroy GameObject and all nested GameObjects recursively
duplicate - Duplicate GameObjects in opened Prefab or in a Scene
find - Finds specific GameObject by provided information
modify - Modify GameObjects and/or attached component's fields and properties
set-parent - Set parent GameObject to list of GameObjects
GameObject / Component
add - Add Component to GameObject
destroy - Destroy one or many components from target GameObject
get - Get detailed information about a specific Component on a GameObject
modify - Modify a specific Component on a GameObject
Component
list - List C# class names extended from UnityEngine.Component
Scene
create - Create new scene in the project assets
get-data - Retrieves the list of root GameObjects in the specified scene
list-opened - Returns the list of currently opened scenes in Unity Editor
open - Open scene from the project asset file
save - Save opened scene to the asset file
set-active - Set the specified opened scene as the active scene
unload - Unload scene from the opened scenes in Unity Editor
Script
delete - Delete the script file(s)
execute - Compiles and executes C# code dynamically using Roslyn
read - Reads the content of a script file
update-or-create - Updates or creates script file with the provided C# code
Console
get-logs - Retrieves Unity Editor logs with filtering options
Editor / Application
get-state - Returns information about the Unity Editor application state (playmode, paused, compilation)
set-state - Control the Unity Editor application state (start/stop/pause playmode)
Editor / Selection
get - Get information about the current Selection in the Unity Editor
set - Set the current Selection in the Unity Editor
Reflection
method-find - Find method in the project using C# Reflection (even private methods)
method-call - Call any C# method with input parameters and return results
Tests
run - Execute Unity tests (EditMode/PlayMode) with filtering and detailed results
Package Manager
add - Install a package from the Unity Package Manager registry, Git URL, or local path
remove - Remove (uninstall) a package from the Unity project
list - List all packages installed in the Unity project (UPM packages)
search - Search for packages in both Unity Package Manager registry and installed packages
| Unity Version | Editmode | Playmode | Standalone |
|---|---|---|---|
| 2022.3.62f3 | |||
| 2023.2.22f1 | |||
| 6000.3.1f1 |
MCP Server setup
Unity MCP Plugin⚠️ Requirements (click)
Important:
Project path cannot contain spaces
- ✅
C:/MyProjects/Project- ❌
C:/My Projects/Project
- You can double-click on the file - Unity will open it automatically
- OR: Open Unity Editor first, then click on
Assets/Import Package/Custom Package, and choose the file
openupm add com.ivanmurzak.unity.mcp
MCP ClientChoose a single MCP Client you prefer - you don't need to install all of them. This will be your main chat window to communicate with the LLM.
The MCP protocol is quite universal, which is why you may use any MCP client you prefer - it will work as smoothly as any other. The only important requirement is that the MCP client must support dynamic MCP Tool updates.
MCP ClientWindow/AI Game Developer (Unity-MCP)Configure at your MCP clientIf your MCP client is not in the list, use the raw JSON shown in the window to inject it into your MCP client. Read the instructions for your specific MCP client on how to do this.
If automatic configuration doesn't work for you for any reason, use the JSON from the AI Game Developer (Unity-MCP) window to configure any MCP Client manually.
Create command
1. Choose your `` for your environment
| Platform | `` |
|---|---|
| Windows x64 | "/Library/mcp-server/win-x64/unity-mcp-server.exe" port= client-transport=stdio |
| Windows x86 | "/Library/mcp-server/win-x86/unity-mcp-server.exe" port= client-transport=stdio |
| Windows arm64 | "/Library/mcp-server/win-arm64/unity-mcp-server.exe" port= client-transport=stdio |
| MacOS Apple-Silicon | "/Library/mcp-server/osx-arm64/unity-mcp-server" port= client-transport=stdio |
| MacOS Apple-Intel | "/Library/mcp-server/osx-x64/unity-mcp-server" port= client-transport=stdio |
| Linux x64 | "/Library/mcp-server/linux-x64/unity-mcp-server" port= client-transport=stdio |
| Linux arm64 | "/Library/mcp-server/linux-arm64/unity-mcp-server" port= client-transport=stdio |
2. Replace `` with the full path to Unity project
3. Replace `` with your port from AI Game Developer configuration
4. Add MCP server using command line
Gemini CLI
gemini mcp add ai-game-developer
Replace `` from the table above
Claude Code CLI
claude mcp add ai-game-developer
Replace `` from the table above
GitHub Copilot CLI
copilot
/mcp add
Server name: ai-game-developer
Server type: local
Command: ``
Replace `` from the table above
Communicate with the AI (LLM) in your MCP Client. Ask it to do anything you want. The better you describe your task or idea, the better it will perform the job.
Some MCP Clients allow you to choose different LLM models. Pay attention to this feature, as some models may work much better than others.
Example commands:
Explain my scene hierarchy
Create 3 cubes in a circle with radius 2
Create metallic golden material and attach it to a sphere gameObject
Make sure
Agentmode is turned on in your MCP client
Unity MCP provides advanced tools that enable the LLM to work faster and more effectively, avoiding mistakes and self-correcting when errors occur. Everything is designed to achieve your goals efficiently.
Roslyn for faster iterationclass, method, or property via Description attributesUnity MCP supports custom MCP Tool, MCP Resource, and MCP Prompt development by project owners. The MCP server takes data from the Unity MCP Plugin and exposes it to a client. Anyone in the MCP communication chain will receive information about new MCP features, which the LLM may decide to use at some point.
MCP ToolTo add a custom MCP Tool, you need:
McpPluginToolType attributeMcpPluginTool attributeDescription attribute to each method argument to help the LLM understand itstring? optional = null properties with ? and default values to mark them as optional for the LLMNote that the line
MainThread.Instance.Run(() =>allows you to run code on the main thread, which is required for interacting with Unity's API. If you don't need this and running the tool in a background thread is acceptable, avoid using the main thread for efficiency purposes.
[McpPluginToolType]
public class Tool_GameObject
{
[McpPluginTool
(
"MyCustomTask",
Title = "Create a new GameObject"
)]
[Description("Explain here to LLM what is this, when it should be called.")]
public string CustomTask
(
[Description("Explain to LLM what is this.")]
string inputData
)
{
// do anything in background thread
return MainThread.Instance.Run(() =>
{
// do something in main thread if needed
return $"[Success] Operation completed.";
});
}
}
MCP PromptMCP Prompt allows you to inject custom prompts into the conversation with the LLM. It supports two sender roles: User and Assistant. This is a quick way to instruct the LLM to perform specific tasks. You can generate prompts using custom data, providing lists or any other relevant information.
[McpPluginPromptType]
public static class Prompt_ScriptingCode
{
[McpPluginPrompt(Name = "add-event-system", Role = Role.User)]
[Description("Implement UnityEvent-based communication system between GameObjects.")]
public string AddEventSystem()
{
return "Create event system using UnityEvents, UnityActions, or custom event delegates for decoupled communication between game systems and components.";
}
}
Use Unity MCP in your game/app. Use Tools, Resources or Prompts. By default there are no tools, you would need to implement your custom.
UnityMcpPlugin.BuildAndStart(); // Build and start Unity-MCP-Plugin, it is required
UnityMcpPlugin.Connect(); // Start active connection with retry to Unity-MCP-Server
UnityMcpPlugin.Disconnect(); // Stop active connection and close existed connection
There is a classic Chess game. Lets outsource to LLM the bot logic. Bot should do the turn using game rules.
[McpPluginToolType]
public static class ChessGameAI
{
[McpPluginTool("chess-do-turn", Title = "Do the turn")]
[Description("Do the turn in the chess game. Returns true if the turn was accepted, false otherwise.")]
public static Task DoTurn(int figureId, Vector2Int position)
{
return MainThread.Instance.RunAsync(() => ChessGameController.Instance.DoTurn(figureId, position));
}
[McpPluginTool("chess-get-board", Title = "Get the board")]
[Description("Get the current state of the chess board.")]
public static Task GetBoard()
{
return MainThread.Instance.RunAsync(() => ChessGameController.Instance.GetBoardData());
}
}
There are many use cases, lets imagine you are working on a Chess game with bot. You may outsource the bot decision making to LLM by writing few lines of code.
MCP Server setupUnity MCP Server supports many different launch options and Docker deployment. Both transport protocols are supported: streamableHttp and stdio. If you need to customize or deploy Unity MCP Server to a cloud, this section is for you. Read more...
Doesn't matter what launch option you choose, all of them support custom configuration using both Environment Variables and Command Line Arguments. It would work with default values, if you just need to launch it, don't waste your time for the variables. Just make sure Unity Plugin also has default values, especially the --port, they should be equal.
| Environment Variable | Command Line Args | Description |
|---|---|---|
MCP_PLUGIN_PORT | --port | Client -> Server Server connection timeout (ms) (default: 10000) |
MCP_PLUGIN_CLIENT_TRANSPORT | --client-transport | Client -> Server transport type: stdio or streamableHttp (default: streamableHttp) |
Command line args support also the option with a single
-prefix (-port) and an option without prefix at all (port).
Make sure Docker is installed. And please make sure Docker Desktop is launched if you are at Windows operation system.
streamableHttp Transportdocker run -p 8080:8080 ivanmurzakdev/unity-mcp-server
MCP Client config:
{
"mcpServers": {
"ai-game-developer": {
"url": "http://localhost:8080"
}
}
}
Replace
urlwith your real endpoint if it is hosted in cloud.
stdio TransportFor using this variant, MCP Client should launch the MCP Server in the docker. It is achievable through the modified MCP Client configuration.
docker run -t -e MCP_PLUGIN_CLIENT_TRANSPORT=stdio -p 8080:8080 ivanmurzakdev/unity-mcp-server
MCP Client config:
{
"mcpServers": {
"ai-game-developer": {
"command": "docker",
"args": [
"run",
"-t",
"-e",
"MCP_PLUGIN_CLIENT_TRANSPORT=stdio",
"-p",
"8080:8080",
"ivanmurzakdev/unity-mcp-server"
]
}
}
}
portdocker run -e MCP_PLUGIN_PORT=123 -p 123:123 ivanmurzakdev/unity-mcp-server
MCP Client config:
{
"mcpServers": {
"ai-game-developer": {
"url": "http://localhost:123"
}
}
}
Replace
urlwith your real endpoint if it is hosted in cloud
You may launch Unity MCP Server directly from a binary file. You would need to have a binary compiled specifically for your CPU architecture. Check GitHub Release Page, it contains pre-compiled binaries for all CPU architectures.
./unity-mcp-server --port 8080 --plugin-timeout 10000 --client-transport stdio
MCP Client config:
Replace `` with your Unity project path.
{
"mcpServers": {
"ai-game-developer": {
"command": "/Library/mcp-server/win-x64/unity-mcp-server.exe",
"args": [
"--port=8080",
"--plugin-timeout=10000",
"--client-transport=stdio"
]
}
}
}
Unity MCP serves as a bridge between LLMs and Unity. It exposes and explains Unity's tools to the LLM, which then understands the interface and utilizes the tools according to user requests.
Connect Unity MCP to LLM clients such as Claude or Cursor using the integrated AI Connector window. Custom clients are also supported.
The system is highly extensible - you can define custom MCP Tools, MCP Resource or MCP Prompt directly in your Unity project codebase, exposing new capabilities to AI or automation clients. This makes Unity MCP a flexible foundation for building advanced workflows, rapid prototyping, and integrating AI-driven features into your development process.
MCPMCP - Model Context Protocol. In a few words, that is USB Type-C for AI, specifically for LLM (Large Language Model). It teaches LLM how to use external features. Such as Unity Engine in this case, or even your custom C# method in your code. Official documentation.
MCP ClientIt is an application with a chat window. It may have smart agents to operate better, it may have embedded advanced MCP Tools. In general well done MCP Client is 50% of the AI success of executing a task. That is why it is very important to choose the best one for usage.
MCP ServerIt is a bridge between MCP Client and "something else", in this particular case it is Unity Engine. This project includes MCP Server.
MCP ToolMCP Tool is a function or method that the LLM can call to interact with Unity. These tools act as the bridge between natural language requests and actual Unity operations. When you ask the AI to "create a cube" or "change material color," it uses MCP Tools to execute these actions.
Key characteristics:
MCP ToolExamples:
MCP ResourceMCP Resource provides read-only access to data within your Unity project. Unlike MCP Tools that perform actions, Resources allow the LLM to inspect and understand your project's current state, assets, and configuration. Think of them as "sensors" that give the AI context about your project.
Key characteristics:
MCP ResourceExamples:
MCP PromptMCP Prompt allows you to inject pre-defined prompts into the conversation with the LLM. These are smart templates that can provide context, instructions, or knowledge to guide the AI's behavior. Prompts can be static text or dynamically generated based on your project's current state.
Key characteristics:
MCP PromptExamples:
Contributions are highly appreciated. Bring your ideas and let's make game development simpler than ever before! Do you have an idea for a new MCP Tool or feature, or did you spot a bug and know how to fix it?
Please give this project a star 🌟 if you find it useful!
./Unity-MCP-Plugin folder in Unitymain branch.Install via CLI
npx mdskills install IvanMurzak/unity-mcpUnity MCP is a free, open-source AI agent skill. ✨ AI Game Developer — Unity MCP 中文 | 日本語 | Español Unity MCP is an AI-powered game development assistant for Editor & Runtime. Connect Claude, Cursor, & Windsurf to Unity via MCP. Automate workflows, generate code, and enable AI within your games. Unlike other tools, this plugin works inside your compiled game, allowing for real-time AI debugging and player-AI interaction. - ✔️ Runtime AI - Use LL
Install Unity MCP with a single command:
npx mdskills install IvanMurzak/unity-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Unity MCP works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.