UnityMCP is a powerful Unity Editor plugin that implements the Model Context Protocol (MCP), enabling seamless integration between Unity and AI assistants. It provides real-time editor state monitoring, remote command execution, and comprehensive logging capabilities.
UnityMCP
Architecture
The project consists of two main components:
1. Unity Plugin (UnityMCPPlugin)
A Unity Editor plugin that provides:
Debug window for connection status and monitoring
WebSocket client for real-time communication
C# code execution engine
Comprehensive logging system
Editor state tracking and serialization
2. MCP Server (unity-mcp-server)
A TypeScript-based MCP server that exposes Unity Editor functionality through standardized tools:
Available Tools
get_editor_state
execute_editor_command
get_logs
Installation
Installing via Smithery
To install UnityMCP for Claude Desktop automatically via Smithery:
Prerequisites
Unity 2022.3 or later
Node.js 18 or later
npm 9 or later
Unity Plugin Setup
Copy the UnityMCPPlugin folder to your Unity project's Assets directory
Open Unity Editor
Access the plugin through Unity's top menu bar > UnityMCP > Debug Window
MCP Server Setup
Usage
Starting the Server
Connecting from Unity
Open your Unity project
Open the UnityMCP Debug Window (Window > UnityMCP > Debug Window)
The plugin will automatically attempt to connect to the MCP server
Monitor connection status and logs in the debug window
Example: Executing Commands
Development
Building the Server
Watching for Changes
Command execution timeout protection
The system provides comprehensive error handling for:
The project consists of two main components:
Debug window for connection status and monitoring
To install UnityMCP for Claude Desktop automatically via Smithery:
Example: Executing Commands
Security Features
Contributing
Commit your changes (git commit -m 'Add amazing feature')