Skip to content

Commit 86b4dc1

Browse files
committed
chore(logging): include OS and server version in MCP bridge start log
1 parent 58ed4d4 commit 86b4dc1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

UnityMcpBridge/Editor/MCPForUnityBridge.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ public static void Start()
310310

311311
isRunning = true;
312312
isAutoConnectMode = false;
313-
Debug.Log($"<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: MCPForUnityBridge started on port {currentUnityPort}.");
313+
string platform = Application.platform.ToString();
314+
string serverVer = ReadInstalledServerVersionSafe();
315+
Debug.Log($"<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: MCPForUnityBridge started on port {currentUnityPort}. (OS={platform}, server={serverVer})");
314316
Task.Run(ListenerLoop);
315317
EditorApplication.update += ProcessCommands;
316318
// Write initial heartbeat immediately
@@ -727,6 +729,22 @@ private static void WriteHeartbeat(bool reloading, string reason = null)
727729
}
728730
}
729731

732+
private static string ReadInstalledServerVersionSafe()
733+
{
734+
try
735+
{
736+
string serverSrc = ServerInstaller.GetServerPath();
737+
string verFile = Path.Combine(serverSrc, "server_version.txt");
738+
if (File.Exists(verFile))
739+
{
740+
string v = File.ReadAllText(verFile)?.Trim();
741+
if (!string.IsNullOrEmpty(v)) return v;
742+
}
743+
}
744+
catch { }
745+
return "unknown";
746+
}
747+
730748
private static string ComputeProjectHash(string input)
731749
{
732750
try

0 commit comments

Comments
 (0)