Skip to content

Commit 6705c66

Browse files
authored
added support and test for Claude code (#1389)
1 parent 5219351 commit 6705c66

File tree

2 files changed

+71
-19
lines changed

2 files changed

+71
-19
lines changed

src/pkg/mcp/setup.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const (
5656
MCPClientCode MCPClient = "code"
5757
MCPClientVSCodeInsiders MCPClient = "vscode-insiders"
5858
MCPClientInsiders MCPClient = "code-insiders"
59-
MCPClientClaude MCPClient = "claude"
59+
MCPClientClaudeDesktop MCPClient = "claude-desktop"
60+
MCPClientClaudeCode MCPClient = "claude-code"
6061
MCPClientWindsurf MCPClient = "windsurf"
6162
MCPClientCascade MCPClient = "cascade"
6263
MCPClientCodeium MCPClient = "codeium"
@@ -75,7 +76,8 @@ var ValidVSCodeClients = []MCPClient{
7576
// ValidClients is a list of supported MCP clients
7677
var ValidClients = append(
7778
[]MCPClient{
78-
MCPClientClaude,
79+
MCPClientClaudeDesktop,
80+
MCPClientClaudeCode,
7981
MCPClientWindsurf,
8082
MCPClientCascade,
8183
MCPClientCodeium,
@@ -115,11 +117,16 @@ var codeInsidersConfig = ClientInfo{
115117
useHomeDir: false,
116118
}
117119

118-
var claudeConfig = ClientInfo{
120+
var claudeDesktopConfig = ClientInfo{
119121
configFile: "Claude/claude_desktop_config.json",
120122
useHomeDir: false,
121123
}
122124

125+
var claudeCodeConfig = ClientInfo{
126+
configFile: ".claude.json",
127+
useHomeDir: true,
128+
}
129+
123130
var cursorConfig = ClientInfo{
124131
configFile: ".cursor/settings.json",
125132
useHomeDir: true,
@@ -139,7 +146,8 @@ var clientRegistry = map[MCPClient]ClientInfo{
139146
MCPClientCode: vscodeConfig,
140147
MCPClientVSCodeInsiders: codeInsidersConfig,
141148
MCPClientInsiders: codeInsidersConfig,
142-
MCPClientClaude: claudeConfig,
149+
MCPClientClaudeDesktop: claudeDesktopConfig,
150+
MCPClientClaudeCode: claudeCodeConfig,
143151
MCPClientCursor: cursorConfig,
144152
MCPClientKiro: kiroConfig,
145153
}

src/pkg/mcp/setup_test.go

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,50 +38,94 @@ func TestGetClientConfigPath(t *testing.T) {
3838
expectedPath: filepath.Join(homeDir, ".codeium", "windsurf", "mcp_config.json"),
3939
},
4040

41-
// Claude tests - Darwin
41+
// Claude Desktop tests - Darwin
4242
{
43-
name: "claude_darwin",
44-
client: MCPClientClaude,
43+
name: "claude_desktop_darwin",
44+
client: MCPClientClaudeDesktop,
4545
goos: "darwin",
4646
expectedPath: filepath.Join(homeDir, "Library", "Application Support", "Claude", "claude_desktop_config.json"),
4747
},
4848

49-
// Claude tests - Windows with APPDATA
49+
// Claude Desktop tests - Windows with APPDATA
5050
{
51-
name: "claude_windows_with_appdata",
52-
client: MCPClientClaude,
51+
name: "claude_desktop_windows_with_appdata",
52+
client: MCPClientClaudeDesktop,
5353
goos: "windows",
5454
appData: "C:\\Users\\TestUser\\AppData\\Roaming",
5555
expectedPath: filepath.Join("C:\\Users\\TestUser\\AppData\\Roaming", "Claude", "claude_desktop_config.json"),
5656
},
5757

58-
// Claude tests - Windows without APPDATA
58+
// Claude Desktop tests - Windows without APPDATA
5959
{
60-
name: "claude_windows_without_appdata",
61-
client: MCPClientClaude,
60+
name: "claude_desktop_windows_without_appdata",
61+
client: MCPClientClaudeDesktop,
6262
goos: "windows",
6363
appData: "",
6464
expectedPath: filepath.Join(homeDir, "AppData", "Roaming", "Claude", "claude_desktop_config.json"),
6565
},
6666

67-
// Claude tests - Linux with XDG_CONFIG_HOME
67+
// Claude Desktop tests - Linux with XDG_CONFIG_HOME
6868
{
69-
name: "claude_linux_with_xdg",
70-
client: MCPClientClaude,
69+
name: "claude_desktop_linux_with_xdg",
70+
client: MCPClientClaudeDesktop,
7171
goos: "linux",
7272
xdgConfigHome: "/home/testuser/.config",
7373
expectedPath: filepath.Join("/home/testuser/.config", "Claude", "claude_desktop_config.json"),
7474
},
7575

76-
// Claude tests - Linux without XDG_CONFIG_HOME
76+
// Claude Desktop tests - Linux without XDG_CONFIG_HOME
7777
{
78-
name: "claude_linux_without_xdg",
79-
client: MCPClientClaude,
78+
name: "claude_desktop_linux_without_xdg",
79+
client: MCPClientClaudeDesktop,
8080
goos: "linux",
8181
xdgConfigHome: "",
8282
expectedPath: filepath.Join(homeDir, ".config", "Claude", "claude_desktop_config.json"),
8383
},
8484

85+
// Claude Code tests - Darwin
86+
{
87+
name: "claude_code_darwin",
88+
client: MCPClientClaudeCode,
89+
goos: "darwin",
90+
expectedPath: filepath.Join(homeDir, ".claude.json"),
91+
},
92+
93+
// Claude Code tests - Linux with XDG_CONFIG_HOME
94+
{
95+
name: "claude_code_linux_with_xdg",
96+
client: MCPClientClaudeCode,
97+
goos: "linux",
98+
xdgConfigHome: "/home/testuser",
99+
expectedPath: filepath.Join(homeDir, ".claude.json"),
100+
},
101+
102+
// Claude Code tests - Linux without XDG_CONFIG_HOME
103+
{
104+
name: "claude_code_linux_without_xdg",
105+
client: MCPClientClaudeCode,
106+
goos: "linux",
107+
xdgConfigHome: "",
108+
expectedPath: filepath.Join(homeDir, ".claude.json"),
109+
},
110+
111+
// Claude Code tests - Windows with APPDATA
112+
{
113+
name: "claude_code_windows_with_appdata",
114+
client: MCPClientClaudeCode,
115+
goos: "windows",
116+
appData: "C:\\Users\\TestUser\\AppData\\Roaming",
117+
expectedPath: filepath.Join(homeDir, ".claude.json"),
118+
},
119+
120+
// Claude code tests - Windows without APPDATA
121+
{
122+
name: "claude_code_windows_without_appdata",
123+
client: MCPClientClaudeCode,
124+
goos: "windows",
125+
appData: "",
126+
expectedPath: filepath.Join(homeDir, ".claude.json"),
127+
},
128+
85129
// Cursor tests
86130
{
87131
name: "cursor",

0 commit comments

Comments
 (0)