home / mcp / unity mcp integration mcp server
Enable AI Agents to Control Unity
Configuration
View docs{
"mcpServers": {
"quazaai-unitymcpintegration": {
"command": "node",
"args": [
"path-to-project>\\\\Library\\\\PackageCache\\\\com.quaza.unitymcp@d2b8f1260bca\\\\mcpServer\\\\mcpServer\\\\build\\\\index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "5010"
}
}
}
}You connect a Unity project to an MCP client to access real-time project data, edit files, run editor code, and monitor the Unity Editor from the MCP ecosystem. This server enables secure, targeted interactions with Unity—letting AI assistants understand your scene, inspect assets, and execute C# in the Editor while keeping your project safe and organized.
You will run the Unity MCP server locally and connect an MCP client to it. Once connected, you can browse and manipulate project files, inspect the scene hierarchy, execute C# in the Unity Editor, read logs, and control the Editor’s play mode. Use the MCP Debug window in Unity to verify the connection, test commands, and observe logs in real time.
Prerequisites you need before starting: Unity 2021.3 or later and Node.js 18+. These ensure you can run the Unity project alongside the MCP server.
Option A: Run the MCP server directly from the Unity package cache.
1. Open your project and locate the Unity MCP package cache path, typically under Library/PackageCache/com.quaza.unitymcp@<version>/mcpServer/.
2. Install dependencies.
npm install3. Start the MCP server.
node build/index.jsIf you manage MCP clients via a central MCP Host, add this server configuration to the host settings.
{
"mcpServers": {
"unity-mcp-server": {
"command": "node",
"args": [
"path-to-project>\\Library\\PackageCache\\com.quaza.unitymcp@d2b8f1260bca\\mcpServer\\mcpServer\\build\\index.js"
],
"env": {
"MCP_WEBSOCKET_PORT": "5010"
}
}
}
}If you prefer automatic installation for Claude Desktop or other MCP clients, you can install the Unity MCP Integration package via Smithery.
npx -y @smithery/cli install @quazaai/unitymcpintegration --client claudeAfter installation, you can access a variety of tools to interact with Unity. Ensure your Unity Editor is running and the MCP server is reachable via the configured port. Use the MCP Debug window in Unity to verify connectivity, test code execution, and monitor logs.
Architecture: The integration uses a Unity Plugin (C#) in the Editor and an MCP Server (TypeScript/Node.js) that communicates over WebSocket with JSON messages. File system access is constrained to your Unity project directory for security.
Security: Ensure you run the MCP server on a trusted host and limit access to your local network or secure environments. Use strong, unique ports and monitor connection activity via the Unity MCP Debug window.
Troubleshooting: If the MCP client cannot connect, verify that the MCP_WEBSOCKET_PORT matches your host configuration and that the Node.js server is running. Check Unity console logs for errors related to the MCP plugin.
The Unity MCP integration provides filesystem tools to read, edit, and list files within your project. All file operations are scoped to the Assets folder to protect your project integrity. Use the file tools to inspect scenes, assets, scripts, and configuration files, or to apply targeted edits with preview diffs.
Retrieve comprehensive information about the Unity project and current editor state.
Fetch detailed data about the active scene, including game objects and components.
Obtain information about specific GameObjects in the scene.
Execute C# code directly inside the Unity Editor context.
Access and filter Unity console logs for debugging and monitoring.
Check the active connection status between the MCP server and Unity Editor.
Read the contents of a file within the Unity project.
Read multiple files in a single request.
Create or overwrite a file with new content in the Unity project.
Apply targeted edits to existing files with a diff preview.
List files and folders in a specified directory.
Provide a hierarchical view of directories and files.
Search for files matching a pattern across the project.
Get metadata about a specific file or directory.
Find all assets of a given type, such as Material or Prefab.
List all C# scripts contained in the project.