Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected bool TryFindUvInPath(out string uvPath, out string version)

// Try common uv command names
var commands = new[] { "uvx", "uv" };

foreach (var cmd in commands)
{
try
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Helpers/CodexConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MCPForUnity.External.Tommy;
using MCPForUnity.Editor.Services;
using MCPForUnity.External.Tommy;
using UnityEditor;

namespace MCPForUnity.Editor.Helpers
Expand Down
8 changes: 4 additions & 4 deletions MCPForUnity/Editor/Helpers/ConfigJsonBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Models;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;

namespace MCPForUnity.Editor.Helpers
Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Helpers/ExecPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using UnityEditor;
using System.Text;
using MCPForUnity.Editor.Constants;
using UnityEditor;

namespace MCPForUnity.Editor.Helpers
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Helpers/GameObjectSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Runtime.Serialization; // For Converters
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Runtime.Serialization; // For Converters

namespace MCPForUnity.Editor.Helpers
{
Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Helpers/HttpEndpointUtility.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using UnityEditor;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Config;
using MCPForUnity.Editor.Constants;
using UnityEditor;

namespace MCPForUnity.Editor.Helpers
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Helpers/McpLog.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MCPForUnity.Editor.Constants;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Editor.Constants;

namespace MCPForUnity.Editor.Helpers
{
Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Helpers/PortManager.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System.IO;
using UnityEditor;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using MCPForUnity.Editor.Constants;
using Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Editor.Constants;

namespace MCPForUnity.Editor.Helpers
{
Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Helpers/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace MCPForUnity.Editor.Helpers
{
public interface IMcpResponse
{
public interface IMcpResponse
{
[JsonProperty("success")]
bool Success { get; }
}
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Helpers/TelemetryHelper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Services.Transport.Transports;
using UnityEngine;

namespace MCPForUnity.Editor.Helpers
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Migrations/LegacyServerSrcMigration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using MCPForUnity.Editor.Constants;
using UnityEditor;
using UnityEngine;

Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Migrations/StdIoVersionMigration.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System.IO;
using System.Linq;
using MCPForUnity.Editor.Clients;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Models;
using MCPForUnity.Editor.Services;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Editor.Constants;
using System.Linq;

namespace MCPForUnity.Editor.Migrations
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Resources/Tests/GetTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using Newtonsoft.Json.Linq;
using UnityEditor.TestTools.TestRunner.Api;

namespace MCPForUnity.Editor.Resources.Tests
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Services/BridgeControlService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

using System;
using System.Threading.Tasks;
using UnityEditor;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport;
using MCPForUnity.Editor.Services.Transport.Transports;
using UnityEditor;

namespace MCPForUnity.Editor.Services
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Services/HttpBridgeReloadHandler.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Threading.Tasks;
using UnityEditor;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport;
using MCPForUnity.Editor.Windows;
using UnityEditor;

namespace MCPForUnity.Editor.Services
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Services/PackageUpdateService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Net;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using MCPForUnity.Editor.Constants;

namespace MCPForUnity.Editor.Services
{
Expand Down
23 changes: 16 additions & 7 deletions MCPForUnity/Editor/Services/ServerManagementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,24 @@ public bool ClearUvxCache()
McpLog.Debug($"uv cache cleared successfully: {stdout}");
return true;
}
else
{
string errorMessage = string.IsNullOrEmpty(stderr)
? "Unknown error"
: stderr;
string combinedOutput = string.Join(
Environment.NewLine,
new[] { stderr, stdout }.Where(s => !string.IsNullOrWhiteSpace(s)).Select(s => s.Trim()));

McpLog.Error($"Failed to clear uv cache using '{uvCommand} {args}': {errorMessage}. Ensure uv is installed, available on PATH, or set an override in Advanced Settings.");
return false;
string lockHint = (!string.IsNullOrEmpty(combinedOutput) &&
combinedOutput.IndexOf("currently in-use", StringComparison.OrdinalIgnoreCase) >= 0)
? "Another uv process may be holding the cache lock; wait a moment and try again or clear with '--force' from a terminal."
: string.Empty;

if (string.IsNullOrEmpty(combinedOutput))
{
combinedOutput = "Command failed with no output. Ensure uv is installed, on PATH, or set an override in Advanced Settings.";
}

McpLog.Error(
$"Failed to clear uv cache using '{uvCommand} {args}'. " +
$"Details: {combinedOutput}{(string.IsNullOrEmpty(lockHint) ? string.Empty : " Hint: " + lockHint)}");
return false;
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Services/StdioBridgeReloadHandler.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using UnityEditor;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport;
using MCPForUnity.Editor.Services.Transport.Transports;
using UnityEditor;

namespace MCPForUnity.Editor.Services
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Models;
using MCPForUnity.Editor.Services.Transport;
using MCPForUnity.Editor.Tools;
using MCPForUnity.Editor.Tools.Prefabs;
using MCPForUnity.Editor.Services.Transport;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;

namespace MCPForUnity.Editor.Services.Transport.Transports
{
Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Setup/SetupWindowService.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using MCPForUnity.Editor.Config;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Dependencies;
using MCPForUnity.Editor.Dependencies.Models;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Windows;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Config;
using UnityEditor;
using UnityEngine;

Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Tools/ManageEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditorInternal; // Required for tag management
using MCPForUnity.Editor.Helpers;

namespace MCPForUnity.Editor.Tools
{
Expand Down
4 changes: 2 additions & 2 deletions MCPForUnity/Editor/Tools/ManageGameObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Helpers; // For Response class
using MCPForUnity.Runtime.Serialization;
using Newtonsoft.Json; // Added for JsonSerializationException
using Newtonsoft.Json.Linq;
using UnityEditor;
Expand All @@ -11,8 +13,6 @@
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.SceneManagement;
using MCPForUnity.Editor.Helpers; // For Response class
using MCPForUnity.Runtime.Serialization;

namespace MCPForUnity.Editor.Tools
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Tools/ManageScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MCPForUnity.Editor.Helpers; // For Response class
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using MCPForUnity.Editor.Helpers; // For Response class

namespace MCPForUnity.Editor.Tools
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Tools/ManageShader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Editor.Helpers;

namespace MCPForUnity.Editor.Tools
{
Expand Down
2 changes: 1 addition & 1 deletion MCPForUnity/Editor/Tools/ReadConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Helpers; // For Response class
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using MCPForUnity.Editor.Helpers; // For Response class

namespace MCPForUnity.Editor.Tools
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using MCPForUnity.Editor.Clients;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Models;
using MCPForUnity.Editor.Services;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

namespace MCPForUnity.Editor.Windows.Components.ClientConfig
{
Expand Down
10 changes: 5 additions & 5 deletions MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using MCPForUnity.Editor.Windows.Components.Settings;
using MCPForUnity.Editor.Windows.Components.Connection;
using MCPForUnity.Editor.Windows.Components.ClientConfig;
Expand All @@ -19,7 +19,7 @@ public class MCPForUnityEditorWindow : EditorWindow
private McpConnectionSection connectionSection;
private McpClientConfigSection clientConfigSection;

private static readonly HashSet<MCPForUnityEditorWindow> OpenWindows = new();
private static readonly HashSet<MCPForUnityEditorWindow> OpenWindows = new();

public static void ShowWindow()
{
Expand Down Expand Up @@ -102,8 +102,8 @@ public void CreateGUI()
{
var clientConfigRoot = clientConfigTree.Instantiate();
sectionsContainer.Add(clientConfigRoot);
clientConfigSection = new McpClientConfigSection(clientConfigRoot);
}
clientConfigSection = new McpClientConfigSection(clientConfigRoot);
}

// Initial updates
RefreshAllData();
Expand Down
Loading