CoplayDev/unity-mcp

connect offten failed

Closed this issue · 7 comments

during agent do work with, sometimes occur network exception like below:
mcp-for-unity-server - INFO - No responsive port found; using first seen value 6400
mcp-for-unity-server - WARNING - Unity communication attempt 5 failed: Could not connect to Unity

@BelieveXiaoShuai what version of mcp Unity package are you using? Come to our discord if you need more help.

@BelieveXiaoShuai what version of mcp Unity package are you using? Come to our discord if you need more help.

package version 3.2.2
unity version 6000.0.49

@BelieveXiaoShuai See if this message from our discord helps: https://discord.com/channels/1330955894296543364/1402495666512724018/1412813502913052712

Here is discord invite: https://discord.gg/fPhbSMCb

The connection issue I'm having is a bit different from the example you mentioned.

Unity Logs:
MCP-FOR-UNITY: [Start]
MCP-FOR-UNITY: MCPForUnityBridge started on port 6400. (OS=WindowsEditor, server=3.2.0)

logs:
2025-09-04 11:03:42.015 [info] Handling CallTool action for tool 'create_script'
2025-09-04 11:03:42.015 [info] Calling tool 'create_script' with toolCallId: tool_1081fe3d-fddd-4cee-aff7-128c54bcffe
2025-09-04 11:03:42.016 [error] 2025-09-04 11:03:42,016 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest

2025-09-04 11:03:42.016 [error] 2025-09-04 11:03:42,016 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest

2025-09-04 11:03:46.049 [error] 2025-09-04 11:03:46,049 - mcp-for-unity-server - ERROR - Failed to connect to Unity: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2025-09-04 11:03:46,049 - mcp-for-unity-server - WARNING - Unity communication attempt 1 failed: Could not connect to Unity

2025-09-04 11:03:46.049 [error] 2025-09-04 11:03:46,049 - mcp-for-unity-server - ERROR - Failed to connect to Unity: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2025-09-04 11:03:46,049 - mcp-for-unity-server - WARNING - Unity communication attempt 1 failed: Could not connect to Unity

2025-09-04 11:03:46.990 [error] 2025-09-04 11:03:46,990 - mcp-for-unity-server - INFO - No responsive port found; using first seen value 6400

2025-09-04 11:03:46.990 [error] 2025-09-04 11:03:46,990 - mcp-for-unity-server - INFO - No responsive port found; using first seen value 6400

2025-09-04 11:03:51.251 [error] 2025-09-04 11:03:51,251 - mcp-for-unity-server - ERROR - Failed to connect to Unity: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

2025-09-04 11:03:51.251 [error] 2025-09-04 11:03:51,251 - mcp-for-unity-server - ERROR - Failed to connect to Unity: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

2025-09-04 11:03:51.252 [error] 2025-09-04 11:03:51,251 - mcp-for-unity-server - WARNING - Unity communication attempt 2 failed: Could not connect to Unity

2025-09-04 11:03:51.252 [error] 2025-09-04 11:03:51,251 - mcp-for-unity-server - WARNING - Unity communication attempt 2 failed: Could not connect to Unity

If you have time please read this troubleshooting guide to see if it can help solve

Let me know @BelieveXiaoShuai

https://chatgpt.com/s/t_68b91c5b1acc8191abdfef8da0918b3f

I also frequently(nearly once per task) encontered this problem:
mcp-for-unity-server - ERROR - Error during framed receive: Connection closed before reading expected bytes 2025-09-05 02:23:05,778 - mcp-for-unity-server - WARNING - Unity communication attempt 1 failed: Connection closed before reading expected bytes 2025-09-05 02:23:39,691 - mcp-for-unity-server - ERROR - Error during framed receive: Connection closed before reading expected bytes 2025-09-05 02:23:39,691 - mcp-for-unity-server - WARNING - Unity communication attempt 1 failed: Connection closed before reading expected bytes

This should be fixed with recent update. Please give it a try and let us know.