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
14 changes: 14 additions & 0 deletions UnityMcpBridge/Editor/Data/McpClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ public class McpClients
configStatus = "Not Configured",
},
new()
{
name = "Claude Code",
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".claude.json"
),
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".claude.json"
),
mcpType = McpTypes.ClaudeCode,
configStatus = "Not Configured",
},
new()
{
name = "Cursor",
windowsConfigPath = Path.Combine(
Expand Down
1 change: 1 addition & 0 deletions UnityMcpBridge/Editor/Models/McpTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum McpTypes
ClaudeDesktop,
Cursor,
VSCode,
ClaudeCode,
}
}

35 changes: 21 additions & 14 deletions UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected virtual void OnGUI()
);
GUI.Label(
new Rect(titleRect.x + 10, titleRect.y + 6, titleRect.width - 20, titleRect.height),
mcpClient.name + " Manual Configuration",
(mcpClient?.name ?? "Unknown") + " Manual Configuration",
EditorStyles.boldLabel
);
EditorGUILayout.Space(10);
Expand Down Expand Up @@ -70,17 +70,17 @@ protected virtual void OnGUI()
};

EditorGUILayout.LabelField(
"1. Open " + mcpClient.name + " config file by either:",
"1. Open " + (mcpClient?.name ?? "Unknown") + " config file by either:",
instructionStyle
);
if (mcpClient.mcpType == McpTypes.ClaudeDesktop)
if (mcpClient?.mcpType == McpTypes.ClaudeDesktop)
{
EditorGUILayout.LabelField(
" a) Going to Settings > Developer > Edit Config",
instructionStyle
);
}
else if (mcpClient.mcpType == McpTypes.Cursor)
else if (mcpClient?.mcpType == McpTypes.Cursor)
{
EditorGUILayout.LabelField(
" a) Going to File > Preferences > Cursor Settings > MCP > Add new global MCP server",
Expand All @@ -96,16 +96,23 @@ protected virtual void OnGUI()
// Path section with improved styling
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
string displayPath;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (mcpClient != null)
{
displayPath = mcpClient.windowsConfigPath;
}
else if (
RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
)
{
displayPath = mcpClient.linuxConfigPath;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
displayPath = mcpClient.windowsConfigPath;
}
else if (
RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
)
{
displayPath = mcpClient.linuxConfigPath;
}
else
{
displayPath = configPath;
}
}
else
{
Expand Down Expand Up @@ -224,7 +231,7 @@ protected virtual void OnGUI()

EditorGUILayout.Space(10);
EditorGUILayout.LabelField(
"3. Save the file and restart " + mcpClient.name,
"3. Save the file and restart " + (mcpClient?.name ?? "Unknown"),
instructionStyle
);

Expand Down
Loading