@@ -438,14 +438,7 @@ private void DrawUnifiedClientConfiguration()
438438 EditorGUILayout . LabelField ( "MCP Client Configuration" , sectionTitleStyle ) ;
439439 EditorGUILayout . Space ( 10 ) ;
440440
441- // Auto-connect toggle (moved from Server Status)
442- bool newAuto = EditorGUILayout . ToggleLeft ( "Auto-connect to MCP Clients" , autoRegisterEnabled ) ;
443- if ( newAuto != autoRegisterEnabled )
444- {
445- autoRegisterEnabled = newAuto ;
446- EditorPrefs . SetBool ( "UnityMCP.AutoRegisterEnabled" , autoRegisterEnabled ) ;
447- }
448- EditorGUILayout . Space ( 6 ) ;
441+ // (Auto-connect toggle removed per design)
449442
450443 // Client selector
451444 string [ ] clientNames = mcpClients . clients . Select ( c => c . name ) . ToArray ( ) ;
@@ -697,6 +690,17 @@ private static bool VerifyBridgePing(int port)
697690
698691 private void DrawClientConfigurationCompact ( McpClient mcpClient )
699692 {
693+ // Special pre-check for Claude Code: if CLI missing, reflect in status UI
694+ if ( mcpClient . mcpType == McpTypes . ClaudeCode )
695+ {
696+ string claudeCheck = ExecPath . ResolveClaude ( ) ;
697+ if ( string . IsNullOrEmpty ( claudeCheck ) )
698+ {
699+ mcpClient . configStatus = "Claude Not Found" ;
700+ mcpClient . status = McpStatus . NotConfigured ;
701+ }
702+ }
703+
700704 // Status display
701705 EditorGUILayout . BeginHorizontal ( ) ;
702706 Rect statusRect = GUILayoutUtility . GetRect ( 0 , 28 , GUILayout . Width ( 24 ) ) ;
@@ -710,7 +714,24 @@ private void DrawClientConfigurationCompact(McpClient mcpClient)
710714 } ;
711715 EditorGUILayout . LabelField ( mcpClient . configStatus , clientStatusStyle , GUILayout . Height ( 28 ) ) ;
712716 EditorGUILayout . EndHorizontal ( ) ;
713-
717+ // When Claude CLI is missing, show a clear install hint directly below status
718+ if ( mcpClient . mcpType == McpTypes . ClaudeCode && string . IsNullOrEmpty ( ExecPath . ResolveClaude ( ) ) )
719+ {
720+ GUIStyle installHintStyle = new GUIStyle ( clientStatusStyle ) ;
721+ installHintStyle . normal . textColor = new Color ( 1f , 0.5f , 0f ) ; // orange
722+ EditorGUILayout . BeginHorizontal ( ) ;
723+ GUIContent installText = new GUIContent ( "Make sure Claude Code is installed!" ) ;
724+ Vector2 textSize = installHintStyle . CalcSize ( installText ) ;
725+ EditorGUILayout . LabelField ( installText , installHintStyle , GUILayout . Height ( 22 ) , GUILayout . Width ( textSize . x + 2 ) , GUILayout . ExpandWidth ( false ) ) ;
726+ GUIStyle helpLinkStyle = new GUIStyle ( EditorStyles . linkLabel ) { fontStyle = FontStyle . Bold } ;
727+ GUILayout . Space ( 6 ) ;
728+ if ( GUILayout . Button ( "[CLICK]" , helpLinkStyle , GUILayout . Height ( 22 ) , GUILayout . ExpandWidth ( false ) ) )
729+ {
730+ Application . OpenURL ( "https://github.com/CoplayDev/unity-mcp/wiki/Troubleshooting-Unity-MCP-and-Claude-Code" ) ;
731+ }
732+ EditorGUILayout . EndHorizontal ( ) ;
733+ }
734+
714735 EditorGUILayout . Space ( 10 ) ;
715736
716737 // Action buttons in horizontal layout
@@ -723,23 +744,57 @@ private void DrawClientConfigurationCompact(McpClient mcpClient)
723744 ConfigureMcpClient ( mcpClient ) ;
724745 }
725746 }
726- else if ( mcpClient . mcpType == McpTypes . ClaudeCode )
727- {
728- bool isConfigured = mcpClient . status == McpStatus . Configured ;
729- string buttonText = isConfigured ? "Unregister UnityMCP with Claude Code" : "Register with Claude Code" ;
730- if ( GUILayout . Button ( buttonText , GUILayout . Height ( 32 ) ) )
731- {
732- if ( isConfigured )
733- {
734- UnregisterWithClaudeCode ( ) ;
735- }
736- else
737- {
738- string pythonDir = FindPackagePythonDirectory ( ) ;
739- RegisterWithClaudeCode ( pythonDir ) ;
740- }
741- }
742- }
747+ else if ( mcpClient . mcpType == McpTypes . ClaudeCode )
748+ {
749+ bool claudeAvailable = ! string . IsNullOrEmpty ( ExecPath . ResolveClaude ( ) ) ;
750+ if ( claudeAvailable )
751+ {
752+ bool isConfigured = mcpClient . status == McpStatus . Configured ;
753+ string buttonText = isConfigured ? "Unregister UnityMCP with Claude Code" : "Register with Claude Code" ;
754+ if ( GUILayout . Button ( buttonText , GUILayout . Height ( 32 ) ) )
755+ {
756+ if ( isConfigured )
757+ {
758+ UnregisterWithClaudeCode ( ) ;
759+ }
760+ else
761+ {
762+ string pythonDir = FindPackagePythonDirectory ( ) ;
763+ RegisterWithClaudeCode ( pythonDir ) ;
764+ }
765+ }
766+ // Hide the picker once a valid binary is available
767+ EditorGUILayout . EndHorizontal ( ) ;
768+ EditorGUILayout . BeginHorizontal ( ) ;
769+ GUIStyle pathLabelStyle = new GUIStyle ( EditorStyles . miniLabel ) { wordWrap = true } ;
770+ string resolvedClaude = ExecPath . ResolveClaude ( ) ;
771+ EditorGUILayout . LabelField ( $ "Claude CLI: { resolvedClaude } ", pathLabelStyle ) ;
772+ EditorGUILayout . EndHorizontal ( ) ;
773+ EditorGUILayout . BeginHorizontal ( ) ;
774+ }
775+ // CLI picker row (only when not found)
776+ EditorGUILayout . EndHorizontal ( ) ;
777+ EditorGUILayout . BeginHorizontal ( ) ;
778+ if ( ! claudeAvailable )
779+ {
780+ // Only show the picker button in not-found state (no redundant "not found" label)
781+ if ( GUILayout . Button ( "Choose Claude Install Location" , GUILayout . Width ( 260 ) , GUILayout . Height ( 22 ) ) )
782+ {
783+ string suggested = RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) ? "/opt/homebrew/bin" : Environment . GetFolderPath ( Environment . SpecialFolder . ProgramFiles ) ;
784+ string picked = EditorUtility . OpenFilePanel ( "Select 'claude' CLI" , suggested , "" ) ;
785+ if ( ! string . IsNullOrEmpty ( picked ) )
786+ {
787+ ExecPath . SetClaudeCliPath ( picked ) ;
788+ // Auto-register after setting a valid path
789+ string pythonDir = FindPackagePythonDirectory ( ) ;
790+ RegisterWithClaudeCode ( pythonDir ) ;
791+ Repaint ( ) ;
792+ }
793+ }
794+ }
795+ EditorGUILayout . EndHorizontal ( ) ;
796+ EditorGUILayout . BeginHorizontal ( ) ;
797+ }
743798 else
744799 {
745800 if ( GUILayout . Button ( $ "Auto Configure", GUILayout . Height ( 32 ) ) )
@@ -793,13 +848,17 @@ private void DrawClientConfigurationCompact(McpClient mcpClient)
793848
794849 EditorGUILayout . EndHorizontal ( ) ;
795850
796- EditorGUILayout . Space ( 8 ) ;
797- // Quick info
798- GUIStyle configInfoStyle = new GUIStyle ( EditorStyles . miniLabel )
799- {
800- fontSize = 10
801- } ;
802- EditorGUILayout . LabelField ( $ "Config: { Path . GetFileName ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? mcpClient . windowsConfigPath : mcpClient . linuxConfigPath ) } ", configInfoStyle ) ;
851+ EditorGUILayout . Space ( 8 ) ;
852+ // Quick info (hide when Claude is not found to avoid confusion)
853+ bool hideConfigInfo = ( mcpClient . mcpType == McpTypes . ClaudeCode ) && string . IsNullOrEmpty ( ExecPath . ResolveClaude ( ) ) ;
854+ if ( ! hideConfigInfo )
855+ {
856+ GUIStyle configInfoStyle = new GUIStyle ( EditorStyles . miniLabel )
857+ {
858+ fontSize = 10
859+ } ;
860+ EditorGUILayout . LabelField ( $ "Config: { Path . GetFileName ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? mcpClient . windowsConfigPath : mcpClient . linuxConfigPath ) } ", configInfoStyle ) ;
861+ }
803862 }
804863
805864 private void ToggleUnityBridge ( )
0 commit comments