Provides an HTTP and local stdio MCP bridge to connect Unity Editor with AI assistants for asset, scene, and script automation.
Configuration
View docs{
"mcpServers": {
"coplaydev-unity-mcp": {
"url": "http://localhost:8080/mcp"
}
}
}You can run MCP for Unity to connect an AI assistant to your Unity Editor, enabling natural language control of assets, scenes, scripts, and editor tasks. This server supports multiple MCP clients and provides a streamlined path to automate common Unity workflows through a configurable bridge between your editor and your chosen AI toolset.
Begin by ensuring you have Unity 2021.3 LTS or newer, Python 3.10+ installed, and an MCP client such as Claude Desktop, Claude Code, Cursor, Windsurf, or similar. Start the Unity MCP server from within Unity, connect your MCP client, and confirm the connection status shows green, indicating an active connection.
Once connected, you can instruct the AI to perform Unity tasks using natural language. Common actions include creating or editing assets, building scenes, scripting, and automating repetitive workflows. If you want to try a simple test, ask the AI to create a basic scene with colored objects or to build a basic player controller. The server routes all subsequent tool calls to the currently selected Unity instance and the active client, so you can switch targets as needed.
Prerequisites your environment must satisfy before installing MCP for Unity.
Step-by-step installation options are shown below. Choose the method that fits your setup.
{
"mcpServers": {
"unityMCP": {
"url": "http://localhost:8080/mcp"
}
}
}Manual configuration of the MCP client is supported if auto-setup doesn’t work. You can add a server entry to your MCP client configuration with the HTTP URL shown above or configure the stdio transport for local execution.
If the Unity bridge isn’t connecting, open the Unity window for MCP for Unity and verify the server status, then restart Unity if needed. If the server won’t start, check that the uv tool is installed and accessible in your PATH and review the terminal for errors. If a client cannot connect, ensure the HTTP server is running and the configured URL matches. For persistent issues, consult the community Discord or raise an issue with relevant logs.
Telemetry is anonymous and privacy-focused by default, with an option to opt out. If you enable telemetry, you can disable it by setting DISABLE_TELEMETRY=true in your environment. For contribution guidelines, follow the project’s contribution process to propose enhancements or custom tools.
Network defaults favor security. Local HTTP (loopback) is allowed by default, while bind-all interfaces require explicit opt-in. Remote HTTP endpoints require explicit acceptance of HTTPS and insecure HTTP settings must be opt-in via advanced settings. Always operate MCP servers within trusted networks and review security settings before exposing endpoints.
For strict validation that catches undefined namespaces, types, and methods, you can enable Roslyn-based validation by installing the Roslyn tooling and configuring the scripting define symbol USE_ROSLYN in your project. This is an advanced option and requires additional DLLs if NuGet-based tooling is unavailable.
Apply text edits to scripts or configuration files via the LLM, enabling quick fixes and refinements.
Run multiple tool actions in sequence for efficiency, reducing round-trips to the Unity API.
Generate new Unity C# scripts based on prompts or templates and integrate them into your project.
Inspect the current request context to troubleshoot tool calls and ensure correct target objects.
Remove an existing script from the Unity project.
Invoke a custom, user-defined tool within the MCP environment.
Trigger a Unity editor menu item to perform built-in actions.
Search for GameObjects in the active scene or project by name or type.
Locate occurrences of text within a file or set of files.
Retrieve a SHA hash for versioning or integrity checks.
Run a test job to validate changes or tooling integration.
Modify or create animation assets and their properties.
Handle asset import, organization, and metadata operations.
Add, remove, or configure Unity components on GameObjects.
Operate Unity editor-level settings and preferences programmatically.
Modify GameObject properties, hierarchy, and components.
Create and edit materials and shaders for rendering.
Create, update, or replace prefab assets in your project.
Load, modify, and save scenes, including lighting and objects.
Edit, validate, and apply changes to C# scripts.
Manage script capabilities and metadata for enhanced IDE support.
Create and manipulate ScriptableObject assets.
Edit shader code and properties to control rendering.
Handle texture assets and their import settings.
Create and adjust visual effects assets and controllers.
Read Unity console output for debugging and feedback.
Refresh Unity to apply changes or reload assets.
Execute test suites to validate project changes.
Apply scripted edits to code and assets in batch.
Target a specific Unity Editor instance for subsequent actions.
Validate C# scripts for syntax and basic semantic correctness.