Skip to content

[Bug]: Client handler error: Cannot access a disposed object #1232

Description

@Davidnovarro

What happened?

Please fix this issue. I am attaching the logs. This mostly happens after the domain reload or compilation

MCP-FOR-UNITY: Client handler error: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
UnityEngine.Debug:LogError (object)
MCPForUnity.Editor.Helpers.McpLog:Error (string) (at ./Library/PackageCache/com.coplaydev.unity-mcp@67381276459e/Editor/Helpers/McpLog.cs:50)
MCPForUnity.Editor.Services.Transport.Transports.StdioBridgeHost/<HandleClientAsync>d__43:MoveNext () (at ./Library/PackageCache/com.coplaydev.unity-mcp@67381276459e/Editor/Services/Transport/Transports/StdioBridgeHost.cs:641)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

Reproduction steps

Recompile.

Unity version

6000.2.15f1

MCP for Unity package version

9.7.2-beta.8

Python server version

No response

MCP client

Claude Desktop

Transport

stdio

OS

Windows

Relevant logs / console output


Checks

  • I searched existing issues and did not find a duplicate
  • I included logs / steps to reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions