home / mcp / unity mcp server

Unity MCP Server

Provides an MCP server to connect Unity with LLMs, enabling natural-language control of assets, scenes, and editor tasks.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "coplaydev-unity-mcp": {
      "url": "http://localhost:8080/mcp",
      "headers": {
        "DISABLE_TELEMETRY": "true"
      }
    }
  }
}

You can connect Unity to powerful AI assistants by running an MCP server inside Unity and using an MCP client to send natural-language prompts. This setup lets you manage assets, scenes, scripts, and editor tasks directly from your AI, speeding up development and automation.

How to use

Start by launching the MCP server inside Unity and connect your preferred MCP client. The server exposes an HTTP endpoint on localhost for quick setup, or you can run a local MCP process with a standard input/output (stdio) configuration. Once connected, you can instruct your AI to perform Unity tasks such as creating assets, building scenes, editing scripts, applying edits, and automating repetitive workflows. For best results, reference available tools like asset management, script management, scene operations, and editor commands to guide your prompts.

Starting and connecting with an MCP client

1) Open Unity and access MCP for Unity from the Window menu. 2) Start the server to launch the HTTP endpoint at localhost:8080. 3) Choose your MCP client from the dropdown and configure the connection. 4) Verify the status indicator shows Connected. 5) Connect your client. Some clients enable an MCP toggle in their settings; others auto-connect after configuration.

What you can do once connected

Ask your AI to create assets, edit scenes, generate scripts, modify materials, or automate workflows. You can say things like: “Create a red, blue and yellow cube,” or “Build a simple player controller,” and the AI will translate your prompt into Unity actions using the available tools.

Tips for best results

Use batch operations when performing multiple tasks to improve speed. The system offers a variety of tools to interact with game objects, assets, scenes, and editor functions. When working with multiple Unity instances, set the active instance so subsequent actions target the correct editor.

Available tools

apply_text_edits

Apply text edits to Unity scripts or assets through the MCP tools interface.

batch_execute

Execute a batch of MCP commands to perform multiple Unity actions efficiently.

create_script

Generate new C# scripts based on prompts and integrate them into the project.

debug_request_context

Request and inspect the current context for debugging prompts.

delete_script

Remove a script from the project safely.

execute_custom_tool

Run a custom tool exposed by the MCP server.

execute_menu_item

Trigger Unity editor menu items via prompts.

find_gameobjects

Search for game objects matching criteria within the scene.

find_in_file

Search for text patterns inside project files.

get_sha

Return the current commit or file checksum for integrity checks.

get_test_job

Query test jobs and their results.

manage_animation

Edit or manage animation components and controllers.

manage_asset

Manage assets in the project; import, move, or delete assets.

manage_components

Modify components on game objects or prefabs.

manage_editor

Interact with the Unity editor state and settings.

manage_gameobject

Create, modify, or delete game objects in scenes.

manage_material

Edit or create materials and shaders.

manage_prefabs

Manage prefab instances and their properties.

manage_scene

Create, modify, or save scenes.

manage_script

Edit or manage existing scripts.

manage_script_capabilities

Inspect or modify script capabilities and validations.

manage_scriptable_object

Handle ScriptableObject assets and their data.

manage_shader

Edit or create shader code used by materials.

manage_texture

Manipulate textures used by assets and materials.

manage_vfx

Control VFX assets and effects within Unity.

read_console

Read the Unity console output for debugging.

refresh_unity

Refresh or reload Unity state to reflect changes.

run_tests

Execute test suites and report results.

script_apply_edits

Apply scripted edits to code using automated changes.

set_active_instance

Select which Unity instance receives subsequent commands.

validate_script

Validate scripts for syntax and namespace correctness.