home / mcp / unity mcp server

Unity MCP Server

Provides an HTTP and local MCP server to connect Unity with AI assistants to manage assets, scenes, and scripts.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

Prerequisites you need before installing the server:

  • Unity 2021.3 LTS+ is required. Install Unity from the official downloads site.
  • Open the Unity Hub to manage installations.
  • Install Python 3.10 or newer.
  • Install uv to enable the stdio transport if you plan to run the local server via uvx.
  • Choose an MCP client such as Claude Desktop, Cursor, Windsurf, or similar.
  • Configure the client to connect to the Unity MCP 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 default

Configuration and connection

There 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.

MCP server endpoints to use

HTTP endpoint (default) — Unity MCP HTTP server URL:

{
  "type": "http",
  "name": "unity_mcp",
  "url": "http://localhost:8080/mcp",
  "args": []
}

Local stdio configuration with uvx transport

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"]
}

Connecting your MCP client

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.

Explore available actions

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.

Available tools

manage_asset

Manipulate Unity assets such as importing, deleting, or updating assets from prompts.

manage_editor

Interact with the Unity editor to trigger actions like opening windows, applying editor changes, or triggering editor scripts.

manage_gameobject

Create, modify, or remove GameObjects in the scene from natural language commands.

manage_components

Add, remove, or configure components on GameObjects or prefabs.

manage_material

Create or modify materials and textures used in the scene.

manage_prefabs

Create, update, or instantiate prefabs from prompts.

manage_scene

Load, modify, save, or switch scenes during a session.

manage_script

Create, edit, or delete C# scripts via prompts.

manage_scriptable_object

Manage ScriptableObjects including creation and editing.

manage_shader

Create or modify shaders used by materials.

manage_vfx

Control visual effects and related assets.

manage_texture

Manage textures and texture-related properties.

batch_execute

Execute multiple operations efficiently in a batch for speed.

find_gameobjects

Search for GameObjects by name or properties in the scene.

find_in_file

Search through files to locate definitions or references.

read_console

Read Unity editor or console logs for debugging prompts.

refresh_unity

Refresh Unity state or re-sync assets with the editor.

run_tests

Trigger automated tests or validation tasks.

get_test_job

Retrieve details about test jobs and results.

execute_menu_item

Invoke Unity menu items programmatically.

apply_text_edits

Apply text edits to scripts or assets through the MCP.

script_apply_edits

Apply scripted edits to code files.

validate_script

Validate scripts for syntax and basic correctness.

create_script

Create new C# scripts from prompts.

delete_script

Delete existing scripts via prompts.

get_sha

Retrieve the current git SHA for versioning context.