UnityMCP

UnityMCP is a Unity Editor plugin implementing the Model Context Protocol, enabling seamless integration between Unity and AI assistants. It offers real-time editor state monitoring, remote command execution, and logging capabilities.

428
41

UnityMCP

UnityMCP is a Unity Editor plugin that integrates the Model Context Protocol (MCP), facilitating communication between Unity and AI assistants. It offers real-time editor state monitoring, remote command execution, and logging.

Architecture:

The project includes:

  1. Unity Plugin (UnityMCPPlugin): Provides a debug window, WebSocket client, C# code execution engine, logging, and editor state tracking.
  2. MCP Server (unity-mcp-server): A TypeScript server exposing Unity Editor functionality through tools like get_editor_state (retrieves editor state), execute_editor_command (executes C# code), and get_logs (retrieves and filters logs).

Installation:

Install via Smithery or manually. Requires Unity 2022.3+, Node.js 18+, and npm 9+.

Usage:

Start the server and connect from Unity via the Debug Window. Execute commands like centering objects or toggling play mode using C# code.

Technical Details:

WebSocket communication on port 8080 with JSON messages. Includes command timeout protection, error handling, and log buffer management. Licensed under MIT License.

Repository

AR
Arodoid

Arodoid/UnityMCP

Created

January 15, 2025

Updated

March 28, 2025

Language

C#

Category

Developer Tools