Provides real-time control of Unity Editor through HTTP API, enabling AI agents to manipulate game objects, manage scenes, automate testing, and perform batch operations with undo support
Unity MCP
๐ฎ Control Unity Editor โข โก Real-time automation โข ๐ AI-powered workflows
โจ What It Does
Unity MCP provides real-time control of Unity Editor through the Model Context Protocol allowing you to:
Feature | Description |
Select, move, rotate, and scale objects with natural language | |
Align, distribute, duplicate objects with undo support | |
Enter play mode and run test scenarios programmatically | |
Load, save, inspect scene hierarchy in real-time |
๐ Quick Setup
๐ Prerequisites
Node.js >= 18.0.0 - Download
Unity 2022.3 LTS or later - Download
Claude Desktop or any MCP client - Download
๐ฅ Installation
โ ๏ธ REQUIRED: You must install Unity MCP before using any of its tools.
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.json
macOS
~/Library/Application Support/Claude/claude_desktop_config.json
Linux
~/.config/Claude/claude_desktop_config.json
Add this configuration:
Step 3: Restart your MCP client
๐ฎ Unity Editor Integration
Why is this needed? Unity MCP installs C# editor scripts into your Unity project that create an HTTP server on port 8080. The MCP tools communicate with Unity through this server.
Setup Steps:
Open your MCP client (e.g., Claude Desktop or Claude Code)
Tell Claude:
Setup Unity MCP in my project at /path/to/unity/projectThis installs 4 C# scripts to
Assets/Editor/UnityMCP/
:MCPEditorServer.cs
- HTTP serverEditorCommandHandler.cs
- Command processor with undo supportPlayModeHandler.cs
- Play mode automationSceneHandler.cs
- Scene operations
Restart Unity Editor
Verify in Console:
[Unity MCP] Server started on port 8080
Done! The MCP tools can now control Unity Editor via HTTP.
๐ ๏ธ Available Tools
Safe Operations (Read-only)
Tool | Description |
Install editor integration into Unity project | |
Select by name, tag, or pattern with framing | |
Find by component type or pattern | |
List all scenes in build settings | |
Get complete scene hierarchy | |
Find objects in current scene | |
Get play mode status and logs |
Modifications (With Undo Support)
Tool | Description |
Move, rotate, scale objects | |
Align left/right/top/bottom/center | |
Distribute evenly along axis | |
Clone objects with undo support | |
Start play mode programmatically | |
Exit play mode programmatically | |
Execute automated test scenarios | |
Slow motion or fast forward | |
Load scene by name or index | |
Save current or all scenes |
Destructive Operations (Use with Caution)
Tool | Description |
Delete objects with undo support | |
Remove missing scripts and empty objects |
๐ฌ Example Commands
"Select all objects with tag 'Enemy' and align them horizontally"
"Move the Player object to position (0, 5, 10)"
"Distribute selected objects evenly along the x axis"
"Find all objects with Camera component"
"Duplicate selected object 5 times"
"Enter play mode and move Player to (10, 0, 0) for 5 seconds"
"Set time scale to 0.5 for slow motion"
"Run a test that destroys the Boss after 2 seconds"
"Check play mode status and show test logs"
"List all scenes in the project"
"Load the MainMenu scene"
"Show me the complete hierarchy of the current scene"
"Find all objects with Rigidbody component"
"Clean up scene by removing missing scripts"
๐ Troubleshooting
MCP Server Not Showing:
Verify Node.js is installed:
node --version
Check config file path is correct
Ensure JSON syntax is valid
Restart MCP client completely
Unity Editor Not Responding:
Ensure Unity Editor is open
Check
Assets/Editor/UnityMCP/
scripts are installedVerify Console for
[Unity MCP] Server started on port 8080
Check no errors in Unity Console
Port Already in Use:
Default port is
8080
Check what's using it:
lsof -i :8080
(Mac/Linux) ornetstat -ano | findstr :8080
(Windows)Stop conflicting process or change port in Unity scripts
๐ฑ 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
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables real-time control of Unity Editor through natural language commands, allowing AI to manipulate game objects, run automated tests, manage scenes, and perform batch operations with undo support.