Home / MCP / MCP for Unity Server
Provides a local HTTP server to connect Unity with MCP clients for asset, scene, and editor automation.
Configuration
View docs{
"mcpServers": {
"unity_mcp": {
"url": "http://localhost:8080/mcp"
}
}
}MCP for Unity lets you control Unity Editor tasks from conversational AI tools by connecting a local HTTP-based server to your MCP client. It enables natural language commands to manage assets, scenes, scripts, and editor actions, making Unity workflows faster and more automated.
Open the Unity project you want to work with and start the local MCP server in HTTP mode. Then connect your MCP client (Claude, Cursor, VS Code Copilot, Windsurf, or another compatible client) to the server so you can issue commands like creating objects, editing scenes, or applying materials through natural language.
Typical workflow: launch Unity with MCP for Unity, start the local HTTP server, and configure your MCP client to point at the server’s URL. Once connected, you can issue prompts such as creating a game object, wiring up a shader, or batch-running repetitive edits across multiple assets. Use the batch_execute tool whenever you need to run many commands efficiently in a single pass.
Prerequisites you need before installation are a Unity Editor 2021.3 LTS or newer and a working Python environment.
Install the MCP package in your Unity project via the Unity Asset Store or by using a package URL. Then start the local HTTP server from within Unity.
Optionally, you can run the server manually in a terminal to observe raw logs. The default HTTP URL you will use is http://localhost:8080/mcp.
Configuration and transport. HTTP transport is enabled by default for the server. If you prefer a bundled setup, you can switch to a stdio transport, but HTTP remains the primary method for external clients.
Security and telemetry. MCP for Unity includes anonymous telemetry that you can disable with a specific environment variable if you choose to opt out.
Troubleshooting. If the server doesn’t start or a client cannot connect, ensure the local HTTP server is running and the URL used by the client exactly matches the server URL. If necessary, restart Unity and verify the server process path.
Tips for working with multiple Unity instances. You can direct tool calls to a specific Unity Editor instance by selecting the instance from the available list and setting it as the active one for subsequent calls.
Operations to import, create, modify, delete, and search assets within the Unity project.
Control editor state such as play mode, active tool, and tag/layer management.
Create, modify, delete, find, duplicate, or move GameObjects.
Add, remove, or set properties on components attached to GameObjects.
Create materials, adjust properties, colors, and assign to renderers.
Open/close prefab stage, save changes, and create prefabs from GameObjects.
Load, save, create scenes, and retrieve hierarchy or screenshots.
Legacy script operations; prefer apply_text_edits for modern workflows.
Create and modify ScriptableObject assets.
CRUD operations for shaders.
Operations for VFX elements like particle systems and visual effects graphs.
Execute multiple commands in a single batch for high-performance automation.
Search for GameObjects by name, tag, layer, component, path, or ID with pagination.
Read or clear messages from the Unity console.
Request asset database refresh and optional compilation.
Start tests asynchronously and poll progress via a job ID.
Poll an asynchronous test job for progress and results.
Run project-scoped custom tools registered by Unity.
Execute Unity Editor menu items like File/Save Project.
Route tool calls to a specific Unity instance by Name@hash.
Apply precise text edits with line/column ranges and precondition hashes.
Structured edits for C# methods/classes with safer boundaries.
Fast validation to catch syntax or structural issues.
Create a new C# script at the given project path.
Delete a C# script by URI or Assets-relative path.
Retrieve SHA256 and metadata for a Unity C# script without contents.