Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
81072b2
Remove legacy UI and correct priority ordering of menu items
msanatan Oct 23, 2025
eddfafa
Remove old UI screen
msanatan Oct 23, 2025
3644718
Remove unused config files
msanatan Oct 23, 2025
1fcacda
Remove test for window that doesn't exist
msanatan Oct 23, 2025
364216c
Remove unused code
msanatan Oct 23, 2025
a6f30e4
Merge branch 'main' into trim-ui-and-streamline-docs
msanatan Oct 23, 2025
846dc1c
Remove dangling .meta file
msanatan Oct 23, 2025
d9e3d7c
refactor: remove client configuration step from setup wizard
msanatan Oct 23, 2025
1fbdfa0
refactor: remove menu item attributes and manual window actions from …
msanatan Oct 23, 2025
8131672
feat: update minimum Python version requirement from 3.10 to 3.11
msanatan Oct 23, 2025
24ce59a
fix: replace emoji warning symbol with unicode character in setup wiz…
msanatan Oct 23, 2025
921bfa5
docs: reorganize images into docs/images directory and update references
msanatan Oct 23, 2025
91ce7c9
docs: add UI preview image to README
msanatan Oct 23, 2025
1d9f20d
docs: add run_test function and resources section to available tools …
msanatan Oct 23, 2025
1a6fded
fix: add SystemRoot env var to Windows config to support Python path …
msanatan Oct 23, 2025
fe7e4cb
refactor: consolidate package installation and detection into unified…
msanatan Oct 23, 2025
3cd4e2b
Doc fixes from CodeRabbit
msanatan Oct 23, 2025
90ab3e0
Excellent bug catch from CodeRabbit
msanatan Oct 23, 2025
1b478a0
fix: preserve existing environment variables when updating codex serv…
msanatan Oct 23, 2025
37e7d67
Update docs so the paths match the original name
msanatan Oct 23, 2025
f4cbc11
style: fix list indentation in README-DEV.md development docs
msanatan Oct 23, 2025
13cedcd
refactor: simplify env table handling in CodexConfigHelper by removin…
msanatan Oct 23, 2025
4de02b3
refactor: simplify configuration logic by removing redundant change d…
msanatan Oct 23, 2025
ff2c15c
feat: ensure config directory exists before writing config files
msanatan Oct 23, 2025
d02c5ec
feat: persist server installation errors and show retry UI instead of…
msanatan Oct 23, 2025
592e337
refactor: consolidate configuration helpers by merging McpConfigFileH…
msanatan Oct 23, 2025
cb65568
Small fixes from CodeRabbit
msanatan Oct 23, 2025
6b65184
Remove test because we overwrite Codex configs
msanatan Oct 23, 2025
723ea28
Remove unused function
msanatan Oct 23, 2025
b3af091
feat: improve server cleanup and process handling on Windows
msanatan Oct 24, 2025
1217c5c
fix: improve TCP socket cleanup to prevent CLOSE_WAIT states
msanatan Oct 24, 2025
f0e2c06
Merge branch 'main' into trim-ui-and-streamline-docs
msanatan Oct 24, 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
17 changes: 0 additions & 17 deletions MCPForUnity/Editor/Data/DefaultServerConfig.cs

This file was deleted.

2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Dependencies/DependencyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static void GenerateRecommendations(DependencyCheckResult result, IPlatf
{
if (dep.Name == "Python")
{
result.RecommendedActions.Add($"Install Python 3.10+ from: {detector.GetPythonInstallUrl()}");
result.RecommendedActions.Add($"Install Python 3.11+ from: {detector.GetPythonInstallUrl()}");
}
else if (dep.Name == "UV Package Manager")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override DependencyStatus DetectPython()
}
}

status.ErrorMessage = "Python not found. Please install Python 3.10 or later.";
status.ErrorMessage = "Python not found. Please install Python 3.11 or later.";
status.Details = "Checked common installation paths including system, snap, and user-local locations.";
}
catch (Exception ex)
Expand Down Expand Up @@ -144,10 +144,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
version = output.Substring(7); // Remove "Python " prefix
fullPath = pythonPath;

// Validate minimum version (Python 4+ or Python 3.10+)
// Validate minimum version (Python 4+ or Python 3.11+)
if (TryParseVersion(version, out var major, out var minor))
{
return major > 3 || (major >= 3 && minor >= 10);
return major > 3 || (major >= 3 && minor >= 11);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public override DependencyStatus DetectPython()
"/opt/homebrew/bin/python3",
"/Library/Frameworks/Python.framework/Versions/3.13/bin/python3",
"/Library/Frameworks/Python.framework/Versions/3.12/bin/python3",
"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3",
"/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
};

foreach (var candidate in candidates)
Expand Down Expand Up @@ -65,7 +64,7 @@ public override DependencyStatus DetectPython()
}
}

status.ErrorMessage = "Python not found. Please install Python 3.10 or later.";
status.ErrorMessage = "Python not found. Please install Python 3.11 or later.";
status.Details = "Checked common installation paths including Homebrew, Framework, and system locations.";
}
catch (Exception ex)
Expand Down Expand Up @@ -144,10 +143,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
version = output.Substring(7); // Remove "Python " prefix
fullPath = pythonPath;

// Validate minimum version (Python 4+ or Python 3.10+)
// Validate minimum version (Python 4+ or Python 3.11+)
if (TryParseVersion(version, out var major, out var minor))
{
return major > 3 || (major >= 3 && minor >= 10);
return major > 3 || (major >= 3 && minor >= 11);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public override DependencyStatus DetectPython()
}
}

status.ErrorMessage = "Python not found. Please install Python 3.10 or later.";
status.ErrorMessage = "Python not found. Please install Python 3.11 or later.";
status.Details = "Checked common installation paths and PATH environment variable.";
}
catch (Exception ex)
Expand Down Expand Up @@ -132,10 +132,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
version = output.Substring(7); // Remove "Python " prefix
fullPath = pythonPath;

// Validate minimum version (Python 4+ or Python 3.10+)
// Validate minimum version (Python 4+ or Python 3.11+)
if (TryParseVersion(version, out var major, out var minor))
{
return major > 3 || (major >= 3 && minor >= 10);
return major > 3 || (major >= 3 && minor >= 11);
}
}
}
Expand Down
46 changes: 43 additions & 3 deletions MCPForUnity/Editor/Helpers/CodexConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using MCPForUnity.External.Tommy;
using MCPForUnity.Editor.Services;

namespace MCPForUnity.Editor.Helpers
{
Expand Down Expand Up @@ -62,8 +63,19 @@ public static string UpsertCodexServerBlock(string existingToml, string uvPath,
}
var mcpServers = root["mcp_servers"] as TomlTable;

// Create or update unityMCP table
mcpServers["unityMCP"] = CreateUnityMcpTable(uvPath, serverSrc);
// Extract existing env table if unityMCP already exists
TomlTable existingEnvTable = null;
if (mcpServers.TryGetNode("unityMCP", out var existingUnityMcpNode) && existingUnityMcpNode is TomlTable)
{
var existingUnityMcp = existingUnityMcpNode as TomlTable;
if (existingUnityMcp.TryGetNode("env", out var envNode) && envNode is TomlTable)
{
existingEnvTable = envNode as TomlTable;
}
}

// Create or update unityMCP table, preserving existing env table
mcpServers["unityMCP"] = CreateUnityMcpTable(uvPath, serverSrc, existingEnvTable);

// Serialize back to TOML
using var writer = new StringWriter();
Expand Down Expand Up @@ -125,7 +137,10 @@ private static TomlTable TryParseToml(string toml)
/// <summary>
/// Creates a TomlTable for the unityMCP server configuration
/// </summary>
private static TomlTable CreateUnityMcpTable(string uvPath, string serverSrc)
/// <param name="uvPath">Path to uv executable</param>
/// <param name="serverSrc">Path to server source directory</param>
/// <param name="existingEnvTable">Optional existing env table to preserve user-defined variables</param>
private static TomlTable CreateUnityMcpTable(string uvPath, string serverSrc, TomlTable existingEnvTable = null)
{
var unityMCP = new TomlTable();
unityMCP["command"] = new TomlString { Value = uvPath };
Expand All @@ -137,6 +152,31 @@ private static TomlTable CreateUnityMcpTable(string uvPath, string serverSrc)
argsArray.Add(new TomlString { Value = "server.py" });
unityMCP["args"] = argsArray;

// Add Windows-specific environment configuration, see: https://github.com/CoplayDev/unity-mcp/issues/315
var platformService = MCPServiceLocator.Platform;
if (platformService.IsWindows())
{
// Reuse existing env table (from parameter or unityMCP) to avoid dropping user keys
TomlTable envTable;
if (existingEnvTable != null)
envTable = existingEnvTable;
else if (unityMCP.TryGetNode("env", out var envNode) && envNode is TomlTable existing)
envTable = existing;
else
envTable = new TomlTable();

string systemRoot = platformService.GetSystemRoot();
if (!string.IsNullOrEmpty(systemRoot))
envTable["SystemRoot"] = new TomlString { Value = systemRoot };

unityMCP["env"] = envTable;
}
else if (existingEnvTable != null)
{
// Preserve existing env table even on non-Windows platforms
unityMCP["env"] = existingEnvTable;
}

return unityMCP;
}

Expand Down
106 changes: 0 additions & 106 deletions MCPForUnity/Editor/Helpers/PackageDetector.cs

This file was deleted.

46 changes: 0 additions & 46 deletions MCPForUnity/Editor/Helpers/PackageInstaller.cs

This file was deleted.

Loading