Back to Home
CoplayDev icon

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

Run Command
uvx --from git+https://github.com/CoplayDev/unity-mcp@v8.1.6#subdirectory=Server mcp-for-unity --transport http --http-url http://localhost:8080

Environment 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

Stats

Interest Score100
Security Score4
Cost ClassMedium
Avg Tokens500
Stars4144
Forks553
Last Update2025-12-05

Tags

AI AssistantUnity EditorAutomationGame DevelopmentLLM Integration