Unity MCP
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
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
Maintainer
Works with
Installation
Manual Installation
npx unitymcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-mcpStart 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).
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 unitymcpConfigure 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"]
}
}
}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/healthUnity 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.
Unity MCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to Unity MCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Unity MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.