Home / MCP / MCP for Unity Server

MCP for Unity Server

Provides a local HTTP server to connect Unity with MCP clients for asset, scene, and editor automation.

python
Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.

Additional sections

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.

Available tools

manage_asset

Operations to import, create, modify, delete, and search assets within the Unity project.

manage_editor

Control editor state such as play mode, active tool, and tag/layer management.

manage_gameobject

Create, modify, delete, find, duplicate, or move GameObjects.

manage_components

Add, remove, or set properties on components attached to GameObjects.

manage_material

Create materials, adjust properties, colors, and assign to renderers.

manage_prefabs

Open/close prefab stage, save changes, and create prefabs from GameObjects.

manage_scene

Load, save, create scenes, and retrieve hierarchy or screenshots.

manage_script

Legacy script operations; prefer apply_text_edits for modern workflows.

manage_scriptable_object

Create and modify ScriptableObject assets.

manage_shader

CRUD operations for shaders.

manage_vfx

Operations for VFX elements like particle systems and visual effects graphs.

batch_execute

Execute multiple commands in a single batch for high-performance automation.

find_gameobjects

Search for GameObjects by name, tag, layer, component, path, or ID with pagination.

read_console

Read or clear messages from the Unity console.

refresh_unity

Request asset database refresh and optional compilation.

run_tests

Start tests asynchronously and poll progress via a job ID.

get_test_job

Poll an asynchronous test job for progress and results.

execute_custom_tool

Run project-scoped custom tools registered by Unity.

execute_menu_item

Execute Unity Editor menu items like File/Save Project.

set_active_instance

Route tool calls to a specific Unity instance by Name@hash.

apply_text_edits

Apply precise text edits with line/column ranges and precondition hashes.

script_apply_edits

Structured edits for C# methods/classes with safer boundaries.

validate_script

Fast validation to catch syntax or structural issues.

create_script

Create a new C# script at the given project path.

delete_script

Delete a C# script by URI or Assets-relative path.

get_sha

Retrieve SHA256 and metadata for a Unity C# script without contents.