Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8ae595d
Update github-repo-stats.yml
dsarno Oct 10, 2025
83b16ea
Merge branch 'CoplayDev:main' into main
dsarno Oct 18, 2025
67be840
Merge branch 'CoplayDev:main' into main
dsarno Oct 21, 2025
f7ce27d
Merge branch 'CoplayDev:main' into main
dsarno Oct 24, 2025
83b9e47
Merge branch 'CoplayDev:main' into main
dsarno Oct 24, 2025
9dff8f1
Merge branch 'CoplayDev:main' into main
dsarno Oct 24, 2025
00fad91
Merge branch 'main' of https://github.com/CoplayDev/unity-mcp into main
dsarno Oct 27, 2025
74d35d3
Server: refine shutdown logic per bot feedback\n- Parameterize _force…
dsarno Oct 31, 2025
1bb280e
Revert "Server: refine shutdown logic per bot feedback\n- Parameteriz…
dsarno Oct 31, 2025
e6cc955
Merge branch 'CoplayDev:main' into main
dsarno Nov 1, 2025
532b30d
Merge branch 'CoplayDev:main' into main
dsarno Nov 5, 2025
5939d23
Merge branch 'CoplayDev:main' into main
dsarno Nov 6, 2025
9549dd4
Merge branch 'CoplayDev:main' into main
dsarno Nov 11, 2025
6ed7a35
Merge branch 'main' of https://github.com/CoplayDev/unity-mcp
dsarno Nov 25, 2025
aeceec3
Merge branch 'main' of github.com:dsarno/unity-mcp
dsarno Nov 25, 2025
2d7844c
fix: Add missing os and struct imports to port_discovery.py
dsarno Nov 25, 2025
d7cbbfb
Fix: Resolve absolute path for uvx to support Claude Desktop on macOS
dsarno Nov 26, 2025
e613607
fix: Add missing os and struct imports to port_discovery.py
dsarno Nov 25, 2025
d463aa5
Fix: Resolve absolute path for uvx to support Claude Desktop on macOS
dsarno Nov 26, 2025
b264bed
Merge branch 'fix/port-discovery-missing-imports' of https://github.c…
dsarno Nov 26, 2025
2850af8
Merge branch 'main' of https://github.com/CoplayDev/unity-mcp into fi…
dsarno Nov 26, 2025
293bd1f
fix: resolve Windows path issue in uv cache clearing (preserve .exe e…
dsarno Nov 26, 2025
7bfad3b
fix: wrap uvx in cmd /c for Windows clients to ensure PATH resolution
dsarno Nov 26, 2025
42b8eef
Fix: Increase port discovery timeout to 1.0s and fix uv cache cleanin…
dsarno Nov 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions MCPForUnity/Editor/Helpers/ExecPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,56 @@ private static string ResolveClaudeFromNvm(string home)
catch { return null; }
}

// Resolve uvx absolute path. Pref -> env -> common locations -> PATH.
internal static string ResolveUvx()
{
try
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
string home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) ?? string.Empty;
string[] candidates =
{
Path.Combine(home, ".local", "bin", "uvx"),
Path.Combine(home, ".cargo", "bin", "uvx"),
"/usr/local/bin/uvx",
"/opt/homebrew/bin/uvx",
"/usr/bin/uvx"
};
foreach (string c in candidates) { if (File.Exists(c)) return c; }

#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
return Which("uvx", "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin");
#else
return null;
#endif
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
#if UNITY_EDITOR_WIN
string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

string[] candidates =
{
Path.Combine(userProfile, ".cargo", "bin", "uvx.exe"),
Path.Combine(localAppData, "uv", "uvx.exe"),
Path.Combine(userProfile, "uv", "uvx.exe"),
};
foreach (string c in candidates) { if (File.Exists(c)) return c; }

string fromWhere = Where("uvx.exe") ?? Where("uvx");
if (!string.IsNullOrEmpty(fromWhere)) return fromWhere;
#endif
return null;
}
}
catch { }

return null;
}

// Explicitly set the Claude CLI absolute path override in EditorPrefs
internal static void SetClaudeCliPath(string absolutePath)
{
Expand Down
7 changes: 7 additions & 0 deletions MCPForUnity/Editor/Services/PathResolverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public string GetUvxPath()
McpLog.Debug("No uvx path override found, falling back to default command");
}

// Auto-discovery of absolute path
string discovered = ExecPath.ResolveUvx();
if (!string.IsNullOrEmpty(discovered))
{
return discovered;
}

return "uvx";
}

Expand Down
4 changes: 4 additions & 0 deletions MCPForUnity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Notes:
- Help: [Fix MCP for Unity with Cursor, VS Code & Windsurf](https://github.com/CoplayDev/unity-mcp/wiki/1.-Fix-Unity-MCP-and-Cursor,-VSCode-&-Windsurf)
- Claude CLI not found:
- Help: [Fix MCP for Unity with Claude Code](https://github.com/CoplayDev/unity-mcp/wiki/2.-Fix-Unity-MCP-and-Claude-Code)
- Claude Desktop "spawn uvx ENOENT" error on macOS:
- Claude Desktop may not inherit your shell's PATH.
- The MCP for Unity plugin attempts to automatically resolve the absolute path to `uvx`.
- If this fails, use the "Choose UV Install Location" button in the MCP for Unity window to select your `uvx` executable (typically `~/.local/bin/uvx`), or manually update your Claude Desktop config to use the absolute path to `uvx`.

---

Expand Down
2 changes: 2 additions & 0 deletions Server/src/transport/legacy/port_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import glob
import json
import logging
import os
import struct
from datetime import datetime
from pathlib import Path
import socket
Expand Down