chore(logging): include OS and server version in MCP bridge start log

main
David Sarno 2025-08-24 11:28:47 -07:00
parent 58ed4d4e13
commit 86b4dc14bc
1 changed files with 19 additions and 1 deletions

View File

@ -310,7 +310,9 @@ namespace MCPForUnity.Editor
isRunning = true;
isAutoConnectMode = false;
Debug.Log($"<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: MCPForUnityBridge started on port {currentUnityPort}.");
string platform = Application.platform.ToString();
string serverVer = ReadInstalledServerVersionSafe();
Debug.Log($"<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: MCPForUnityBridge started on port {currentUnityPort}. (OS={platform}, server={serverVer})");
Task.Run(ListenerLoop);
EditorApplication.update += ProcessCommands;
// Write initial heartbeat immediately
@ -727,6 +729,22 @@ namespace MCPForUnity.Editor
}
}
private static string ReadInstalledServerVersionSafe()
{
try
{
string serverSrc = ServerInstaller.GetServerPath();
string verFile = Path.Combine(serverSrc, "server_version.txt");
if (File.Exists(verFile))
{
string v = File.ReadAllText(verFile)?.Trim();
if (!string.IsNullOrEmpty(v)) return v;
}
}
catch { }
return "unknown";
}
private static string ComputeProjectHash(string input)
{
try