44using System . Linq ;
55using System . Runtime . InteropServices ;
66using UnityEditor ;
7- using UnityEditor . UIElements ;
7+ using UnityEditor . UIElements ; // For Unity 2021 compatibility
88using UnityEngine ;
99using UnityEngine . UIElements ;
1010using 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 }
0 commit comments