{"record":{"id":"22d58f207a6e13b6","repo":"CoplayDev/unity-mcp","slug":"no-unity-plugins-are-currently-connected","errorCode":null,"errorMessage":"No Unity plugins are currently connected","messagePattern":"No Unity plugins are currently connected","errorType":"exception","errorClass":"NoUnitySessionError","httpStatus":null,"severity":"error","filePath":"Server/src/transport/plugin_hub.py","lineNumber":985,"sourceCode":"                time.monotonic() - wait_started,\n                unity_instance or \"default\",\n            )\n        if session_id is None and not target_hash and session_count > 1:\n            raise InstanceSelectionRequiredError(\n                InstanceSelectionRequiredError._MULTIPLE_INSTANCES)\n\n        if session_id is None and explicit_required and not target_hash and session_count > 0:\n            raise InstanceSelectionRequiredError()\n\n        if session_id is None:\n            logger.warning(\n                \"No Unity plugin reconnected within %.2fs (instance=%s)\",\n                max_wait_s,\n                unity_instance or \"default\",\n            )\n            # At this point we've given the plugin ample time to reconnect; surface\n            # a clear error so the client can prompt the user to open Unity.\n            raise NoUnitySessionError(\n                \"No Unity plugins are currently connected\")\n\n        return session_id\n\n    @classmethod\n    async def send_command_for_instance(\n        cls,\n        unity_instance: str | None,\n        command_type: str,\n        params: dict[str, Any],\n        user_id: str | None = None,\n        retry_on_reload: bool = True,\n    ) -> dict[str, Any]:\n        \"\"\"Send a command to a Unity instance.\n\n        Args:\n            unity_instance: Target instance (Name@hash or hash)\n            command_type: Command type to execute","sourceCodeStart":967,"sourceCodeEnd":1003,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/Server/src/transport/plugin_hub.py#L967-L1003","documentation":"Raised as NoUnitySessionError after the hub waited the full max_wait_s for a plugin WebSocket to register and none ever connected. It means the Unity side is not running the MCP for Unity plugin (or it was never installed/enabled), so there is no session to route to. This is the terminal 'Unity is not reachable' signal.","triggerScenarios":"session_id stays None through the entire wait loop, session_count is 0 (or the single/selected target never reconnects), so the final guard at plugin_hub.py:977-986 fires. Typical of Unity closed, plugin window closed, or a domain reload that did not finish re-registering.","commonSituations":"Unity Editor was quit or crashed; the MCP for Unity package is installed but the plugin bridge was stopped from its Advanced Settings; a script-compilation domain reload took longer than max_wait_s; firewall/network split the plugin from the hub.","solutions":["Open (or reopen) the Unity project and confirm the MCP for Unity plugin shows a 'Connected' status.","Retry the tool call once Unity finishes compiling; transient domain reloads can exhaust the wait window.","If the issue persists, check the plugin Advanced Settings (host/port match the server) and the server log for inbound WebSocket handshakes at /hub/plugin."],"exampleFix":"// before\nresult = await call_unity_tool('manage_gameobject', params)  # raises NoUnitySessionError\n// after\ntry:\n    result = await call_unity_tool('manage_gameobject', params)\nexcept NoUnitySessionError:\n    # prompt user to open Unity, then retry\n    await asyncio.sleep(2)\n    result = await call_unity_tool('manage_gameobject', params)","handlingStrategy":"retry","validationCode":"sessions = await hub.list_sessions()\nif not sessions:\n    raise RuntimeError('Unity is not connected; open the project first')","typeGuard":"def unity_reachable(sessions: list) -> bool:\n    return len(sessions) > 0","tryCatchPattern":"from transport.plugin_hub import NoUnitySessionError\nfor attempt in range(3):\n    try:\n        result = await call_unity_tool(cmd, params)\n        break\n    except NoUnitySessionError:\n        if attempt == 2:\n            raise\n        await asyncio.sleep(2)","preventionTips":["Confirm plugin 'Connected' status in Unity before the first call","Size max_wait_s to outlast domain reloads","Surface a clear 'open Unity' prompt to the user on this error"],"tags":["no-session","connectivity","unity","transport"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}