unity-mcp
by CoplayDev
Overview
MCP for Unity acts as a bridge, allowing AI assistants to interact directly with the Unity Editor to manage assets, control scenes, edit scripts, and automate tasks.
Installation
uvx --from git+https://github.com/CoplayDev/unity-mcp@v8.1.6#subdirectory=Server mcp-for-unity --transport http --http-url http://localhost:8080Environment Variables
- PYTHONPATH
- UNITY_MCP_DEFAULT_INSTANCE
- UNITY_MCP_SKIP_STARTUP_CONNECT
- UNITY_MCP_TELEMETRY_ENABLED
- UNITY_MCP_TRANSPORT
- UNITY_MCP_HTTP_URL
- UNITY_MCP_HTTP_HOST
- UNITY_MCP_HTTP_PORT
- DISABLE_TELEMETRY
- UNITY_MCP_DISABLE_TELEMETRY
- MCP_DISABLE_TELEMETRY
- UNITY_MCP_TELEMETRY_ENDPOINT
- UNITY_MCP_TELEMETRY_TIMEOUT
Security Notes
The server's core function is to enable AI agents (LLMs) to perform highly privileged operations within the Unity Editor, including editing/creating C# scripts and executing arbitrary Unity menu items or custom C# tools. If the controlling LLM or user input is compromised or malicious, this can lead to arbitrary code execution and significant damage to the Unity project. While the server itself doesn't use dangerous functions like `eval` in Python (it uses `ast.literal_eval` safely) and doesn't contain obvious hardcoded secrets, its design inherently grants powerful capabilities. Binding to `0.0.0.0` (as shown in the Docker example) makes it network-accessible, increasing risk if not properly firewalled or isolated. The `precondition_sha256` for script edits and structured editing aim to mitigate unintended modifications but do not prevent maliciously intended code injection.
Similar Servers
cocos-mcp-server
Enables AI assistants to interact with the Cocos Creator editor through a Model Context Protocol (MCP) server, providing control over scene, node, component, asset, and project operations.
ncp
A unified Model Context Protocol (MCP) orchestrator that enables semantic tool discovery, management, scheduling, and execution across a diverse ecosystem of connected AI tools and services.
Unreal_mcp
Enables AI assistants to control and automate Unreal Engine via its Remote Control API for game development tasks.
unity-mcp
Enables AI agents (MCP clients) to interact with and perform actions within the Unity Editor, streamlining game development workflows and automating tasks.