Skip to content

Commit fe84544

Browse files
authored
Merge pull request #53 from docker/slim/socket
Add socket server to the extension
2 parents 32c81c2 + 4149887 commit fe84544

File tree

6 files changed

+33
-41
lines changed

6 files changed

+33
-41
lines changed

docs/content/tools/docs/claude-desktop.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Use our Docker Desktop extension to automatically register and use our tools.
1212

1313
# Manual Setup
1414

15-
Enable mcp_run in your claude_desktop_config.json file using the following snippet. See the [quickstart for Claude Desktop Users](https://modelcontextprotocol.io/quickstart/user) for more details.
15+
Enable mcp_docker in your claude_desktop_config.json file using the following snippet. See the [quickstart for Claude Desktop Users](https://modelcontextprotocol.io/quickstart/user) for more details.
1616

1717
```json
1818

@@ -21,15 +21,10 @@ Enable mcp_run in your claude_desktop_config.json file using the following snipp
2121
"mcp_docker": {
2222
"command": "docker",
2323
"args": [
24-
"run", "--rm", "-i", "--pull", "always",
25-
"-v", "/var/run/docker.sock:/var/run/docker.sock",
26-
"--mount", "type=volume,source=docker-prompts,target=/prompts",
27-
"mcp/docker:latest",
28-
"serve",
29-
"--mcp",
30-
"--register", "github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md"
24+
"run", "-i", "--rm", "alpine/socat", "STDIO", "TCP:host.docker.internal:8811"
3125
]
3226
}
27+
}
3328
}
3429
```
3530

docs/content/tools/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ or manually [configure claude desktop](../docs/claude-desktop) to use the `mcp/r
1919

2020
Restarting desktop should be a one-time activity. However, Claude
2121
Desktop does not support the `tools/list_changed` notification so we
22-
currently have to restart desktop more less continuously. Fire up those keybinds :)
22+
currently have to restart desktop more less continuously. Use `alt + r` to restart Claude Desktop.
2323

2424
### Try a prompt
2525

docs/content/tools/quickstsart_cursor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ weight: 3
1616
2. Choose `Command` mode and then copy and paste the following string into the field labeled "Command".
1717

1818
```
19-
docker run -i --rm -v /var/run/docker.sock:/var/run/docker.sock --mount type=volume,source=docker-prompts,target=/prompts mcp/docker:latest serve --mcp --register github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md
19+
docker run --rm -i alpine/socat:latest STDIO TCP:host.docker.internal:8811
2020
```
2121

2222
After entering this command, the server will start and you should see a list of available tools.

src/extension/docker-compose.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
services:
2-
labs-ai-tools-for-devs:
3-
image: ${DESKTOP_PLUGIN_IMAGE}
4-
2+
mcp_docker:
3+
image: mcp/docker
4+
ports:
5+
- 8811:8811
6+
volumes:
7+
- "/var/run/docker.sock:/var/run/docker.sock"
8+
- "docker-prompts:/prompts"
9+
command:
10+
- serve
11+
- --mcp
12+
- --port
13+
- "8811"
14+
- --register
15+
- github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md
16+
volumes:
17+
docker-prompts:
18+
name: docker-prompts

src/extension/ui/src/components/ClaudeConfigSyncStatus.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,12 @@ import { ExecResult } from "@docker/extension-api-client-types/dist/v1";
88
const DOCKER_MCP_CONFIG = {
99
"command": "docker",
1010
"args": [
11-
"run",
12-
"--rm",
13-
"-i",
14-
"--pull",
15-
"always",
16-
"-v",
17-
"/var/run/docker.sock:/var/run/docker.sock",
18-
"--mount",
19-
"type=volume,source=docker-prompts,target=/prompts",
20-
"mcp/docker:latest",
21-
"serve",
22-
"--mcp",
23-
"--register",
24-
"github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md"
11+
"run",
12+
"-i",
13+
"--rm",
14+
"alpine/socat",
15+
"STDIO",
16+
"TCP:host.docker.internal:8811"
2517
]
2618
}
2719

@@ -224,4 +216,5 @@ export const ClaudeConfigSyncStatus = ({ client, setHasConfig }: { client: v1.Do
224216
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 184 40" fill="currentColor"><path shapeRendering="optimizeQuality" fill="#D97757" d="m7.75 26.27 7.77-4.36.13-.38-.13-.21h-.38l-1.3-.08-4.44-.12-3.85-.16-3.73-.2-.94-.2L0 19.4l.09-.58.79-.53 1.13.1 2.5.17 3.75.26 2.72.16 4.03.42h.64l.09-.26-.22-.16-.17-.16-3.88-2.63-4.2-2.78-2.2-1.6L3.88 11l-.6-.76-.26-1.66L4.1 7.39l1.45.1.37.1 1.47 1.13 3.14 2.43 4.1 3.02.6.5.24-.17.03-.12-.27-.45L13 9.9l-2.38-4.1-1.06-1.7-.28-1.02c-.1-.42-.17-.77-.17-1.2L10.34.21l.68-.22 1.64.22.69.6 1.02 2.33 1.65 3.67 2.56 4.99.75 1.48.4 1.37.15.42h.26v-.24l.21-2.81.39-3.45.38-4.44.13-1.25.62-1.5L23.1.57l.96.46.79 1.13-.11.73-.47 3.05-.92 4.78-.6 3.2h.35l.4-.4 1.62-2.15 2.72-3.4 1.2-1.35 1.4-1.49.9-.71h1.7l1.25 1.86-.56 1.92-1.75 2.22-1.45 1.88-2.08 2.8-1.3 2.24.12.18.31-.03 4.7-1 2.54-.46 3.03-.52 1.37.64.15.65-.54 1.33-3.24.8-3.8.76-5.66 1.34-.07.05.08.1 2.55.24 1.09.06h2.67l4.97.37 1.3.86.78 1.05-.13.8-2 1.02-2.7-.64-6.3-1.5-2.16-.54h-.3v.18l1.8 1.76 3.3 2.98 4.13 3.84.21.95-.53.75-.56-.08-3.63-2.73-1.4-1.23-3.17-2.67h-.21v.28l.73 1.07 3.86 5.8.2 1.78-.28.58-1 .35-1.1-.2L26 33.14l-2.33-3.57-1.88-3.2-.23.13-1.11 11.95-.52.61-1.2.46-1-.76-.53-1.23.53-2.43.64-3.17.52-2.52.47-3.13.28-1.04-.02-.07-.23.03-2.36 3.24-3.59 4.85-2.84 3.04-.68.27-1.18-.61.11-1.09.66-.97 3.93-5 2.37-3.1 1.53-1.79-.01-.26h-.09L6.8 30.56l-1.86.24-.8-.75.1-1.23.38-.4 3.14-2.16Z"></path><path shapeRendering="optimizeQuality" d="M64.48 33.54c-5.02 0-8.45-2.8-10.07-7.11a19.19 19.19 0 0 1-1.23-7.03c0-7.23 3.24-12.25 10.4-12.25 4.81 0 7.78 2.1 9.47 7.11h2.06l-.28-6.91c-2.88-1.86-6.48-2.8-10.86-2.8-6.17 0-11.42 2.76-14.34 7.74a16.77 16.77 0 0 0-2.22 8.65c0 5.53 2.61 10.43 7.51 13.15a17.51 17.51 0 0 0 8.73 2.06c4.78 0 8.57-.91 11.93-2.5l.87-7.62h-2.1c-1.26 3.48-2.76 5.57-5.25 6.68-1.22.55-2.76.83-4.62.83ZM86.13 7.15l.2-3.4h-1.42l-6.32 1.9v1.03l2.8 1.3v23.78c0 1.62-.83 1.98-3 2.25v1.74h10.75v-1.74c-2.18-.27-3-.63-3-2.25V7.16Zm42.75 29h.83l7.27-1.38v-1.78l-1.02-.08c-1.7-.16-2.14-.51-2.14-1.9V18.33l.2-4.07h-1.15l-6.87.99v1.74l.67.12c1.86.27 2.41.79 2.41 2.09v11.3c-1.78 1.38-3.48 2.25-5.5 2.25-2.24 0-3.63-1.14-3.63-3.8V18.34l.2-4.07h-1.18l-6.88.99v1.74l.71.12c1.86.27 2.41.79 2.41 2.09v10.43c0 4.42 2.5 6.52 6.48 6.52 3.04 0 5.53-1.62 7.4-3.87l-.2 3.87ZM108.9 22.08c0-5.65-3-7.82-8.42-7.82-4.78 0-8.25 1.98-8.25 5.26 0 .98.35 1.73 1.06 2.25l3.64-.48c-.16-1.1-.24-1.77-.24-2.05 0-1.86.99-2.8 3-2.8 2.97 0 4.47 2.09 4.47 5.45v1.1l-7.5 2.25c-2.5.68-3.92 1.27-4.87 2.65a5 5 0 0 0-.7 2.8c0 3.2 2.2 5.46 5.96 5.46 2.72 0 5.13-1.23 7.23-3.56.75 2.33 1.9 3.56 3.95 3.56 1.66 0 3.16-.67 4.5-1.98l-.4-1.38c-.58.16-1.14.24-1.73.24-1.15 0-1.7-.91-1.7-2.69v-8.26Zm-9.6 10.87c-2.05 0-3.32-1.19-3.32-3.28 0-1.42.67-2.25 2.1-2.73l6.08-1.93v5.84c-1.94 1.47-3.08 2.1-4.86 2.1Zm63.3 1.82v-1.78l-1.03-.08c-1.7-.16-2.13-.51-2.13-1.9V7.15l.2-3.4h-1.43l-6.32 1.9v1.03l2.8 1.3v7.82a8.83 8.83 0 0 0-5.37-1.54c-6.28 0-11.18 4.78-11.18 11.93 0 5.89 3.52 9.96 9.32 9.96 3 0 5.61-1.46 7.23-3.72l-.2 3.72h.84l7.27-1.38Zm-13.16-18.14c3 0 5.25 1.74 5.25 4.94v9a7.2 7.2 0 0 1-5.21 2.1c-4.3 0-6.48-3.4-6.48-7.94 0-5.1 2.49-8.1 6.44-8.1Zm28.53 4.5c-.56-2.64-2.18-4.14-4.43-4.14-3.36 0-5.69 2.53-5.69 6.16 0 5.37 2.84 8.85 7.43 8.85a8.6 8.6 0 0 0 7.39-4.35l1.34.36c-.6 4.66-4.82 8.14-10 8.14-6.08 0-10.27-4.5-10.27-10.9 0-6.45 4.55-10.99 10.63-10.99 4.54 0 7.74 2.73 8.77 7.47l-15.84 4.86v-2.14l10.67-3.31Z"></path></svg>
225217
</Button>
226218
</Badge >
227-
}
219+
}
220+

src/extension/ui/src/components/Gordon.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ import { tryRunImageSync, writeFilesToHost } from '../FileWatcher';
1010
const DOCKER_MCP_CONFIG_YML = {
1111
services: {
1212
mcp_docker: {
13-
image: "mcp/docker",
14-
command: ["serve", "--mcp", "--register", "github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md"],
15-
volumes: ["/var/run/docker.sock:/var/run/docker.sock", "docker-prompts:/prompts"],
16-
"x-mcp-autoremove": true,
17-
}
18-
},
19-
volumes: {
20-
docker_prompts: {
21-
external: false
13+
image: "alpine/socat",
14+
command: ["STDIO", "TCP:host.docker.internal:8811"],
15+
"x-mcp-autoremove": true
2216
}
2317
}
2418
}
@@ -55,10 +49,6 @@ const Gordon: React.FC<{ client: v1.DockerDesktopClient }> = ({ client }) => {
5549
services: {
5650
...current_config_yaml.services,
5751
mcp_docker: DOCKER_MCP_CONFIG_YML.services.mcp_docker
58-
},
59-
volumes: {
60-
...current_config_yaml.volumes,
61-
docker_prompts: DOCKER_MCP_CONFIG_YML.volumes.docker_prompts
6252
}
6353
}
6454
await writeFilesToHost(client, [{ path: 'gordon-mcp.yml', content: stringify(new_config) }], [{ source: path, target: '/project' }], '/project')

0 commit comments

Comments
 (0)