Skip to content

Error: connection closed when triggering play mode tests #62

@YintheCloud

Description

@YintheCloud

In Unity Editor Project Settings -> Enter Play Mode Settings: already set to "Do not reload domain or scene"

It was able to start the tests, and then connection is lost (with following error messages)
Is this a known issue?

From unity console:

[MCP Unity] WebSocket error: An error has occurred in sending data.
UnityEngine.Debug:LogError (object)
McpUnity.Utils.McpLogger:LogError (string) (at ./Library/PackageCache/com.gamelovers.mcp-unity@ac4a46a19f9a/Editor/Utils/Logger.cs:40)
McpUnity.Unity.McpUnitySocketHandler:OnError (WebSocketSharp.ErrorEventArgs) (at ./Library/PackageCache/com.gamelovers.mcp-unity@ac4a46a19f9a/Editor/UnityBridge/McpUnitySocketHandler.cs:149)
WebSocketSharp.Server.WebSocketBehavior:onError (object,WebSocketSharp.ErrorEventArgs)
WebSocketSharp.Ext:Emit<WebSocketSharp.ErrorEventArgs> (System.EventHandler`1<WebSocketSharp.ErrorEventArgs>,object,WebSocketSharp.ErrorEventArgs)
WebSocketSharp.WebSocket:error (string,System.Exception)
WebSocketSharp.WebSocket:Send (string)
WebSocketSharp.Server.WebSocketBehavior:Send (string)
McpUnity.Unity.McpUnitySocketHandler/d__3:MoveNext () (at ./Library/PackageCache/com.gamelovers.mcp-unity@ac4a46a19f9a/Editor/UnityBridge/McpUnitySocketHandler.cs:102)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

From Claude Code

⏺ Update Todos
⎿ ☐ Run play mode tests for blocks

⏺ Now let me run the play mode tests for blocks using the Unity MCP tool:

⏺ mcp-unity - run_tests (MCP)(testMode: "PlayMode", testFilter: "Block", returnOnlyFailures: false, returnWithLogs: true)
⎿ Error: Connection closed

⏺ Let me try running the tests without the filter first to see if the connection works:

⏺ mcp-unity - run_tests (MCP)(testMode: "PlayMode", returnOnlyFailures: true)
⎿ No (tell Claude what to do differently)

OS

Sequoia Version 15.5

Unity

6000.1.10f1

MCP Unity Server

1.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions