Provides an MCP server to connect Unity with AI assistants for managing assets, scenes, and scripts via the Model Context Protocol.
Configuration
View docs{
"mcpServers": {
"coplaydev-unity-mcp": {
"url": "http://localhost:8080/mcp",
"headers": {
"DISABLE_TELEMETRY": "true or false as configured by user"
}
}
}
}You can connect Unity to powerful AI assistants using the MCP server, enabling natural language control over assets, scenes, and editor functions. This server exposes a standard MCP interface that your Unity projects can talk to, allowing your chosen MCP clients to issue commands and automate tasks inside the Unity Editor.
To use the MCP server, start Unity and run the MCP integration to expose a server endpoint. The server provides an HTTP endpoint at localhost and can also be driven from a local process through standard input/output (stdio) integration. You can connect compatible MCP clients (such as Claude Desktop, Cursor, Windsurf, or VS Code with MCP support) to the server and begin giving natural language prompts to manipulate Unity content.
Prerequisites you need before installation:
Step-by-step setup inside Unity and your environment:
{
"mcpServers": {
"unityMCP": {
"url": "http://localhost:8080/mcp"
}
}
}{
"mcpServers": {
"unityMCP": {
"command": "uvx",
"args": ["--from", "mcpforunityserver", "mcp-for-unity", "--transport", "stdio"]
}
}
}For Windows, run the same stdio configuration with the Windows path for uvx if you use the same approach. The final command and arguments should be used exactly as shown here.
If auto-setup does not configure correctly, place the following in your MCP client configuration to point to the local HTTP server or stdio runner. You can also adapt this for your code editor integration.
MCP for Unity can target multiple Unity Editors. To select a specific instance, ask your AI to check the unity_instances resource, then use set_active_instance with a value like Name@hash (for example, MyProject@abc123). All subsequent tools will apply to that instance.
For strict Roslyn-based validation of scripts, follow the steps below to enable runtime code execution validation inside Unity. This enables advanced checks for undefined namespaces, types, and methods.
If you run into issues, check common points of failure such as the bridge connection, server startup, or client connectivity. Review the MCP status in Unity and confirm that the HTTP server is running at the expected URL. If problems persist, consult the Discord community or raise an issue with clear reproduction steps.
The server defaults to secure behavior with optional opt-ins for broader network access. Telemetry is anonymized and privacy-preserving by default, with an option to disable telemetry via an environment flag.
Contribute by forking the project, creating a feature branch, and submitting a pull request after implementing your changes in a local MCP-enabled workflow.
Anonymous telemetry is collected to improve the MCP experience. You can opt out by setting the DISABLE_TELEMETRY environment variable to true.
Network defaults aim to be secure by default. Local HTTP endpoints bind to loopback by default. Enabling LAN binding or remote access requires explicit opt-ins in the Advanced Settings.
MIT license. For help, reach out via the community channels provided in the project materials.
The MCP server offers a set of actions to control Unity elements such as assets, scenes, materials, scripts, and editor functions. These tools enable automated workflows and assistance from compatible MCP clients.
Apply text edits to Unity scripts or assets based on prompts.
Execute multiple MCP actions in a batch for speed and efficiency.
Generate a new Unity C# script from a prompt.
Inspect the current request context for debugging prompts.
Remove a Unity script from the project.
Run a custom tool integrated into the MCP workflow.
Trigger a Unity editor menu item via an MCP command.
Search for GameObjects in the current scene by criteria.
Search within a file for text patterns and report matches.
Retrieve a SHA hash for a given artifact or script.
Fetch details about a test job in the MCP workflow.
Modify or create animation assets and controllers.
Handle Unity assets such as textures, models, audio.
Add, remove, or modify components on GameObjects.
Interact with editor settings and tooling.
Create, rename, or delete GameObjects; adjust transforms.
Manage materials, shaders, and properties.
Create or update prefabs and their instances.
Load, save, or modify Unity scenes.
Manage scripts, update code, and apply changes.
Configure capabilities available to scripts.
Handle ScriptableObject assets and their data.
Edit or assign shaders to materials.
Edit texture properties and import settings.
Modify UI elements and layouts.
Control visual effects assets and systems.
Read Unity console output for prompts or debugging.
Refresh or restart the Unity session from MCP.
Execute test suites within the Unity project.
Apply code edits automatically to scripts.
Switch the active Unity Editor instance for subsequent actions.
Validate scripts for syntax and semantic correctness.