2025-03-20 19:24:31 +08:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
2025-08-25 05:18:08 +08:00
|
|
|
using System.Runtime.InteropServices;
|
2025-08-21 03:59:49 +08:00
|
|
|
using MCPForUnity.Editor.Models;
|
2025-03-20 19:24:31 +08:00
|
|
|
|
2025-08-21 03:59:49 +08:00
|
|
|
namespace MCPForUnity.Editor.Data
|
2025-03-20 19:24:31 +08:00
|
|
|
{
|
|
|
|
|
public class McpClients
|
|
|
|
|
{
|
2025-04-08 18:14:13 +08:00
|
|
|
public List<McpClient> clients = new()
|
|
|
|
|
{
|
2025-08-09 02:23:45 +08:00
|
|
|
// 1) Cursor
|
2025-04-08 18:14:13 +08:00
|
|
|
new()
|
|
|
|
|
{
|
2025-08-09 02:23:45 +08:00
|
|
|
name = "Cursor",
|
2025-03-20 19:24:31 +08:00
|
|
|
windowsConfigPath = Path.Combine(
|
2025-08-09 02:23:45 +08:00
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
".cursor",
|
|
|
|
|
"mcp.json"
|
2025-03-20 19:24:31 +08:00
|
|
|
),
|
|
|
|
|
linuxConfigPath = Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
2025-08-09 02:23:45 +08:00
|
|
|
".cursor",
|
|
|
|
|
"mcp.json"
|
2025-03-20 19:24:31 +08:00
|
|
|
),
|
2025-08-09 02:23:45 +08:00
|
|
|
mcpType = McpTypes.Cursor,
|
2025-04-08 18:14:13 +08:00
|
|
|
configStatus = "Not Configured",
|
2025-03-20 19:24:31 +08:00
|
|
|
},
|
2025-08-09 02:23:45 +08:00
|
|
|
// 2) Claude Code
|
2025-04-08 18:14:13 +08:00
|
|
|
new()
|
2025-07-29 06:30:33 +08:00
|
|
|
{
|
|
|
|
|
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",
|
|
|
|
|
},
|
2025-08-09 02:23:45 +08:00
|
|
|
// 3) Windsurf
|
2025-07-29 06:30:33 +08:00
|
|
|
new()
|
2025-04-08 18:14:13 +08:00
|
|
|
{
|
2025-08-09 02:23:45 +08:00
|
|
|
name = "Windsurf",
|
2025-03-20 19:24:31 +08:00
|
|
|
windowsConfigPath = Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
2025-08-09 02:23:45 +08:00
|
|
|
".codeium",
|
|
|
|
|
"windsurf",
|
|
|
|
|
"mcp_config.json"
|
2025-03-20 19:24:31 +08:00
|
|
|
),
|
|
|
|
|
linuxConfigPath = Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
2025-08-09 02:23:45 +08:00
|
|
|
".codeium",
|
|
|
|
|
"windsurf",
|
|
|
|
|
"mcp_config.json"
|
2025-03-20 19:24:31 +08:00
|
|
|
),
|
2025-08-09 02:23:45 +08:00
|
|
|
mcpType = McpTypes.Windsurf,
|
2025-04-08 18:14:13 +08:00
|
|
|
configStatus = "Not Configured",
|
|
|
|
|
},
|
2025-08-09 02:23:45 +08:00
|
|
|
// 4) Claude Desktop
|
2025-05-12 09:25:21 +08:00
|
|
|
new()
|
|
|
|
|
{
|
2025-08-09 02:23:45 +08:00
|
|
|
name = "Claude Desktop",
|
2025-05-12 09:25:21 +08:00
|
|
|
windowsConfigPath = Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
2025-08-09 02:23:45 +08:00
|
|
|
"Claude",
|
|
|
|
|
"claude_desktop_config.json"
|
2025-05-12 09:25:21 +08:00
|
|
|
),
|
2025-08-26 05:51:03 +08:00
|
|
|
// For macOS, Claude Desktop stores config under ~/Library/Application Support/Claude
|
|
|
|
|
// For Linux, it remains under ~/.config/Claude
|
|
|
|
|
linuxConfigPath = RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
|
|
|
|
|
? Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
"Library",
|
|
|
|
|
"Application Support",
|
|
|
|
|
"Claude",
|
|
|
|
|
"claude_desktop_config.json"
|
|
|
|
|
)
|
|
|
|
|
: Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
".config",
|
|
|
|
|
"Claude",
|
|
|
|
|
"claude_desktop_config.json"
|
|
|
|
|
),
|
2025-08-09 02:23:45 +08:00
|
|
|
mcpType = McpTypes.ClaudeDesktop,
|
2025-05-12 09:25:21 +08:00
|
|
|
configStatus = "Not Configured",
|
|
|
|
|
},
|
2025-08-09 02:23:45 +08:00
|
|
|
// 5) VSCode GitHub Copilot
|
2025-08-01 20:12:07 +08:00
|
|
|
new()
|
|
|
|
|
{
|
2025-08-09 02:23:45 +08:00
|
|
|
name = "VSCode GitHub Copilot",
|
2025-08-25 05:18:08 +08:00
|
|
|
// Windows path is canonical under %AppData%\Code\User
|
2025-08-01 20:12:07 +08:00
|
|
|
windowsConfigPath = Path.Combine(
|
2025-08-09 02:23:45 +08:00
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
|
|
|
|
"Code",
|
|
|
|
|
"User",
|
2025-08-13 11:56:22 +08:00
|
|
|
"mcp.json"
|
2025-08-01 20:12:07 +08:00
|
|
|
),
|
2025-08-25 05:18:08 +08:00
|
|
|
// For macOS, VSCode stores user config under ~/Library/Application Support/Code/User
|
|
|
|
|
// For Linux, it remains under ~/.config/Code/User
|
|
|
|
|
linuxConfigPath = RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
|
|
|
|
|
? Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
"Library",
|
|
|
|
|
"Application Support",
|
|
|
|
|
"Code",
|
|
|
|
|
"User",
|
|
|
|
|
"mcp.json"
|
|
|
|
|
)
|
|
|
|
|
: Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
".config",
|
|
|
|
|
"Code",
|
|
|
|
|
"User",
|
|
|
|
|
"mcp.json"
|
|
|
|
|
),
|
2025-08-09 02:23:45 +08:00
|
|
|
mcpType = McpTypes.VSCode,
|
2025-08-01 20:12:07 +08:00
|
|
|
configStatus = "Not Configured",
|
|
|
|
|
},
|
2025-08-16 09:26:12 +08:00
|
|
|
// 3) Kiro
|
|
|
|
|
new()
|
|
|
|
|
{
|
|
|
|
|
name = "Kiro",
|
|
|
|
|
windowsConfigPath = Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
".kiro",
|
|
|
|
|
"settings",
|
|
|
|
|
"mcp.json"
|
|
|
|
|
),
|
|
|
|
|
linuxConfigPath = Path.Combine(
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
|
|
|
|
".kiro",
|
|
|
|
|
"settings",
|
|
|
|
|
"mcp.json"
|
|
|
|
|
),
|
|
|
|
|
mcpType = McpTypes.Kiro,
|
|
|
|
|
configStatus = "Not Configured",
|
|
|
|
|
},
|
2025-03-20 19:24:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Initialize status enums after construction
|
|
|
|
|
public McpClients()
|
|
|
|
|
{
|
|
|
|
|
foreach (var client in clients)
|
|
|
|
|
{
|
|
|
|
|
if (client.configStatus == "Not Configured")
|
|
|
|
|
{
|
|
|
|
|
client.status = McpStatus.NotConfigured;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-08 18:14:13 +08:00
|
|
|
}
|
|
|
|
|
|