← MCP server and skill grades

unity-mcp

CoplayDev/unity-mcp

F
Type
MCP server
Scanned
Nov 13, 2026
Version
e2fd09c71644
Files read
2306

... wait NO! Do not include any extra text! Let me be extremely careful and output ONLY the JSON string. Let me reset output buffer in thought and just emit raw JSON. `{

What it can reach

Files
Reads, creates, edits, and deletes Unity project files, game builds, screenshots, and memory snapshots, imports 3D models from your disk, and updates AI assistant config files and logs in your user folders.
Network
Runs local servers to connect Unity and AI tools, connects to a local Blender app, downloads packages and Unity documentation, calls external AI and 3D asset services, and sends anonymous usage data by default.
Shell commands
Compiles and runs arbitrary C# code inside Unity and Python code in Blender, launches built game executables, runs command-line tools like Git and Python, and can download and run a tool installer script.
Secrets
Reads and stores API keys for AI services and remote servers in your operating system keychain, local encrypted files, environment variables, Unity settings, and AI client config files.
Browser
Opens web links from Unity Editor windows using your computer's default web browser or URL handler.
System
Controls Unity Editor menus and settings, checks and stops local server processes, and switches your active desktop window to Unity if background tests stall.

Findings

1 critical4 medium22 low1 info
  1. CriticalLocal HTTP server exposes command and plugin endpoints without authentication or Origin checks

    Server/src/main.py:414

    The Unity Editor plugin defaults to HTTP Local transport on 127.0.0.1:8080, where the Python server exposes POST /api/command, POST /register-tools, and WebSocket /hub/plugin with no password, token, Host check, or Origin header check. Because Starlette's request.json() parses JSON bodies even when sent with Content-Type text/plain, any website the user visits in a browser can send a cross-origin POST request to http://127.0.0.1:8080/api/command to invoke execute_code or create_script (running arbitrary C# and OS commands on the user's machine) or connect to ws://127.0.0.1:8080/hub/plugin to spoof sessions and register poisoned MCP tools.

    Fix: Require a per-launch random bearer token for all local HTTP and WebSocket routes (/api/command, /api/instances, /api/custom-tools, /register-tools, /hub/plugin, and /mcp), and reject requests with untrusted Origin or Host headers.

  2. MediumHTTP server allows binding to 0.0.0.0 without authentication unless --http-remote-hosted is set

    Server/src/main.py:932

    The Python server only enforces API-key authentication when --http-remote-hosted is explicitly enabled, not when bound to all network interfaces (0.0.0.0 or ::). Notably, the Docker setup instructions in Server/README.md tell users to run 'docker run -p 8080:8080 ... --transport http --http-url http://0.0.0.0:8080' without --http-remote-hosted or a loopback port binding, exposing unauthenticated MCP and /api/command endpoints (and full C# code execution in connected Unity Editors) to anyone on the local network.

    Fix: Refuse to bind to 0.0.0.0 or non-loopback addresses unless authentication (--http-remote-hosted or a bearer token) is enabled, and update Docker instructions to publish -p 127.0.0.1:8080:8080 for local use.

  3. MediumCross-tenant tool poisoning and visibility tampering in remote-hosted mode

    Server/src/transport/plugin_hub.py:551

    When deployed as a shared multi-user service with --http-remote-hosted, per-user session isolation is bypassed during WebSocket register_tools handling. Any authenticated user's plugin connection calls register_global_tools on the shared FastMCP server—exposing attacker-controlled tool names and prompt-injection descriptions to every other user's AI client via tools/list and broadcasting tools/list_changed across all sessions—and calls _sync_server_tool_visibility on global server transforms, allowing one tenant to disable built-in tool groups (such as core) for all other tenants.

    Fix: When config.http_remote_hosted is enabled, skip global FastMCP tool registration, skip server-wide _sync_server_tool_visibility transform mutations, and scope tool-list notifications strictly to MCP sessions belonging to the same user_id.

  4. MediumUnity stdio TCP bridge listens on localhost without authentication

    MCPForUnity/Editor/Services/Transport/Transports/StdioBridgeHost.cs:429

    When using stdio transport, StdioBridgeHost automatically starts a TCP listener on 127.0.0.1 (default port 6400, recorded in ~/.unity-mcp/unity-mcp-status-*.json) and executes framed JSON commands on the Unity Editor main thread with no shared secret or token check. Although the binary frame header blocks browser HTTP requests, any other user account or sandboxed process on the same machine with loopback access can connect and invoke execute_code or create_script to run arbitrary code as the Unity user.

    Fix: Generate a random per-instance secret with user-only file permissions (0600) in ~/.unity-mcp and require clients to present that token during the FRAMING=1 handshake before accepting commands.

  5. MediumDocker Compose exposes the unauthenticated HTTP server on all network interfaces

    docker-compose.yml:13

    docker-compose.yml publishes port 8080:8080 on all host network interfaces and starts the server with --http-host 0.0.0.0 without --http-remote-hosted (the same pattern appears in the docker run examples in Server/README.md). In non-remote-hosted HTTP mode, the server requires no API key and leaves /mcp and /api/command open without authentication. Once a Unity Editor connects, anyone on the same Wi-Fi or local network can send HTTP requests to port 8080 to invoke tools such as create_script or execute_code and run arbitrary code on the host machine.

    Fix: Bind the host port to loopback only by changing ports to 127.0.0.1:8080:8080 in docker-compose.yml and in the Server/README.md docker run examples, or require --http-remote-hosted with API key validation whenever binding to 0.0.0.0.

  6. LowPath traversal in manage_shader allows reading and writing files outside Assets

    MCPForUnity/Editor/Tools/ManageShader.cs:87

    Unlike ManageScript and ManageAsset, ManageShader only normalizes slashes on the caller-supplied path parameter and does not reject '..' segments or rooted paths before combining it with Application.dataPath. If an AI agent is tricked via prompt injection, calling manage_shader with '../' sequences in path lets it read, create, or overwrite arbitrary .shader files anywhere on the user's filesystem outside the Unity project.

    Fix: Resolve Path.GetFullPath on the target path and verify that it stays inside Application.dataPath (or validate with AssetGenPaths.TryGetAssetsFolder) before reading, creating, or writing files.

  7. LowUnsanitized screenshot fileName bypasses project-root folder restriction

    MCPForUnity/Editor/Tools/ManageScene.cs:1251

    Although ScreenshotUtility.ResolveFolderAbsolute blocks output_folder values that escape the Unity project root, ManageScene.CapturePositionedScreenshot (and ManageUI.RenderUI) combines the caller-supplied fileName directly with the validated folder path without stripping directory separators or '..' segments. A prompt-injected agent can pass traversal sequences in file_name to write rendered PNG files outside the Unity project directory.

    Fix: Sanitize fileName to strip path separators and '..' segments (or verify Path.GetFullPath(fullPath) remains inside folderAbsolute) before calling File.WriteAllBytes.

  8. Lowbatch_execute bypasses Unity Editor resource-disable toggles

    MCPForUnity/Editor/Tools/BatchExecute.cs:126

    Users can disable individual MCP tools and resources in the Unity Editor window, and TransportCommandDispatcher blocks direct calls to both disabled tools and disabled resources. However, BatchExecute only checks ToolDiscovery.IsToolEnabled and omits ResourceDiscovery.IsResourceEnabled before invoking CommandRegistry, which stores both tool and resource handlers, allowing an agent to read resources the user disabled.

    Fix: Check MCPServiceLocator.ResourceDiscovery.GetResourceMetadata and IsResourceEnabled in BatchExecute alongside the existing ToolDiscovery check before invoking CommandRegistry.

  9. LowAutomatic uv installer pipes an unpinned remote script directly into a shell

    MCPForUnity/Editor/Dependencies/UvInstaller.cs:47

    When uv is missing and the user clicks 'Install UV Automatically' in the setup window, UvInstaller downloads and executes https://astral.sh/uv/install.sh (or install.ps1 on Windows with -ExecutionPolicy ByPass) directly in a shell without pinning a release version or verifying a cryptographic checksum.

    Fix: Download a pinned uv release archive over HTTPS and verify its SHA-256 checksum before extracting and running it.

  10. Lowbatch_execute bypasses session tool-group restrictions and Python input validation

    Server/src/services/tools/batch_execute.py:106

    The batch_execute tool (enabled by default in the core group) forwards inner tool names and parameter dictionaries straight to Unity's C# dispatcher without checking whether each tool's group is enabled in the current FastMCP session and without running the Python tool wrappers' path/input checks. Even if a user or session deactivates high-risk groups such as scripting_ext (execute_code) or asset_gen (blender_bridge), a prompt-injected agent can still invoke those C# handlers directly through batch_execute.

    Fix: Validate each inner command in batch_execute against the active session's enabled tools and route commands through their Python tool functions (or enforce identical path and group checks in C#).

  11. LowUnrestricted file paths in manage_profiler allow arbitrary file overwrites and filesystem probing

    MCPForUnity/Editor/Tools/Profiler/Operations/SessionOps.cs:30

    The manage_profiler tool is marked with destructiveHint=False, yet neither the Python tool nor the Unity C# handlers restrict file paths to the project directory. A prompt-injected agent can pass any path on disk to profiler_start (log_file) or memory_take_snapshot (snapshot_path) to overwrite existing files with binary profiler/memory data, or pass arbitrary paths to memory_list_snapshots and memory_compare_snapshots to probe file existence, exact byte sizes, and timestamps outside the project.

    Fix: Restrict log_file, snapshot_path, search_path, snapshot_a, and snapshot_b to resolved paths inside the Unity project directory or temporary cache folder, refuse overwriting non-.raw/.snap files, and set destructiveHint=True.

  12. LowUnvalidated URL scheme passed to Application.OpenURL when fetching remote login URL

    MCPForUnity/Editor/Windows/Components/Connection/McpConnectionSection.cs:1008

    When the user clicks Get API Key in HTTP Remote mode, GetLoginUrlAsync fetches /api/auth/login-url without checking HttpEndpointUtility.IsCurrentRemoteUrlAllowed (allowing plaintext HTTP even when insecure remote HTTP is disabled) and passes the returned login_url directly to Application.OpenURL. A compromised remote server or network attacker on plaintext HTTP can return a file://, UNC, or custom OS protocol URI that Unity hands to the OS shell, potentially launching local executables or leaking credentials.

    Fix: Check HttpEndpointUtility.IsCurrentRemoteUrlAllowed before requesting /api/auth/login-url, and verify that loginUrl parses as an absolute URI with an https (or explicitly permitted http) scheme before calling Application.OpenURL.

  13. LowDocker instructions expose unauthenticated HTTP server on 0.0.0.0:8080

    Server/README.md:89

    The Docker setup commands in Server/README.md publish port 8080 on all host network interfaces (-p 8080:8080) and bind to 0.0.0.0 without enabling --http-remote-hosted authentication. Anyone on the same local network can reach /mcp and /api/command without a password or API key and run arbitrary commands in a connected Unity Editor.

    Fix: Bind the published Docker port to loopback by default (-p 127.0.0.1:8080:8080) in README examples and Dockerfile comments, and warn that 0.0.0.0 bindings require --http-remote-hosted authentication.

  14. LowUnescaped Sketchfab uid allows authenticated API path traversal

    MCPForUnity/Editor/Services/AssetGen/Providers/SketchfabAdapter.cs:42

    Unlike SearchAsync, PreviewAsync and ResolveDownloadUrlAsync concatenate the caller-supplied uid directly into https://api.sketchfab.com/v3/models/ + uid while attaching the user's Sketchfab API token. A prompt-injected agent calling import_model with uid='../me' or '../me/models' traverses to other authenticated Sketchfab v3 endpoints and receives the raw JSON of the user's private account profile, email, and private model metadata.

    Fix: Validate that uid contains only expected Sketchfab identifier characters (alphanumeric) and escape it with Uri.EscapeDataString before building the request URL.

  15. LowMissing path traversal check when creating prefab and volume profile directories

    MCPForUnity/Editor/Tools/GameObjects/GameObjectCreate.cs:303

    Unlike ManagePrefabs, GameObjectCreate (when saveAsPrefab is true) and VolumeOps.CreateVolume do not pass prefabPath or profile_path through AssetPathUtility.SanitizeAssetPath before calling Directory.CreateDirectory. A prompt-injected agent can supply relative '..' segments or absolute paths to create directories outside Assets/ or overwrite existing prefabs without an overwrite flag.

    Fix: Validate prefabPath and profile_path with AssetPathUtility.SanitizeAssetPath and verify the resolved full path stays under the project's Assets/ folder before creating directories or saving assets.

  16. LowUnpinned PyPI package in manifest.json downloads latest server code at runtime

    manifest.json:25

    Although manifest.json is versioned as 10.3.0, its mcp_config launches uvx --from mcpforunityserver mcp-for-unity without pinning a package version. Installing from this manifest pulls and runs whichever version of mcpforunityserver is currently latest on PyPI rather than the version reviewed by the user.

    Fix: Pin the package specification in manifest.json to the matching release version (for example, mcpforunityserver==10.3.0).

  17. LowUsage telemetry is enabled by default despite website claiming no telemetry by default

    Server/src/services/tools/__init__.py:63

    Every MCP tool, resource, and Unity bridge startup is wrapped with opt-out telemetry unless DISABLE_TELEMETRY=1 (or the EditorPrefs toggle) is set. While Server/README.md documents the opt-out variables, the root README.md omits mention of telemetry and website/src/components/HomeCloser/index.js inaccurately states 'no telemetry by default'.

    Fix: Make telemetry opt-in by default, or clearly disclose opt-out telemetry in the main README.md and remove the inaccurate claim from the website.

  18. LowMCPB bundle manifest downloads and runs an unpinned PyPI package at runtime

    manifest.json:25

    When a user installs a versioned .mcpb release bundle, manifest.json launches the server with uvx --from mcpforunityserver mcp-for-unity without pinning the package version to 10.3.0. Because the bundle omits the Server directory and downloads mcpforunityserver from PyPI at runtime, uvx can pull and execute a newer unreviewed release rather than the version matching the bundle.

    Fix: Pin the PyPI package to the exact release version (mcpforunityserver==10.3.0) in manifest.json and keep it synchronized in tools/update_versions.py and tools/generate_mcpb.py.

  19. LowBlender handoff skill writes and imports from a predictable path in the shared temp folder

    .claude/skills/blender-to-unity/SKILL.md:35

    The blender-to-unity skill instructs the agent to export models to a hardcoded filename (blender_to_unity.fbx or blender_to_unity.glb) directly inside tempfile.gettempdir() and then import that path into Unity. On multi-user systems where /tmp or the temp directory is shared, another local user can pre-create a symlink to overwrite the user's files during export or swap the file before Unity imports it.

    Fix: Create a private per-run temporary directory with tempfile.mkdtemp() and write the exported FBX or GLB file inside that directory.

  20. LowWSL2 troubleshooting guide forwards all external interfaces to the unauthenticated local server

    website/docs/guides/troubleshooting.md:81

    The WSL2 setup instructions tell Windows users to forward listenaddress=0.0.0.0:8090 to 127.0.0.1:8090 via netsh interface portproxy (which persists across reboots) and add an unrestricted inbound Windows Firewall allow rule on port 8090 across all profiles, including Public Wi-Fi. Because portproxy connects locally to 127.0.0.1, this bypasses MCP for Unity's loopback-only check and exposes the unauthenticated local HTTP server to anyone on the same network.

    Fix: Update the WSL2 guide to bind listenaddress only to the Windows host IP on the vEthernet (WSL) interface and scope New-NetFirewallRule with -InterfaceAlias "vEthernet (WSL)" so external networks cannot reach the forwarded port.

  21. LowTest project manifest pulls an unpinned third-party Git package without a lockfile

    TestProjects/UnityMCPTests/Packages/manifest.json:10

    TestProjects/UnityMCPTests/Packages/manifest.json depends on https://github.com/Asuta/com.unity.ide.windsurf.git with no commit hash or tag, while its packages-lock.json is ignored by git. Although end users who install Unity MCP never run this test project, contributors opening it locally and CI jobs running with Unity license secrets will fetch and execute whatever Editor C# code is currently at HEAD of that external repository.

    Fix: Remove com.unity.ide.windsurf from the test project manifest if it is not required for automated tests, or pin the URL to a specific audited commit SHA and track packages-lock.json.

  22. LowUnpinned PyPI package executed at runtime in MCP manifest

    manifest.json:25

    Although manifest.json declares version 10.3.0, its mcp_config launches uvx with the unpinned package name mcpforunityserver. Whenever uvx resolves or refreshes the package from PyPI, it downloads and runs the latest published release rather than locking to version 10.3.0, increasing exposure if the PyPI package is ever compromised.

    Fix: Pin the exact server version in manifest.json args, such as mcpforunityserver==10.3.0.

  23. LowDocker HTTP instructions publish unauthenticated server on all network interfaces and use latest tag

    Server/README.md:89

    The Docker setup instructions for local MCP clients use -p 8080:8080 without a 127.0.0.1 host bind and without --http-remote-hosted authentication, while also pulling an unpinned :latest image tag. In Docker, -p 8080:8080 exposes port 8080 on 0.0.0.0 of the host machine, allowing anyone on the same local network to connect to the unauthenticated MCP server and run arbitrary C# code in a connected Unity Editor.

    Fix: Bind the host port to loopback (-p 127.0.0.1:8080:8080) in local Docker instructions, require --http-remote-hosted behind HTTPS for network access, and pin a specific image version or digest.

  24. LowRemote-hosted client example sends X-API-Key over unencrypted HTTP

    Server/README.md:227

    The example MCP client configuration for remote-hosted mode sends the X-API-Key header to an unencrypted http://remote-server:8080/mcp URL. Unlike the Unity Editor plugin (which blocks plaintext remote HTTP by default), MCP clients will follow this configuration as written and transmit the user's API key and Unity commands in cleartext over the network.

    Fix: Use an https:// URL in the remote-hosted client configuration example and warn against sending X-API-Key over plaintext HTTP.

  25. LowBlender-to-Unity skill uses a predictable filename in the shared temp directory

    .claude/skills/blender-to-unity/SKILL.md:35

    Step 2 of the blender-to-unity skill instructs the agent to export models to a hardcoded filename (blender_to_unity.fbx or blender_to_unity.glb) directly inside tempfile.gettempdir(), and Step 3 imports that path into Unity. On multi-user Linux systems where /tmp is shared, another local user can pre-create or replace that file between export and import to inject attacker-chosen assets into the Unity project.

    Fix: Create a private per-export directory with tempfile.mkdtemp() and write the exported file inside it before importing into Unity.

  26. LowBlender-to-Unity skill instructs the agent to bypass tool-group gating via batch_execute

    .claude/skills/blender-to-unity/SKILL.md:20

    The skill explicitly advises the agent that when asset_gen tools are off by default, it can bypass tool-group gating by calling the C# handler directly through batch_execute. Encouraging the agent to route around disabled tool groups undermines session scoping and user expectations when non-core tool groups are intentionally kept off.

    Fix: Remove the batch_execute bypass instruction from the skill and require enabling the group via manage_tools or asking the user when a tool is disabled.

  27. LowUnpinned third-party GitHub dependency in test Unity project

    TestProjects/UnityMCPTests/Packages/manifest.json:10

    The Unity test project manifest pulls com.unity.ide.windsurf directly from the default branch of a third-party GitHub repository without pinning a commit hash or tag. Installed users never run this test project, but any contributor opening TestProjects/UnityMCPTests in Unity will automatically fetch and compile the latest upstream Editor code.

    Fix: Pin the git URL to a verified commit SHA or remove the third-party IDE package from the test project manifest.

  28. InfoAnonymous usage telemetry and truncated error messages are sent by default

    Server/src/core/telemetry.py:152

    On startup and on every tool or resource call, the server sends anonymous usage events (including a persistent customer UUID, OS and Python versions, tool/resource names, sub-actions, and the first 200 characters of exception messages, which may contain local paths) to https://api-prod.coplay.dev/telemetry/events unless disabled via DISABLE_TELEMETRY=1.

    Fix: Scrub local filesystem paths from exception strings before sending telemetry, and mention the default-on telemetry and opt-out setting prominently in the root README and manifest.