Provides real-time control of Unity Editor through 30+ tools for object manipulation, scene management, automated testing, asset operations, and play mode control. Enables AI-powered game development workflows including selecting/transforming objects, running tests, managing scenes, and executing editor commands.
Unity MCP
๐ฎ Control Unity Editor โข โก Execute ANY Unity API โข ๐ Simplified & Powerful
โจ What It Does
Unity MCP provides real-time control of Unity Editor via the Model Context Protocol. Use it from Claude Desktop, Cursor, or any MCP client to create and modify games with natural language prompts.
Feature | Description |
Execute any Unity API code with full UnityEngine/Editor access | |
Load, save, inspect scene hierarchy in real-time | |
Enter/exit play mode and monitor status programmatically | |
Retrieve and filter Unity console logs for debugging |
๐ Quick Setup
๐ Prerequisites
Node.js >= 18.0.0 - Download
Unity 2022.3 LTS or later - Download
Claude Desktop or any MCP client - Download
๐ฅ Installation
Method 1: Automatic Setup (Recommended) โก
One command does everything:
โ Installs the package โ Configures your MCP client automatically โ Ready to use immediately after restart
Method 2: Manual Setup ๐ ๏ธ
If you prefer to configure manually or use a different MCP client:
Step 1: Install the package globally
Step 2: Add to your MCP client configuration
Edit your MCP client config file:
Windows
%APPDATA%\\Claude\\claude_desktop_config.jsonmacOS
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux
~/.config/Claude/claude_desktop_config.json
Add this configuration:
Step 3: Restart your MCP client
๐ฎ Unity Editor Integration
Step 1: Add Package via Git URL
In Unity Editor:
Open Window โ Package Manager
Click the + button (top-left)
Select Add package from git URL...
Paste this URL:
https://github.com/muammar-yacoob/unity-mcp.git?path=/UnityPackageClick Add
Unity will install the package with all editor scripts:
๐ Bridge Installer - Beautiful wizard for AI client setup
โก WebSocket server - Fast, real-time communication (port 8090)
๐จ Control Panel UI - Status monitoring with ๐ข๐ ๐ดโช indicators
โ๏ธ ScriptableObject config - Persistent settings across sessions
โญ 8 Essential Tools - Simplified architecture with execute_csharp for unlimited flexibility
Step 2: Configure AI Client
After installation:
Open Tools โ Unity MCP โ Bridge Installer ๐ฏ Start here!
Follow the setup wizard to configure your AI client
The Bridge Installer will:
โ Check Node.js installation
๐ฏ Auto-configure Claude Desktop or Claude Code
๐ Provide manual config for other MCP clients
๐ Guide you to completion
Done! Use the Control Panel (Tools โ Unity MCP โ Control Panel) to manage settings and monitor your connection.
๐ Bridge Installer Guide
The Bridge Installer provides a beautiful wizard to configure your AI client in just a few clicks.
Opening the Installer
After installing the Unity package, open Unity and navigate to:
Wizard Steps
Step 1: Welcome & Requirements
View what you'll get
Check prerequisites
โ Unity 2022.3+
โ Node.js 18.0+
โ AI client (Claude Desktop, etc.)
Step 2: Node.js Verification
Automatic detection of Node.js version
Download link if not installed
Recheck button after installation
Step 3: Configure AI Client
Choose your setup method:
Option A: Claude Desktop (One-Click)
Automatically creates configuration at:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Restart reminder included
Option B: Claude Code / VSCode
Creates
.claude/config.jsonin your projectWorks with Claude Code CLI and VSCode MCP extension
Option C: Manual Configuration
Copy-paste ready JSON config
Platform-specific paths provided
For other MCP clients
Step 4: Complete!
Success confirmation
Next steps guide
Quick launch to Control Panel
Troubleshooting
Node.js not detected?
Download from nodejs.org
Restart Unity Editor
Click "Recheck Installation"
Can't connect?
Verify server is running (Control Panel)
Restart AI client after configuration
Check firewall isn't blocking ports
โก WebSocket Transport (Default)
Unity MCP uses WebSocket by default for maximum speed and real-time control.
Default Configuration
The WebSocket server in Unity auto-starts on port 8090 when you install the package.
Advanced Configuration
You can customize ports and timeouts via environment variables:
Variable | Description | Default |
| Transport type:
or
|
|
| WebSocket port |
|
| Request timeout (ms) |
|
Example with custom port:
Unity Editor Configuration
WebSocket server auto-starts when Unity loads. You can also:
Open Tools โ Unity MCP โ Control Panel to view status
Configure port in MCPConfig ScriptableObject
Manually restart via Tools โ Unity MCP โ Start WebSocket Server
Why WebSocket?
โก Lower latency - Real-time bidirectional communication
๐ Faster execution - Persistent connection, no handshake overhead
๐ Better for automation - Ideal for rapid command sequences
๐ก Modern protocol - JSON-RPC 2.0 over WebSocket
HTTP transport is still available as a fallback by setting
UNITY_MCP_TRANSPORT=http
๐ ๏ธ Available Tools
โญ execute_csharp
Tool | Description |
Execute ANY Unity operation with full UnityEngine and UnityEditor API access |
Example Usage:
Real-World Example - Build a Complete Game:
This single prompt creates an entire playable game by streaming C# code to Unity via MCP!
๐บ๏ธ Scene Operations (3 tools)
Tool | Description |
Get complete scene hierarchy with GameObjects, components, and transforms | |
Load scene by name or build index | |
Save current scene or all open scenes |
๐ Console & Logging (1 tool)
Tool | Description |
Retrieve Unity console logs with filtering by type (log/warning/error) |
๐งช Play Mode Testing (3 tools)
Tool | Description |
Enter play mode programmatically with optional pause | |
Exit play mode and return to edit mode | |
Check if Unity is in play mode, edit mode, or paused |
๐ฌ Example Commands
Object Selection & Manipulation:
"Use execute_csharp to select all enemies and move them 5 units up"
"Execute C# code to align all UI buttons horizontally"
"Use execute_csharp to duplicate the Player object 10 times in a circle"
"Find all cameras and set their field of view to 60"
Component Management:
"Add a Rigidbody component to all objects tagged 'Box'"
"Remove all AudioSource components from inactive objects"
"Set the color of all materials with 'Enemy' in their name to red"
"Enable collision on all objects in the 'Props' layer"
Scene Automation:
"Create 100 cubes in a 10x10 grid at y=0"
"Delete all objects with missing scripts"
"Parent all 'Weapon' tagged objects under the Player"
"Bake all lights and generate lightmap UVs"
Advanced Operations:
"Run the Build Player menu command"
"Install the TextMeshPro package"
"Create a new C# script called 'EnemyAI' in Assets/Scripts/"
"Execute a custom editor window that you define"
"Load the MainMenu scene"
"Show me the complete hierarchy of the current scene"
"Save all open scenes"
"Get the hierarchy and find all disabled objects"
"Enter play mode"
"Check if we're in play mode and show the console logs"
"Exit play mode and save the scene"
"Enter play mode, then use execute_csharp to simulate player input"
"Get all error logs from the console"
"Show me the last 10 warnings"
"Clear console, then use execute_csharp to log custom debug info"
๐๏ธ Unity Control Panel
Once installed, access the Control Panel via Tools โ Unity MCP โ Control Panel.
Features:
๐ข Real-time Status Monitoring
๐ข Connected - Server running normally
๐ Starting - Server is initializing
๐ด Error - Connection failed
โช Disconnected - Server stopped
โ๏ธ Server Settings (Collapsable)
Port configuration (default: 8090)
Auto-start on Unity load
Request timeout settings
Remote connections (โ ๏ธ use with caution)
โจ Features (Collapsable)
Console monitoring (max logs configurable)
Auto-refresh assets on changes
Verbose logging for debugging
โก Quick Actions (Collapsable)
๐ View Console Logs
๐ Refresh Assets
๐พ Save Scene
๐งน Clear Console
๐ Open Config
๐ Documentation
๐ง Tools Overview (Collapsable)
View all 8 essential tools categorized by type
Highlights execute_csharp as the killer tool
Quick reference without leaving Unity
โก Advanced Settings (Collapsable)
Undo/Redo support
Auto-backup scenes
Reset to defaults
Configuration is stored as a ScriptableObject:
Assets/Editor/UnityMCP/Resources/MCPConfig.asset
All settings persist across Unity sessions!
๐ฑ Support & Contributions
โญ Star the repo & I power up like Mario ๐
โ Devs run on coffee -
๐ฐ Crypto tips welcome - Tip in crypto
๐ค Contributions are welcome - , improve, PR!
๐ฅ Need help? โข
๐ Sponsor
Your support helps maintain and improve the tool. please consider .
Made with โค๏ธ for Game Devs โข Privacy Policy โข Terms of Service