Skip to content

Commit ab47118

Browse files
committed
Replace mcp_docker in claude config with MCP_DOCKER
1 parent 8b001e3 commit ab47118

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/extension/ui/src/mcp-clients/ClaudeDesktop.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ class ClaudeDesktopClient implements MCPClient {
7575
path = path.replace('$USER', user)
7676
let payload = {
7777
mcpServers: {
78-
mcp_docker: SAMPLE_MCP_CONFIG.mcpServers.MCP_DOCKER
78+
MCP_DOCKER: SAMPLE_MCP_CONFIG.mcpServers.MCP_DOCKER
7979
}
8080
}
8181
try {
8282
const result = await client.docker.cli.exec('run', ['--rm', '--mount', `type=bind,source="${path}",target=/claude_desktop_config`, 'alpine:latest', 'sh', '-c', `"cat /claude_desktop_config/claude_desktop_config.json"`])
8383
if (result.stdout) {
8484
payload = JSON.parse(result.stdout)
85-
payload.mcpServers.mcp_docker = SAMPLE_MCP_CONFIG.mcpServers.MCP_DOCKER
85+
payload.mcpServers.MCP_DOCKER = SAMPLE_MCP_CONFIG.mcpServers.MCP_DOCKER
8686
}
8787
} catch (e) {
8888
// No config or malformed config found, overwrite it
@@ -115,15 +115,15 @@ class ClaudeDesktopClient implements MCPClient {
115115
// This method is only called after the config has been validated, so we can safely assume it's a valid config.
116116
const previousConfig = JSON.parse((await client.docker.cli.exec('run', ['--rm', '--mount', `type=bind,source="${path}",target=/claude_desktop_config`, '--workdir', '/claude_desktop_config', 'alpine:latest', 'sh', '-c', `"cat /claude_desktop_config/claude_desktop_config.json"`])).stdout || '{}')
117117
const newConfig = { ...previousConfig }
118-
delete newConfig.mcpServers.mcp_docker
118+
delete newConfig.mcpServers.MCP_DOCKER
119119
await client.docker.cli.exec('run', ['--rm', '--mount', `type=bind,source="${path}",target=/claude_desktop_config`, '--workdir', '/claude_desktop_config', 'vonwig/function_write_files:latest', `'${JSON.stringify({ files: [{ path: 'claude_desktop_config.json', content: JSON.stringify(newConfig) }] })}'`])
120120
} catch (e) {
121121
client.desktopUI.toast.error((e as any).stderr)
122122
}
123123
}
124124
validateConfig = (content: string) => {
125125
const config = JSON.parse(content)
126-
return Object.keys(config.mcpServers).some(key => key.includes('mcp_docker'))
126+
return Object.keys(config.mcpServers).some(key => key.includes('MCP_DOCKER'))
127127
}
128128
}
129129

0 commit comments

Comments
 (0)