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
{
"mcpServers": {
"unity": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-unity"
],
"env": {
"UNITY_PROJECT_PATH": "/path/to/your/unity/project"
}
}
}
}
Sources
Related Articles
Development Tools & DevOps MCP Servers
Streamline your development workflow with our Development Tools & DevOps integrations. Connect with version control systems, CI/CD pipelines, container platforms, and more to build, test, and deploy your AI applications faster and more reliably.
Docker Integration MCP Servers
Docker MCP servers provide interfaces for LLMs to interact with Docker containers and services. These servers enable AI models to manage containers, handle image operations, and assist with Docker infrastructure tasks.
Playwright MCP Server
Playwright MCP servers enable AI models to perform cross-browser automation, modern web testing, accessibility testing, and end-to-end testing workflows using Playwright's powerful browser automation capabilities.