Skip to content

Commit 9b60693

Browse files
committed
refactor: rename Python server references to MCP server for consistency
1 parent 182e4e4 commit 9b60693

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

MCPForUnity/Editor/Services/BridgeControlService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void Start()
1919
{
2020
// If server is installed, use auto-connect mode
2121
// Otherwise use standard mode
22-
string serverPath = MCPServiceLocator.Paths.GetPythonServerPath();
22+
string serverPath = MCPServiceLocator.Paths.GetMcpServerPath();
2323
if (!string.IsNullOrEmpty(serverPath) && File.Exists(Path.Combine(serverPath, "server.py")))
2424
{
2525
MCPForUnityBridge.StartAutoConnect();

MCPForUnity/Editor/Services/ClientConfigurationService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void ConfigureClient(McpClient client)
2525
string configPath = McpConfigurationHelper.GetClientConfigPath(client);
2626
McpConfigurationHelper.EnsureConfigDirectoryExists(configPath);
2727

28-
string pythonDir = MCPServiceLocator.Paths.GetPythonServerPath();
28+
string pythonDir = MCPServiceLocator.Paths.GetMcpServerPath();
2929

3030
if (pythonDir == null || !File.Exists(Path.Combine(pythonDir, "server.py")))
3131
{
@@ -134,7 +134,7 @@ public bool CheckClientStatus(McpClient client, bool attemptAutoRewrite = true)
134134
}
135135

136136
string configJson = File.ReadAllText(configPath);
137-
string pythonDir = MCPServiceLocator.Paths.GetPythonServerPath();
137+
string pythonDir = MCPServiceLocator.Paths.GetMcpServerPath();
138138

139139
// Check configuration based on client type
140140
string[] args = null;
@@ -233,7 +233,7 @@ public bool CheckClientStatus(McpClient client, bool attemptAutoRewrite = true)
233233
public void RegisterClaudeCode()
234234
{
235235
var pathService = MCPServiceLocator.Paths;
236-
string pythonDir = pathService.GetPythonServerPath();
236+
string pythonDir = pathService.GetMcpServerPath();
237237

238238
if (string.IsNullOrEmpty(pythonDir))
239239
{
@@ -366,7 +366,7 @@ public string GetConfigPath(McpClient client)
366366

367367
public string GenerateConfigJson(McpClient client)
368368
{
369-
string pythonDir = MCPServiceLocator.Paths.GetPythonServerPath();
369+
string pythonDir = MCPServiceLocator.Paths.GetMcpServerPath();
370370
string uvPath = MCPServiceLocator.Paths.GetUvPath();
371371

372372
// Claude Code uses CLI commands, not JSON config

MCPForUnity/Editor/Services/IPathResolverService.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace MCPForUnity.Editor.Services
66
public interface IPathResolverService
77
{
88
/// <summary>
9-
/// Gets the Python MCP server path (respects override if set)
9+
/// Gets the MCP server path (respects override if set)
1010
/// </summary>
11-
/// <returns>Path to the Python server directory containing server.py, or null if not found</returns>
12-
string GetPythonServerPath();
11+
/// <returns>Path to the MCP server directory containing server.py, or null if not found</returns>
12+
string GetMcpServerPath();
1313

1414
/// <summary>
1515
/// Gets the UV package manager path (respects override if set)
@@ -42,10 +42,10 @@ public interface IPathResolverService
4242
bool IsClaudeCliDetected();
4343

4444
/// <summary>
45-
/// Sets an override for the Python server path
45+
/// Sets an override for the MCP server path
4646
/// </summary>
4747
/// <param name="path">Path to override with</param>
48-
void SetPythonServerOverride(string path);
48+
void SetMcpServerOverride(string path);
4949

5050
/// <summary>
5151
/// Sets an override for the UV path
@@ -60,9 +60,9 @@ public interface IPathResolverService
6060
void SetClaudeCliPathOverride(string path);
6161

6262
/// <summary>
63-
/// Clears the Python server path override
63+
/// Clears the MCP server path override
6464
/// </summary>
65-
void ClearPythonServerOverride();
65+
void ClearMcpServerOverride();
6666

6767
/// <summary>
6868
/// Clears the UV path override
@@ -75,9 +75,9 @@ public interface IPathResolverService
7575
void ClearClaudeCliPathOverride();
7676

7777
/// <summary>
78-
/// Gets whether a Python server path override is active
78+
/// Gets whether a MCP server path override is active
7979
/// </summary>
80-
bool HasPythonServerOverride { get; }
80+
bool HasMcpServerOverride { get; }
8181

8282
/// <summary>
8383
/// Gets whether a UV path override is active

MCPForUnity/Editor/Services/PathResolverService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public class PathResolverService : IPathResolverService
1616
private const string UvPathOverrideKey = "MCPForUnity.UvPath";
1717
private const string ClaudeCliPathOverrideKey = "MCPForUnity.ClaudeCliPath";
1818

19-
public bool HasPythonServerOverride => !string.IsNullOrEmpty(EditorPrefs.GetString(PythonDirOverrideKey, null));
19+
public bool HasMcpServerOverride => !string.IsNullOrEmpty(EditorPrefs.GetString(PythonDirOverrideKey, null));
2020
public bool HasUvPathOverride => !string.IsNullOrEmpty(EditorPrefs.GetString(UvPathOverrideKey, null));
2121
public bool HasClaudeCliPathOverride => !string.IsNullOrEmpty(EditorPrefs.GetString(ClaudeCliPathOverrideKey, null));
2222

23-
public string GetPythonServerPath()
23+
public string GetMcpServerPath()
2424
{
2525
// Check for override first
2626
string overridePath = EditorPrefs.GetString(PythonDirOverrideKey, null);
@@ -174,11 +174,11 @@ public bool IsClaudeCliDetected()
174174
return !string.IsNullOrEmpty(GetClaudeCliPath());
175175
}
176176

177-
public void SetPythonServerOverride(string path)
177+
public void SetMcpServerOverride(string path)
178178
{
179179
if (string.IsNullOrEmpty(path))
180180
{
181-
ClearPythonServerOverride();
181+
ClearMcpServerOverride();
182182
return;
183183
}
184184

@@ -224,7 +224,7 @@ public void SetClaudeCliPathOverride(string path)
224224
ExecPath.SetClaudeCliPath(path);
225225
}
226226

227-
public void ClearPythonServerOverride()
227+
public void ClearMcpServerOverride()
228228
{
229229
EditorPrefs.DeleteKey(PythonDirOverrideKey);
230230
}

MCPForUnity/Editor/Windows/MCPForUnityEditorWindowNew.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Linq;
55
using System.Runtime.InteropServices;
66
using UnityEditor;
7-
using UnityEditor.UIElements;
7+
using UnityEditor.UIElements; // For Unity 2021 compatibility
88
using UnityEngine;
99
using UnityEngine.UIElements;
1010
using MCPForUnity.Editor.Data;
@@ -28,13 +28,13 @@ private enum ConnectionProtocol
2828
private EnumField validationLevelField;
2929
private Label validationDescription;
3030
private Foldout advancedSettingsFoldout;
31-
private TextField pythonPathOverride;
31+
private TextField mcpServerPathOverride;
3232
private TextField uvPathOverride;
3333
private Button browsePythonButton;
3434
private Button clearPythonButton;
3535
private Button browseUvButton;
3636
private Button clearUvButton;
37-
private VisualElement pythonPathStatus;
37+
private VisualElement mcpServerPathStatus;
3838
private VisualElement uvPathStatus;
3939

4040
// Connection UI Elements
@@ -195,13 +195,13 @@ private void CacheUIElements()
195195
validationLevelField = rootVisualElement.Q<EnumField>("validation-level");
196196
validationDescription = rootVisualElement.Q<Label>("validation-description");
197197
advancedSettingsFoldout = rootVisualElement.Q<Foldout>("advanced-settings-foldout");
198-
pythonPathOverride = rootVisualElement.Q<TextField>("python-path-override");
198+
mcpServerPathOverride = rootVisualElement.Q<TextField>("python-path-override");
199199
uvPathOverride = rootVisualElement.Q<TextField>("uv-path-override");
200200
browsePythonButton = rootVisualElement.Q<Button>("browse-python-button");
201201
clearPythonButton = rootVisualElement.Q<Button>("clear-python-button");
202202
browseUvButton = rootVisualElement.Q<Button>("browse-uv-button");
203203
clearUvButton = rootVisualElement.Q<Button>("clear-uv-button");
204-
pythonPathStatus = rootVisualElement.Q<VisualElement>("python-path-status");
204+
mcpServerPathStatus = rootVisualElement.Q<VisualElement>("mcp-server-path-status");
205205
uvPathStatus = rootVisualElement.Q<VisualElement>("uv-path-status");
206206

207207
// Connection
@@ -462,27 +462,27 @@ private void UpdatePathOverrides()
462462
{
463463
var pathService = MCPServiceLocator.Paths;
464464

465-
// Python Server Path
466-
string pythonPath = pathService.GetPythonServerPath();
467-
if (pathService.HasPythonServerOverride)
465+
// MCP Server Path
466+
string mcpServerPath = pathService.GetMcpServerPath();
467+
if (pathService.HasMcpServerOverride)
468468
{
469-
pythonPathOverride.value = pythonPath ?? "(override set but invalid)";
469+
mcpServerPathOverride.value = mcpServerPath ?? "(override set but invalid)";
470470
}
471471
else
472472
{
473-
pythonPathOverride.value = pythonPath ?? "(auto-detected)";
473+
mcpServerPathOverride.value = mcpServerPath ?? "(auto-detected)";
474474
}
475475

476476
// Update status indicator
477-
pythonPathStatus.RemoveFromClassList("valid");
478-
pythonPathStatus.RemoveFromClassList("invalid");
479-
if (!string.IsNullOrEmpty(pythonPath) && File.Exists(Path.Combine(pythonPath, "server.py")))
477+
mcpServerPathStatus.RemoveFromClassList("valid");
478+
mcpServerPathStatus.RemoveFromClassList("invalid");
479+
if (!string.IsNullOrEmpty(mcpServerPath) && File.Exists(Path.Combine(mcpServerPath, "server.py")))
480480
{
481-
pythonPathStatus.AddToClassList("valid");
481+
mcpServerPathStatus.AddToClassList("valid");
482482
}
483483
else
484484
{
485-
pythonPathStatus.AddToClassList("invalid");
485+
mcpServerPathStatus.AddToClassList("invalid");
486486
}
487487

488488
// UV Path
@@ -720,14 +720,14 @@ private void OnConfigureClicked()
720720

721721
private void OnBrowsePythonClicked()
722722
{
723-
string picked = EditorUtility.OpenFolderPanel("Select Python Server Directory", Application.dataPath, "");
723+
string picked = EditorUtility.OpenFolderPanel("Select MCP Server Directory", Application.dataPath, "");
724724
if (!string.IsNullOrEmpty(picked))
725725
{
726726
try
727727
{
728-
MCPServiceLocator.Paths.SetPythonServerOverride(picked);
728+
MCPServiceLocator.Paths.SetMcpServerOverride(picked);
729729
UpdatePathOverrides();
730-
McpLog.Info($"Python server path override set to: {picked}");
730+
McpLog.Info($"MCP server path override set to: {picked}");
731731
}
732732
catch (Exception ex)
733733
{
@@ -738,7 +738,7 @@ private void OnBrowsePythonClicked()
738738

739739
private void OnClearPythonClicked()
740740
{
741-
MCPServiceLocator.Paths.ClearPythonServerOverride();
741+
MCPServiceLocator.Paths.ClearMcpServerOverride();
742742
UpdatePathOverrides();
743743
McpLog.Info("Python server path override cleared");
744744
}

MCPForUnity/Editor/Windows/MCPForUnityEditorWindowNew.uxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<!-- Python Server Path Override -->
3030
<ui:VisualElement class="override-row">
3131
<ui:Label text="Python Server Path:" class="override-label" />
32-
<ui:VisualElement class="status-indicator-small" name="python-path-status" />
32+
<ui:VisualElement class="status-indicator-small" name="mcp-server-path-status" />
3333
</ui:VisualElement>
3434
<ui:VisualElement class="path-override-controls">
3535
<ui:TextField name="python-path-override" readonly="true" class="override-field" />

docs/v6_NEW_UI_CHANGES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ MCPServiceLocator.Bridge.Start();
104104
MCPServiceLocator.Client.ConfigureAllDetectedClients();
105105

106106
// Access path resolver service
107-
string pythonPath = MCPServiceLocator.Paths.GetPythonServerPath();
107+
string mcpServerPath = MCPServiceLocator.Paths.GetMcpServerPath();
108108
```
109109

110110
**Benefits:**
@@ -167,10 +167,10 @@ Debug.Log($"Configured: {summary.SuccessCount}, Failed: {summary.FailureCount}")
167167
**Purpose:** Resolves paths to required tools with override support
168168

169169
**Key Methods:**
170-
- `GetPythonServerPath()` - Python server directory
170+
- `GetMcpServerPath()` - Python server directory
171171
- `GetUvPath()` - UV executable path
172172
- `GetClaudeCliPath()` - Claude CLI path
173-
- `SetPythonServerOverride(path)` / `ClearPythonServerOverride()` - Manage overrides
173+
- `SetMcpServerOverride(path)` / `ClearMcpServerOverride()` - Manage overrides
174174
- `IsPythonDetected()` / `IsUvDetected()` - Detection checks
175175

176176
**Implementation:** `PathResolverService`

0 commit comments

Comments
 (0)