- Home
- MCP servers
- Unity MCP Complex
Unity MCP Complex
- c#
2
GitHub Stars
c#
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"2996371275-unity_mcp_complex": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
],
"env": {
"UNITY_HOST": "192.168.1.100",
"UNITY_PORT": "8090",
"UNITY_REQUEST_TIMEOUT": "10"
}
}
}
}MCP Unity creates a bridge between the Unity Editor and an MCP-compliant Node.js server, enabling AI assistants to control and query your Unity projects. You can automate scene edits, asset management, tests, and other editor tasks through natural language prompts or MCP client tools, speeding up workflows and enabling AI-assisted development inside Unity.
How to use
You run a local MCP Unity server inside the Unity Editor and connect it to an MCP client (such as an AI assistant or IDE) over WebSocket. The client can request actions like selecting GameObjects, updating components, running tests, and executing Unity menu items. Start the server from the Unity Editor, then use your MCP client to send commands. The server exposes a set of tools and resources that your AI can invoke to perform common editor tasks without manual clicks.
How to install
Prerequisites you need before starting:
-
Node.js 18 or later
-
npm 9 or later
-
Unity 2022.3 or later
How to install
Step 1. Install Node.js
How to install
Windows: install Node.js using the Windows Installer for the LTS version, then verify with node --version.
How to install
macOS: install Node.js using the macOS installer for the LTS version, or run brew install node@18 if you have Homebrew, then verify with node --version.
How to install
Step 2. Install the Unity MCP Server package via Unity Package Manager
How to install
- Open Unity
How to install
- Go to Window > Package Manager
How to install
- Click the + button and choose Add package from git URL…
How to install
- Enter:
https://github.com/CoderGamester/mcp-unity.gitand click Add
How to configure the client
Option 1: Configure using the Unity Editor
How to configure the client
- Open the Unity Editor
How to configure the client
- Navigate to Tools > MCP Unity > Server Window
How to configure the client
- Click the Configure button for your AI LLM client as shown in the interface
How to configure the client
- Confirm the configuration installation when prompted
How to configure the client
Option 2: Configure Manually
How to configure the client
Open the MCP configuration file for your AI client and paste the following, replacing ABSOLUTE/PATH/TO with your path to the MCP Unity installation.
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
]
}
}
}
How to start the server
Step 1. Open the Unity Editor
How to start the server
Step 2. Open Tools > MCP Unity > Server Window
How to start the server
Step 3. Click Start Server to start the WebSocket server
How to start the server
Step 4. Open your MCP client and begin issuing Unity editor commands
Optional: Set WebSocket Port
The default WebSocket port is 8090. To change it
Optional: Set WebSocket Port
- Open Unity Editor
Optional: Set WebSocket Port
- Go to Tools > MCP Unity > Server Window
Optional: Set WebSocket Port
- Change the WebSocket Port value
Optional: Set WebSocket Port
- Restart Node.js server to apply changes
Optional: Set Timeout
You can adjust the request timeout between and the MCP server
Optional: Set Timeout
- Open Unity Editor
Optional: Set Timeout
- Go to Tools > MCP Unity > Server Window
Optional: Set Timeout
- Change the Request Timeout (seconds) value
Optional: Set Timeout
- Restart the Node.js server
Optional: Enable Remote Connections
To allow remote MCP bridge connections
Optional: Enable Remote Connections
- Open Unity Editor
Optional: Enable Remote Connections
- Go to Tools > MCP Unity > Server Window
Optional: Enable Remote Connections
- Enable the Allow Remote Connections option
Optional: Enable Remote Connections
- Restart the Node.js server to apply changes
Debugging the Server
Building the Node.js Server
Debugging the Server
The MCP Unity server runs on Node.js and compiles TypeScript to JavaScript in a build directory. If issues arise, force install the server
Debugging the Server
Manual build steps
Debugging the Server
1. Open the Unity Editor
2. Tools > MCP Unity > Server Window
3. Click on "Force Install Server"
Debugging the Server
If you want to build it manually, run these commands from the Server directory
Debugging the Server
cd ABSOLUTE/PATH/TO/mcp-unity/Server~
npm install
npm run build
node build/index.js
Debugging with MCP Inspector
Debug the server with MCP Inspector using either PowerShell or a terminal
Debugging with MCP Inspector
npx @modelcontextprotocol/inspector node Server~/build/index.js
`
Debugging with MCP Inspector
npx @modelcontextprotocol/inspector node Server~/build/index.js
Enable Console Logs
Turn on logging in your terminal or log file to diagnose issues
Enable Console Logs
# Powershell
$env:LOGGING = "true"
$env:LOGGING_FILE = "true"
set LOGGING=true
set LOGGING_FILE=true
Frequently Asked Questions
Frequently Asked Questions
Why am I unable to connect? Ensure the WebSocket server is running, try forcing a reconnection, and verify the port configuration in the Server Window.
Support
If you need help, reach out through the provided channels for guidance and feedback.
Notes
Project path must not contain spaces to avoid MCP client connection issues.
Available tools
Executes Unity menu items (functions tagged with the MenuItem attribute) to perform editor actions like creating objects or triggering menu commands.
Selects GameObjects in the hierarchy by path or instance ID for further operations.
Updates a GameObject's core properties (name, tag, layer, active/static state) or creates the GameObject if it does not exist.
Updates or adds a component on a GameObject and sets its fields.
Installs new packages in the Unity Package Manager.
Runs tests using the Unity Test Runner.
Sends a console log message to Unity Editor.
Adds an asset from the AssetDatabase to the current scene.