Unity MCP Server
Unity MCP servers enable AI models to interact with the Unity Editor, providing capabilities for scene manipulation, asset management, script editing, and game development automation.
Overview
The MCP Unity Server bridges AI and the Unity Editor, allowing language models (LLMs) to directly interact with Unity projects. It's part of the Model Context Protocol (MCP) system, providing a safe and standard way to connect AI with game development workflows. Other notable implementations include CoplayDev/unity-mcp (Python) and IvanMurzak/Unity-MCP (Docker).
Developed by:
Primary implementation by CoderGamester
Key Features
Scene \u0026 GameObject Management
Create, modify, and delete GameObjects, components, and scenes
Asset \u0026 Project Control
Import, create, modify, and delete assets; manage packages and project settings
Scripting \u0026 Code Assistance
Edit C# scripts, validate code, and automate script-related tasks
Editor Automation \u0026 Testing
Automate repetitive editor workflows and run tests within the Unity Test Runner
Available Tools
Quick Reference
| Tool | Purpose | Category |
|---|---|---|
execute_menu_item | Executes Unity menu items | Editor |
select_gameobject | Selects GameObjects in hierarchy | Scene |
update_gameobject | Updates or creates GameObjects | Scene |
update_component | Updates or adds components to GameObjects | Scene |
add_package | Installs new Unity packages | Project |
run_tests | Runs Unity Test Runner tests | Testing |
send_console_log | Sends a log message to Unity console | Debugging |
add_asset_to_scene | Adds an asset to the current scene | Scene |
create_prefab | Creates a prefab | Assets |
Detailed Usage
execute_menu_itemโถ
Executes Unity menu items (functions tagged with the MenuItem attribute).
use_mcp_tool({
server_name: "unity",
tool_name: "execute_menu_item",
arguments: {
menu_item_path: "GameObject/Create Empty"
}
});
select_gameobjectโถ
Selects game objects in the Unity hierarchy by path or instance ID.
use_mcp_tool({
server_name: "unity",
tool_name: "select_gameobject",
arguments: {
path: "Main Camera"
}
});
update_gameobjectโถ
Updates a GameObject's core properties (name, tag, layer, active/static state), or creates the GameObject if it does not exist.
use_mcp_tool({
server_name: "unity",
tool_name: "update_gameobject",
arguments: {
name: "Player",
tag: "Enemy",
is_active: false
}
});
update_componentโถ
Updates component fields on a GameObject or adds it to the GameObject if it does not contain the component.
use_mcp_tool({
server_name: "unity",
tool_name: "update_component",
arguments: {
game_object_name: "Player",
component_type: "Rigidbody",
properties: {
mass: 5
}
}
});
add_packageโถ
Installs new packages in the Unity Package Manager.
use_mcp_tool({
server_name: "unity",
tool_name: "add_package",
arguments: {
package_name: "com.unity.textmeshpro"
}
});
run_testsโถ
Runs tests using the Unity Test Runner.
use_mcp_tool({
server_name: "unity",
tool_name: "run_tests",
arguments: {
test_mode: "EditMode"
}
});
send_console_logโถ
Sends a console log to Unity.
use_mcp_tool({
server_name: "unity",
tool_name: "send_console_log",
arguments: {
message: "Hello from MCP!"
}
});
add_asset_to_sceneโถ
Adds an asset from the AssetDatabase to the Unity scene.
use_mcp_tool({
server_name: "unity",
tool_name: "add_asset_to_scene",
arguments: {
asset_path: "Assets/Prefabs/Player.prefab"
}
});
create_prefabโถ
Creates a prefab with optional MonoBehaviour script and serialized fields.
use_mcp_tool({
server_name: "unity",
tool_name: "create_prefab",
arguments: {
name: "NewCubePrefab",
path: "Assets/Prefabs",
game_object_name: "Cube",
component_type: "MeshRenderer"
}
});
Installation
MCP Unity is distributed as a Unity package with a bundled Node.js bridge; the README installs it through Unity Package Manager, not npm, and documents no Docker image.
- Install Node.js 18 or later.
- In Unity, open Window โ Package Manager, click +, and choose Add package from git URL.
- Enter
https://github.com/CoderGamester/mcp-unity.gitand click Add. - Open Tools โ MCP Unity โ Server Window and click Configure for your AI client, then Start Server.
Sources
Related Articles & Guides
Gaming and Entertainment MCP Servers
The Gaming & Entertainment category provides integration with gaming platforms and entertainment systems, enabling interactive gaming experiences and virtual entertainment management.
HuggingFace MCP Server
HuggingFace MCP server provides AI assistants with access to the model hub โ search 1M+ models, discover datasets, explore Spaces, read papers, and fetch documentation directly through MCP.
#MCP ServerKnowledge Graph Memory MCP: AI Persistent Memory & Entity Mgmt
Knowledge Graph Memory MCP servers empower AI with persistent memory, entity management, and relation tracking through local knowledge graph interaction.