Skip to content

Commit 7e0773a

Browse files
authored
Add Zed client configuration (docker#143)
* Add tailscale/hujson for JSON parsing Add package for JSON parsing that supports comments used in Zed's `$HOME/.config/zed/settings.json`. Without JSON parsing that understands comments yq fails to read the settings.json file. https://github.com/tailscale/hujson * style: Fix indentation * Add preprocessing of input Add preprocessing to handle comments in JSON using tailscale/hujson. * feat: Add Zed client Add client configuration for Zed https://zed.dev/ Addresses docker#58 * chore: update docs
1 parent 6a5b815 commit 7e0773a

File tree

30 files changed

+2499
-75
lines changed

30 files changed

+2499
-75
lines changed

cmd/docker-mcp/client/config.yml

Lines changed: 68 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ system:
44
source: https://claude.ai/download
55
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/claude.svg
66
installCheckPaths:
7-
- /Applications/Claude.app
8-
- $AppData\Claude\
7+
- /Applications/Claude.app
8+
- $AppData\Claude\
99
paths:
10-
linux:
10+
linux:
1111
- $HOME/.config/claude/claude_desktop_config.json
12-
darwin:
12+
darwin:
1313
- $HOME/Library/Application Support/Claude/claude_desktop_config.json
14-
windows:
14+
windows:
1515
- $APPDATA\Claude\claude_desktop_config.json
1616
yq:
1717
list: '.mcpServers | to_entries | map(.value + {"name": .key})'
@@ -22,14 +22,14 @@ system:
2222
source: https://www.continue.dev/
2323
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/continue.svg
2424
installCheckPaths:
25-
- $HOME/.continue
26-
- $USERPROFILE\.continue
25+
- $HOME/.continue
26+
- $USERPROFILE\.continue
2727
paths:
28-
linux:
28+
linux:
2929
- $HOME/.continue/config.yaml
30-
darwin:
30+
darwin:
3131
- $HOME/.continue/config.yaml
32-
windows:
32+
windows:
3333
- $USERPROFILE\.continue\config.yaml
3434
yq:
3535
list: .mcpServers
@@ -40,14 +40,14 @@ system:
4040
source: https://www.cursor.com/
4141
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/cursor.svg
4242
installCheckPaths:
43-
- /Applications/Cursor.app
44-
- $AppData/Cursor/
43+
- /Applications/Cursor.app
44+
- $AppData/Cursor/
4545
paths:
46-
linux:
46+
linux:
4747
- $HOME/.cursor/mcp.json
48-
darwin:
48+
darwin:
4949
- $HOME/.cursor/mcp.json
50-
windows:
50+
windows:
5151
- $USERPROFILE\.cursor\mcp.json
5252
yq:
5353
list: '.mcpServers | to_entries | map(.value + {"name": .key})'
@@ -58,14 +58,14 @@ system:
5858
source: https://github.com/google-gemini/gemini-cli
5959
icon: https://avatars.githubusercontent.com/u/161781182?s=120&v=4
6060
installCheckPaths:
61-
- $HOME/.gemini
62-
- $USERPROFILE\.gemini
61+
- $HOME/.gemini
62+
- $USERPROFILE\.gemini
6363
paths:
64-
linux:
64+
linux:
6565
- $HOME/.gemini/settings.json
66-
darwin:
66+
darwin:
6767
- $HOME/.gemini/settings.json
68-
windows:
68+
windows:
6969
- $USERPROFILE\.gemini\settings.json
7070
yq:
7171
list: '.mcpServers | to_entries | map(.value + {"name": .key})'
@@ -76,47 +76,48 @@ system:
7676
source: https://github.com/block/goose
7777
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/goose.png
7878
installCheckPaths:
79-
- $HOME/.config/goose
80-
- $USERPROFILE\.config\goose
79+
- $HOME/.config/goose
80+
- $USERPROFILE\.config\goose
8181
paths:
82-
linux:
82+
linux:
8383
- $HOME/.config/goose/config.yaml
84-
darwin:
84+
darwin:
8585
- $HOME/.config/goose/config.yaml
86-
windows:
86+
windows:
8787
- $APPDATA\Block\goose\config\config.yaml
8888
yq:
8989
list: '.extensions | to_entries | map(select(.value.bundled != true)) | map(.value + {"name": .key})'
90-
set: '.extensions[$SIMPLE_NAME] = {
91-
"args": $JSON.args,
92-
"bundled": null,
93-
"cmd": $JSON.command,
94-
"description": "The Docker MCP Toolkit allows for easy configuration and consumption of MCP servers from the Docker MCP Catalog",
95-
"enabled": true,
96-
"env_keys": [],
97-
"envs": {},
98-
"name": $SIMPLE_NAME,
99-
"timeout": 300,
100-
"type": "stdio"
101-
}'
90+
set: |
91+
.extensions[$SIMPLE_NAME] = {
92+
"args": $JSON.args,
93+
"bundled": null,
94+
"cmd": $JSON.command,
95+
"description": "The Docker MCP Toolkit allows for easy configuration and consumption of MCP servers from the Docker MCP Catalog",
96+
"enabled": true,
97+
"env_keys": [],
98+
"envs": {},
99+
"name": $SIMPLE_NAME,
100+
"timeout": 300,
101+
"type": "stdio"
102+
}
102103
del: del(.extensions[$SIMPLE_NAME])
103104
lmstudio:
104105
displayName: LM Studio
105106
source: https://lmstudio.ai/
106107
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/lmstudio.png
107108
installCheckPaths:
108-
- $HOME/.lmstudio
109-
- $HOME/.cache/lm-studio
110-
- $USERPROFILE\.lmstudio
111-
- $USERPROFILE\.cache\lm-studio
109+
- $HOME/.lmstudio
110+
- $HOME/.cache/lm-studio
111+
- $USERPROFILE\.lmstudio
112+
- $USERPROFILE\.cache\lm-studio
112113
paths:
113-
linux:
114+
linux:
114115
- $HOME/.cache/lm-studio/mcp.json
115116
- $HOME/.lmstudio/mcp.json
116-
darwin:
117+
darwin:
117118
- $HOME/.cache/lm-studio/mcp.json
118119
- $HOME/.lmstudio/mcp.json
119-
windows:
120+
windows:
120121
- $USERPROFILE\.cache\lm-studio\mcp.json
121122
- $USERPROFILE\.lmstudio\mcp.json
122123
yq:
@@ -128,19 +129,37 @@ system:
128129
source: https://sema4.ai/links/docker-mcp-download
129130
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/sema4.png
130131
installCheckPaths:
131-
- $HOME/.sema4ai
132-
- $USERPROFILE\AppData\Local\sema4ai
132+
- $HOME/.sema4ai
133+
- $USERPROFILE\AppData\Local\sema4ai
133134
paths:
134-
linux:
135+
linux:
135136
- $HOME/.sema4ai/sema4ai-studio/mcp_servers.json
136-
darwin:
137+
darwin:
137138
- $HOME/.sema4ai/sema4ai-studio/mcp_servers.json
138-
windows:
139+
windows:
139140
- $USERPROFILE\AppData\Local\sema4ai\sema4ai-studio\mcp_servers.json
140141
yq:
141142
list: '.mcpServers | to_entries | map(.value + {"name": .key})'
142143
set: .mcpServers[$NAME] = $JSON+{"transport":"stdio"}
143144
del: del(.mcpServers[$NAME])
145+
zed:
146+
displayName: Zed
147+
source: https://zed.dev/
148+
icon: https://raw.githubusercontent.com/docker/mcp-gateway/main/img/client/zed.png
149+
installCheckPaths:
150+
- $HOME/.config/zed
151+
- $USERPROFILE\.config\zed
152+
paths:
153+
linux:
154+
- $HOME/.config/zed/settings.json
155+
darwin:
156+
- $HOME/.config/zed/settings.json
157+
windows:
158+
- $USERPROFILE\.config\zed\settings.json
159+
yq:
160+
list: '.context_servers | to_entries | map(.value + {"name": .key})'
161+
set: .context_servers[$NAME] = {"source":"custom","enabled":true}+$JSON
162+
del: del(.context_servers[$NAME])
144163
project:
145164
cursor:
146165
displayname: Cursor

cmd/docker-mcp/client/config_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,27 @@ func Test_yq_list(t *testing.T) {
9999
HTTPServers: []MCPServerHTTP{},
100100
},
101101
},
102+
{
103+
name: "Zed",
104+
cfg: config.System[vendorZed],
105+
content: "list/zed.jsonc",
106+
result: &MCPJSONLists{
107+
STDIOServers: []MCPServerSTDIO{
108+
{
109+
Name: "MCP_DOCKER",
110+
Command: "docker",
111+
Args: []string{"mcp", "gateway", "run"},
112+
},
113+
{
114+
Name: "sqlite-server",
115+
Command: "uvx",
116+
Args: []string{"mcp-server-sqlite", "--db-path", "/Users/moby/test.db"},
117+
},
118+
},
119+
SSEServers: []MCPServerSSE{},
120+
HTTPServers: []MCPServerHTTP{},
121+
},
122+
},
102123
}
103124
for _, tc := range tests {
104125
t.Run(tc.name, func(t *testing.T) {
@@ -175,6 +196,23 @@ func Test_yq_add_del(t *testing.T) {
175196
afterAdd: "vscode-create/after-add.json",
176197
afterDel: "vscode-create/after-del.json",
177198
},
199+
{
200+
name: "Zed - append",
201+
cfg: config.System[vendorZed],
202+
original: "zed-append/original.jsonc",
203+
afterAdd: "zed-append/after-add.json",
204+
afterDel: "zed-append/after-del.json",
205+
},
206+
{
207+
name: "Zed - create",
208+
cfg: config.System[vendorZed],
209+
// The real configuation file is .json and nothing rewrites
210+
// the file extension. The .jsonc extension is only used so
211+
// that IDEs do not complain that comments are invalid .json
212+
original: "zed-create/original.jsonc",
213+
afterAdd: "zed-create/after-add.json",
214+
afterDel: "zed-create/after-del.json",
215+
},
178216
}
179217
for _, tc := range tests {
180218
t.Run(tc.name, func(t *testing.T) {

cmd/docker-mcp/client/ls.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const (
1515
vendorClaudeDesktop = "claude-desktop"
1616
vendorContinueDev = "continue"
1717
vendorGordon = "gordon"
18+
vendorZed = "zed"
1819
)
1920

2021
const (
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"foo":true,"context_servers":{"something":{},"my-server":{"source":"custom","enabled":true,"command":"docker","args":["mcp","gateway","run"]}}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"foo":true,"context_servers":{"something":{}}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Zed settings
3+
//
4+
// For information on how to configure Zed, see the Zed
5+
// documentation: https://zed.dev/docs/configuring-zed
6+
//
7+
// To see all of Zed's default settings without changing your
8+
// custom settings, run `zed: open default settings` from the
9+
// command palette (cmd-shift-p / ctrl-shift-p)
10+
"foo": true,
11+
"context_servers": {
12+
"something": {}
13+
}
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ui_font_size":16,"buffer_font_size":15,"theme":{"mode":"system","light":"One Light","dark":"One Dark"},"vim_mode":true,"context_servers":{"my-server":{"source":"custom","enabled":true,"command":"docker","args":["mcp","gateway","run"]}}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ui_font_size":16,"buffer_font_size":15,"theme":{"mode":"system","light":"One Light","dark":"One Dark"},"vim_mode":true,"context_servers":{}}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// Zed settings
3+
//
4+
// For information on how to configure Zed, see the Zed
5+
// documentation: https://zed.dev/docs/configuring-zed
6+
//
7+
// To see all of Zed's default settings without changing your
8+
// custom settings, run `zed: open default settings` from the
9+
// command palette (cmd-shift-p / ctrl-shift-p)
10+
"ui_font_size": 16,
11+
"buffer_font_size": 15,
12+
"theme": {
13+
"mode": "system",
14+
"light": "One Light",
15+
"dark": "One Dark"
16+
},
17+
"vim_mode": true
18+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Zed settings
3+
//
4+
// For information on how to configure Zed, see the Zed
5+
// documentation: https://zed.dev/docs/configuring-zed
6+
"ui_font_size": 16,
7+
"buffer_font_size": 15,
8+
"theme": {
9+
"mode": "system",
10+
"light": "One Light",
11+
"dark": "One Dark",
12+
},
13+
"vim_mode": true,
14+
"context_servers": {
15+
"MCP_DOCKER": {
16+
"command": "docker",
17+
"args": ["mcp", "gateway", "run"],
18+
},
19+
"sqlite-server": {
20+
"command": "uvx",
21+
"args": ["mcp-server-sqlite", "--db-path", "/Users/moby/test.db"],
22+
},
23+
},
24+
}

0 commit comments

Comments
 (0)