Skip to content

ClearUvxCache turns uvx.exe into uvx.ex on Windows #423

@MyNameisPI

Description

@MyNameisPI

Description

In ServerManagementService.ClearUvxCache and ExecuteUvCommand, the code derives uv from uvx like this:

string uvxPath = MCPServiceLocator.Paths.GetUvxPath();
string uvCommand = uvxPath.Remove(uvxPath.Length - 1, 1);

On Windows, when GetUvxPath() returns ...\uvx.exe, this becomes ...\uvx.ex, which is invalid and causes the cache clear command to fail.

Suggested Fix

Build the uv path using the file name and extension instead of removing the last character:

var dir = Path.GetDirectoryName(uvxPath);
var ext = Path.GetExtension(uvxPath); // ".exe" or ""
var uvPath = Path.Combine(dir ?? string.Empty, "uv" + ext);

This works for both uvx and uvx.exe and avoids producing uvx.ex.

Environment

  • OS: Windows
  • Unity MCP package version: 8.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions