Skip to content

Commit 2ee1d4b

Browse files
committed
All critical review feedback from CodeRabbit has been addressed! 🎉
Completed Items: Supply Chain Fix: Restored the default Git URL in AssetPathUtility.cs to the official repository (CoplayDev). i18n (Internationalization): Localized core Korean comments in main.py into English. Stability: Implemented a safe fallback mechanism in ConfigJsonBuilder.cs for when Node path override fails. Robustness: Added PID validation checks in wrapper.js to prevent errors. Refactoring: Removed unnecessary dummy code from McpSettingsSection.cs and MCPForUnityEditorWindow.cs.
1 parent 560624c commit 2ee1d4b

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

MCPForUnity/Editor/Helpers/AssetPathUtility.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,9 @@ public static string GetMcpServerGitUrl()
268268
return gitUrlOverride;
269269
}
270270

271-
// Return hardcoded Git URL as requested by the user who prefers to push changes and use the clean URL
272-
// instead of local file paths.
273-
// Note: This means local changes MUST be pushed to GitHub to take effect in the server!
274-
return "git+https://github.com/choej2303/unity-mcp-gg.git@main#subdirectory=MCPForUnity/Server~";
271+
// Return official repository URL as default
272+
// Users can override via EditorPrefs.GitUrlOverride for development/testing
273+
return "git+https://github.com/CoplayDev/unity-mcp.git@main#subdirectory=MCPForUnity/Server~";
275274

276275
/*
277276
// Local path logic disabled for clean config aesthetics

MCPForUnity/Editor/Helpers/ConfigJsonBuilder.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,16 @@ private static void PopulateUnityNode(JObject unity, string uvPath, McpClient cl
110110
// We assume 'node' is in PATH unless overridden.
111111
string nodeCommand = "node";
112112
string nodeOverride = EditorPrefs.GetString(EditorPrefKeys.NodePathOverride, "");
113-
if (!string.IsNullOrEmpty(nodeOverride) && File.Exists(nodeOverride))
113+
if (!string.IsNullOrEmpty(nodeOverride))
114114
{
115-
nodeCommand = nodeOverride;
115+
if (File.Exists(nodeOverride))
116+
{
117+
nodeCommand = nodeOverride;
118+
}
119+
else
120+
{
121+
McpLog.Warn($"Node override path not found: {nodeOverride}, falling back to 'node'");
122+
}
116123
}
117124

118125
unity["command"] = nodeCommand;

MCPForUnity/Editor/Windows/Components/Settings/McpSettingsSection.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,7 @@ private void RegisterCallbacks()
8888
});
8989
}
9090

91-
public void UpdatePathOverrides()
92-
{
93-
// Now handled in Setup Section or Client Config
94-
// Kept empty method for compatibility with existing calls
95-
}
91+
9692

9793
private void UpdateVersionLabel()
9894
{

MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ private void RefreshAllData()
383383
_ = connectionSection?.VerifyBridgeConnectionAsync();
384384
}
385385

386-
settingsSection?.UpdatePathOverrides();
387-
settingsSection?.UpdatePathOverrides();
388386
clientConfigSection?.RefreshSelectedClient();
389387
// Removed toolsSection?.Refresh() - tools are now loaded lazily when tab is opened
390388
}

MCPForUnity/Server~/src/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ def main():
408408

409409
# Use stdio transport for traditional MCP
410410
logger.info("Starting FastMCP with stdio transport")
411-
# 🚨 [핵심] STDIO 모드일 때만 관련 로거를 CRITICAL로 낮춥니다.
412-
# Uvicorn 및 관련 로거들의 입을 막아 stdout 오염을 방지합니다.
413-
# 🚨 [핵심] STDIO 모드일 때 stdout 오염 방지
411+
# 🚨 [CRITICAL] In STDIO mode only, suppress related loggers.
412+
# Silence Uvicorn and related loggers to prevent stdout pollution.
413+
# 🚨 [CRITICAL] Prevent stdout pollution in STDIO mode
414414
for name in (
415415
"uvicorn", "uvicorn.error", "uvicorn.access",
416416
"starlette",

MCPForUnity/Server~/wrapper.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ function cleanup() {
117117
try {
118118
pythonProcess.kill();
119119
if (process.platform === "win32") {
120-
require("child_process").execSync(
121-
`taskkill /pid ${pythonProcess.pid} /T /F`
122-
);
120+
if (pythonProcess.pid) {
121+
require("child_process").execSync(
122+
`taskkill /pid ${pythonProcess.pid} /T /F`
123+
);
124+
}
123125
}
124126
} catch (e) {
125127
/* ignore */

0 commit comments

Comments
 (0)