CoplayDev/unity-mcp

Server version mismatch: package does not overwrite stale installed server, causing protocol incompatibility

Closed this issue · 4 comments

When installing or updating com.coplaydev.unity-mcp, the embedded Python server is not replacing an existing server at the install path. This leaves a stale server in place that may not be compatible with any updates to the Bridge -- or fail to install the new server, period. Result: Cursor/Claude cannot connect; MCP tools fail with timeout or parse errors.

Proposed fixes (minimal and safe)

  • Overwrite by default (tight coupling): Replace installed server with the package’s embedded server unless the user has explicitly set an override path.
  • Add a version/compat manifest to the embedded server, e.g. UnityMcpServer~/src/server_version.json:
{ "server_semver": "3.0.0", "protocol_version": 1, "package_fingerprint": "8ea9f21aad6f92ca85b12cf84393ce045c020f83" }
  • Enhance EnsureServerInstalled():
    • Read embedded manifest.
    • Read installed manifest (if any).
    • Overwrite if:
      • No server.py, or
      • Manifest missing, or
      • protocol_version differs, or
      • server_semver < embedded, or
      • package_fingerprint differs (optional optimization).

When installing or updating com.coplaydev.unity-mcp, the embedded Python server is not replacing an existing server at the install path. This leaves a stale server in place that may not be compatible with any updates to the Bridge -- or fail to install the new server, period. Result: Cursor/Claude cannot connect; MCP tools fail with timeout or parse errors.

Proposed fixes (minimal and safe)

  • Overwrite by default (tight coupling): Replace installed server with the package’s embedded server unless the user has explicitly set an override path.
  • Add a version/compat manifest to the embedded server, e.g. UnityMcpServer~/src/server_version.json:

{ "server_semver": "3.0.0", "protocol_version": 1, "package_fingerprint": "8ea9f21aad6f92ca85b12cf84393ce045c020f83" }

  • Enhance EnsureServerInstalled():

    • Read embedded manifest.

    • Read installed manifest (if any).

    • Overwrite if:

      • No server.py, or
      • Manifest missing, or
      • protocol_version differs, or
      • server_semver < embedded, or
      • package_fingerprint differs (optional optimization).

Great catch! I think the server is in the pyproject file as well. Maybe we can do a quick comparison and automatically repair the python environment if they're out of sync?

Note: "Repair Python Env" updates server.py, but not other files like the tools and other parts of the project

@dsarno I had this issue working on my updated tools. Best fix I think is to replace the server folder directly. Including the "Repair Python Env", it didn't repair anything at all haha

Fixed in 3.02