Unity MCP

v1.0.0Developer Toolsstable

Unity Editor integration with Model Context Protocol (MCP) enabling AI assistants like Claude to interact with Unity projects. Features a TypeScript MCP server and C# Unity plugin with extensible command handler architecture, TCP/IP communication, an

csharpmodel-context-protocoltypescriptunity-editor
Share:
131
Stars
0
Downloads
0
Weekly
0/5

What is Unity MCP?

Unity MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to unity editor integration with model context protocol (mcp) enabling ai assistants like claude to interact with unity projects. features a typescript mcp server and c# unity plugin with extensible comm...

Unity Editor integration with Model Context Protocol (MCP) enabling AI assistants like Claude to interact with Unity projects. Features a TypeScript MCP server and C# Unity plugin with extensible command handler architecture, TCP/IP communication, an

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Unity Editor integration with Model Context Protocol (MCP) e

Use Cases

Integrate AI assistants with Unity Editor for game development.
Control game engine operations through TypeScript MCP server.
isuzu-shiranui

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx unitymcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Unity MCP

Unity MCP is a framework that connects AI assistants such as Claude to the Unity Editor through the Model Context Protocol, enabling natural language control of your game development environment. It consists of a C# Unity plugin that runs an HTTP server inside the Editor (default port 27182) and a TypeScript MCP server that bridges it to any MCP-compatible client. Developers can use it to execute C# code at runtime via Roslyn, traverse scene hierarchies, inspect and mutate GameObject properties, capture screenshots of the Game or Scene view, and read console logs—all from an AI chat interface. This makes it possible to automate repetitive editor tasks, debug scenes interactively, and generate Unity scripts without leaving your AI assistant.

Prerequisites

  • Unity 2022.3 or newer (including Unity 6000 series)
  • Node.js 18.0.0 or newer installed on your machine
  • .NET / C# 9.0 support (included in recent Unity versions)
  • An MCP-compatible client such as Claude Desktop or Claude Code
  • Git installed for adding the package via Package Manager URL
1

Install the Unity C# plugin via Package Manager

Open the Unity Package Manager (Window > Package Manager), click the + button, select 'Add package from git URL', and enter the package URL. Unity will download and install the C# plugin automatically.

https://github.com/isuzu-shiranui/UnityMCP.git?path=jp.shiranui-isuzu.unity-mcp
2

Start the Unity HTTP server

Once the package is installed, go to Edit > Preferences > Unity MCP in the Unity Editor. Enable 'Auto-start on Launch' or click Start Server manually. The server listens on port 27182 by default (with automatic fallback to 27183-27199).

3

Install the TypeScript MCP server

The TypeScript server acts as the MCP bridge between your AI client and the Unity Editor HTTP server. Install it globally or run it via npx.

npx unitymcp
4

Configure your MCP client

Add the Unity MCP server entry to your Claude Desktop configuration file. The TypeScript server will auto-discover the running Unity Editor instance via UDP on port 27183.

{
  "mcpServers": {
    "unitymcp": {
      "command": "npx",
      "args": ["unitymcp"]
    }
  }
}
5

Verify connectivity

Restart Claude Desktop (or your MCP client) with Unity Editor open and the server running. Ask the assistant to list GameObjects in the current scene to confirm the connection is working.

# Quick health check from terminal
curl http://127.0.0.1:27182/health

Unity MCP Examples

Client configuration

Claude Desktop configuration for the Unity MCP TypeScript server with default settings.

{
  "mcpServers": {
    "unitymcp": {
      "command": "npx",
      "args": ["unitymcp"],
      "env": {
        "MCP_RELOAD_RETRY_MAX_MS": "15000"
      }
    }
  }
}

Prompts to try

Example prompts to use with Unity MCP in Claude Desktop or Claude Code.

- "List all GameObjects in the current scene"
- "Execute this C# snippet: return Camera.main.transform.position.ToString()"
- "Take a screenshot of the Game view"
- "Show me the last 20 console log entries including errors"
- "Inspect the Transform component of the Player object and show all properties"
- "Run the menu command GameObject > Create Empty"

Troubleshooting Unity MCP

MCP client reports 'connection refused' when the Unity Editor is open

Check Edit > Preferences > Unity MCP to confirm the server is running and note the actual port being used. If 27182 is taken, the server will use the next available port (27183-27199). Update your client config accordingly or enable UDP discovery so the TypeScript server finds the port automatically.

C# code execution returns compile errors

The `execute_code` endpoint uses Roslyn for dynamic compilation and requires fully qualified type names and proper using statements in the code snippet. Include necessary using directives at the top of your code string, for example `using UnityEngine;`.

After a Unity domain reload (entering Play mode), the server becomes unresponsive

Domain reloads restart the C# side of the server. The TypeScript bridge will retry for up to MCP_RELOAD_RETRY_MAX_MS milliseconds (default 15000). Wait a few seconds after entering or exiting Play mode before sending commands, or increase MCP_RELOAD_RETRY_MAX_MS in your environment.

Frequently Asked Questions about Unity MCP

What is Unity MCP?

Unity MCP is a Model Context Protocol (MCP) server that unity editor integration with model context protocol (mcp) enabling ai assistants like claude to interact with unity projects. features a typescript mcp server and c# unity plugin with extensible command handler architecture, tcp/ip communication, an It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Unity MCP?

Follow the installation instructions on the Unity MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Unity MCP?

Unity MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Unity MCP free to use?

Yes, Unity MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "unitymcp": { "command": "npx", "args": ["-y", "unitymcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Unity MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides