Provides an HTTP and local MCP server to connect Unity with AI assistants to manage assets, scenes, and scripts.
Configuration
View docs{
"mcpServers": {
"coplaydev-unity-mcp": {
"url": "http://localhost:8080/mcp"
}
}
}You can run an MCP server for Unity and connect your Unity Editor to AI assistants. This setup lets you control assets, scenes, scripts, and editor features through natural language prompts and dedicated MCP tools, making Unity workflows faster and more automated.
Start the server from Unity to expose the MCP endpoint, then connect an MCP client such as Claude Desktop, Cursor, Windsurf, or other supported clients. Once connected, you can issue prompts like “Create a red, blue and yellow cube” or “Build a simple player controller” to perform Unity tasks through your AI assistant.
Prerequisites you need before installing the server:
Install the Unity package for MCP for Unity from the Unity Package Manager using the URL or via alternative distribution methods described in your setup workflow. Then proceed to start the server from within Unity.
// Example: enabling Unity MCP for Unity via the in-editor package workflow
// 1. Open Unity
// 2. Window > Package Manager > + > Add package from git URL...
// 3. Enter the MCP for Unity package URL (as provided by the project)
// 4. Confirm the package installs
// After installation, start the server from the Unity window
// Window > MCP for Unity > Start Server
// Server will listen on http://localhost:8080/mcp by defaultThere are two primary ways to connect your client to the MCP server. Use the HTTP endpoint when your client can reach the local or remote server, or run a local stdio-based server if your client supports a transport that uses stdio.
Option 1 — HTTP (default for Claude Desktop, Cursor, Windsurf): you will connect to the in-editor HTTP server exposed by MCP for Unity at the following URL.
HTTP endpoint (default) — Unity MCP HTTP server URL:
{
"type": "http",
"name": "unity_mcp",
"url": "http://localhost:8080/mcp",
"args": []
}If you prefer running a local stdio-based server, the following configuration uses uvx to start the MCP server for Unity in stdio mode.
{
"type": "stdio",
"name": "unity_mcp_stdio",
"command": "uvx",
"args": ["--from", "mcpforunityserver", "mcp-for-unity", "--transport", "stdio"]
}Open your MCP client and select the Unity MCP server configuration you added. For HTTP, provide the URL above. For stdio, ensure the client launches the uvx-driven process with the exact command and arguments shown.
Once connected, you can use tools to manage assets, scenes, materials, scripts, and editor functions. Start with simple prompts to validate connectivity and gradually introduce more complex workflows.
Manipulate Unity assets such as importing, deleting, or updating assets from prompts.
Interact with the Unity editor to trigger actions like opening windows, applying editor changes, or triggering editor scripts.
Create, modify, or remove GameObjects in the scene from natural language commands.
Add, remove, or configure components on GameObjects or prefabs.
Create or modify materials and textures used in the scene.
Create, update, or instantiate prefabs from prompts.
Load, modify, save, or switch scenes during a session.
Create, edit, or delete C# scripts via prompts.
Manage ScriptableObjects including creation and editing.
Create or modify shaders used by materials.
Control visual effects and related assets.
Manage textures and texture-related properties.
Execute multiple operations efficiently in a batch for speed.
Search for GameObjects by name or properties in the scene.
Search through files to locate definitions or references.
Read Unity editor or console logs for debugging prompts.
Refresh Unity state or re-sync assets with the editor.
Trigger automated tests or validation tasks.
Retrieve details about test jobs and results.
Invoke Unity menu items programmatically.
Apply text edits to scripts or assets through the MCP.
Apply scripted edits to code files.
Validate scripts for syntax and basic correctness.
Create new C# scripts from prompts.
Delete existing scripts via prompts.
Retrieve the current git SHA for versioning context.