# MCP for Unity

> Control the Unity Editor from your assistant: scenes, GameObjects, C# scripts, assets, tests and builds.

- Listing: https://mcp.tc/i/unity
- Connect: this is a local (stdio) server; install it on your machine (see Install). The listing link is a page, not an MCP endpoint.
- Type: local (stdio)
- Auth: no API key needed
- Category: [Developer Tools](https://mcp.tc/c/developer-tools)
- Vendor: Coplay (CoplayDev)
- Homepage: <https://coplaydev.github.io/unity-mcp/>
- Docs: <https://github.com/CoplayDev/unity-mcp>
- Repository: <https://github.com/CoplayDev/unity-mcp>
- Package: pypi `mcpforunityserver`

## About

Connects an AI assistant to a running Unity Editor. It exposes tools to create and edit GameObjects, components, prefabs, scenes, materials, shaders, textures, animation, physics, VFX and UI Toolkit. It can also write and validate C# scripts, read the console, run Unity Test Framework tests, manage packages and trigger player builds.

Runs locally with uvx over stdio (or optionally HTTP), and needs Python with uv. The Unity package must also be installed in your project so the Editor can connect to the server. No API key or sign-in is needed for local use. Maintained by Coplay and not affiliated with Unity Technologies.

## What it can do

- Create, modify and delete GameObjects and their components
- Load, save and query scenes and prefabs
- Create, edit and validate C# scripts
- Manage assets, materials, shaders and textures
- Run Unity Test Framework tests and read console output
- Trigger player builds and switch platforms
- Manage packages, physics, animation, VFX and UI Toolkit
- Fetch Unity documentation and inspect APIs via reflection

## Tools (43)

- `apply_text_edits`: Apply text edits to script content.
- `batch_execute`: Execute multiple Unity operations in a single batch.
- `create_script`: Create new C# scripts.
- `debug_request_context`: Debug and inspect MCP request context
- `delete_script`: Delete C# scripts.
- `execute_custom_tool`: Execute custom Unity Editor tools registered by the project.
- `execute_code`: Execute arbitrary C# code inside the Unity Editor with access to Unity APIs.
- `execute_menu_item`: Execute Unity Editor menu items.
- `find_gameobjects`: Find GameObjects in the scene by various criteria.
- `find_in_file`: Search for content within Unity project files.
- `get_sha`: Get SHA hash of script content
- `get_test_job`: Get status of an async test job.
- `manage_animation`: Animator control, AnimatorController CRUD and AnimationClip operations.
- `manage_asset`: Create, modify, search and organize Unity assets.
- `manage_build`: Trigger player builds, switch platforms, configure settings, batch builds.
- `manage_components`: Add, remove and configure GameObject components.
- `manage_editor`: Control Editor state, play mode, preferences, undo/redo.
- `manage_gameobject`: Create, modify, transform and delete GameObjects.
- `manage_camera`: Manage Unity Camera and Cinemachine with presets, pipelines and blending.
- `manage_graphics`: Manage volumes, post-processing, light baking, rendering stats and URP features.
- `manage_material`: Create and modify Unity materials and shaders.
- `manage_packages`: Install, remove, embed packages and configure registries.
- `manage_physics`: Manage 3D and 2D physics settings, joints, queries, forces and simulation.
- `manage_prefabs`: Create, instantiate, unpack and modify prefabs.
- `manage_probuilder`: Create and edit ProBuilder meshes, shapes and geometry operations.
- `manage_profiler`: Profiler session control, counter reads, memory snapshots, Frame Debugger.
- `manage_scene`: Load, save, query hierarchy, multi-scene editing, templates and validation.
- `manage_script`: Create, read and modify C# scripts.
- `manage_script_capabilities`: Query script management capabilities
- `manage_scriptable_object`: Create and modify ScriptableObjects.
- `manage_shader`: Work with Unity shaders.
- `manage_texture`: Create and modify textures with patterns, gradients and noise.
- `manage_tools`: Manage which tool groups are visible in this session
- `manage_ui`: Manage UI Toolkit elements: UXML, USS and UIDocument components.
- `manage_vfx`: Manage visual effects, particle systems and trails.
- `read_console`: Read Unity Editor console output: logs, warnings, errors.
- `refresh_unity`: Refresh the Unity Editor asset database.
- `run_tests`: Run Unity Test Framework tests.
- `script_apply_edits`: Apply code edits to C# scripts with validation.
- `set_active_instance`: Set the active Unity Editor instance for multi-instance workflows.
- `unity_docs`: Fetch Unity ScriptReference, Manual and package docs.
- `unity_reflect`: Inspect Unity C# APIs via live reflection.
- `validate_script`: Validate C# script syntax and compilation.

## Example prompts

- "Create a cube at the origin and add a Rigidbody to it"
- "Write a PlayerController C# script and attach it to the Player object"
- "Run all play mode tests and show me the failures"
- "Read the Unity console and tell me what errors are present"

## Install

### Claude Code

1. Run this in a terminal, in your project folder:

```bash
claude mcp add --transport stdio unity -- uvx --from mcpforunityserver mcp-for-unity --transport stdio
```

2. Start Claude Code and type `/mcp`. **unity** should show as connected.

Add `--scope user` to make it available in every project.

### Claude Desktop

1. Open **Settings → Developer → Edit Config**. It opens `claude_desktop_config.json`. Add:

`claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "unity": {
      "command": "uvx",
      "args": [
        "--from",
        "mcpforunityserver",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}
```

2. Save the file and restart Claude Desktop.

Needs uv (Python) on your computer. The file lives in `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\Claude\` on Windows.

### Cursor

[Add to Cursor](<https://cursor.com/install-mcp?name=unity&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJtY3Bmb3J1bml0eXNlcnZlciIsIm1jcC1mb3ItdW5pdHkiLCItLXRyYW5zcG9ydCIsInN0ZGlvIl19>) (opens Cursor)

Or add it by hand to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project):

`mcp.json`:

```json
{
  "mcpServers": {
    "unity": {
      "command": "uvx",
      "args": [
        "--from",
        "mcpforunityserver",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}
```

Needs uv (Python) on your computer.

### VS Code

[Install in VS Code](<https://vscode.dev/redirect/mcp/install?name=unity&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22mcpforunityserver%22%2C%22mcp-for-unity%22%2C%22--transport%22%2C%22stdio%22%5D%7D>) (opens VS Code)

Or from a terminal:

```bash
code --add-mcp '{"name":"unity","type":"stdio","command":"uvx","args":["--from","mcpforunityserver","mcp-for-unity","--transport","stdio"]}'
```

Or commit it to the repo in `.vscode/mcp.json`:

`.vscode/mcp.json`:

```json
{
  "servers": {
    "unity": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "mcpforunityserver",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}
```

Needs uv (Python) on your computer.

### Devin Desktop

1. Add it to `~/.config/devin/mcp_config.json` (macOS and Linux) or `%APPDATA%\devin\mcp_config.json` (Windows):

`mcp_config.json`:

```json
{
  "mcpServers": {
    "unity": {
      "command": "uvx",
      "args": [
        "--from",
        "mcpforunityserver",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}
```

2. Refresh the MCP server list in Cascade.

Devin Desktop is the new name for Windsurf.

### Codex

```bash
codex mcp add unity -- uvx --from mcpforunityserver mcp-for-unity --transport stdio
```

Or edit `~/.codex/config.toml` directly:

`config.toml`:

```toml
[mcp_servers.unity]
command = "uvx"
args = ["--from", "mcpforunityserver", "mcp-for-unity", "--transport", "stdio"]
```

Needs uv (Python) on your computer.

### Gemini CLI

```bash
gemini mcp add unity uvx -- --from mcpforunityserver mcp-for-unity --transport stdio
```

This adds it to the current project. Add `-s user` to use it everywhere.

### Any client

Most clients that start local servers accept this shape:

```json
{
  "mcpServers": {
    "unity": {
      "command": "uvx",
      "args": [
        "--from",
        "mcpforunityserver",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}
```

Zed puts servers under `context_servers` in its settings, with the same `command`, `args` and `env` fields.

Needs uv (Python) on your computer.

## Details

- Server version: 10.2.0
- Last checked: 2026-10-03
- Listed: 2026-10-03
- Updated: 2026-10-03

---
Source: https://mcp.tc/i/unity (mcp.tc is an independent directory, not affiliated with this server's publisher). Corrections: https://mcp.tc/report
