Connects agents to the Unity Editor: menu items, object selection, packages, tests, console logs and hierarchy.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add unity --env UNITY_PORT='<UNITY_PORT>' -- node 'ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js'~/.codex/config.toml
[mcp_servers.unity]
command = "node"
args = ["ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"]
env = { UNITY_PORT = "<UNITY_PORT>" }
# codex mcp add unity --env UNITY_PORT='<UNITY_PORT>' -- node 'ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js'~/.cursor/mcp.json
{
"mcpServers": {
"unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
],
"env": {
"UNITY_PORT": "<UNITY_PORT>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"unity": {
"type": "stdio",
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
],
"env": {
"UNITY_PORT": "<UNITY_PORT>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
],
"env": {
"UNITY_PORT": "<UNITY_PORT>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
],
"env": {
"UNITY_PORT": "<UNITY_PORT>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
],
"env": {
"UNITY_PORT": "<UNITY_PORT>"
}
}
}
}Environment variables
UNITY_PORT
Replace the placeholders with your own credentials and keep them out of version control.