docker: unknown command: docker mcp
まだ誰も着手していません。
評価
調査の方向性
まず、docker mcp gateway run を使って Windows の失敗を再現し、docker-mcp.exe が表示される Docker CLI プラグイン一覧と比較します。docker mcp CLI のエントリポイントと、issue に示されている stdio の起動を追跡します。MCP サブコマンドが見つかり、TypeScript クライアントが正常に接続してツールを一覧表示できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
this.transport = new StdioClientTransport({
"command": "docker",
"args": [
"mcp",
"gateway",
"run"
]
});
await this.mcp.connect(this.transport);
const toolsResult = await this.mcp.listTools();
Error:
docker: unknown command: docker mcp
Run 'docker --help' for more information
Failed to connect to MCP server: McpError: MCP error -32000: Connection closed
at Client._onclose (D:\workspace\fix\mcp\node_modules\.pnpm\@modelcontextprotocol+sdk@1.13.0\node_modules\@modelcontex
tprotocol\sdk\dist\cjs\shared\protocol.js:101:23)
at _transport.onclose (D:\workspace\fix\mcp\node_modules\.pnpm\@modelcontextprotocol+sdk@1.13.0\node_modules\@modelcon
textprotocol\sdk\dist\cjs\shared\protocol.js:73:18)
at ChildProcess.<anonymous> (D:\workspace\fix\mcp\node_modules\.pnpm\@modelcontextprotocol+sdk@1.13.0\node_modules\@mo
delcontextprotocol\sdk\dist\cjs\client\stdio.js:97:77)
at ChildProcess.emit (node:events:518:28)
at cp.emit (D:\workspace\fix\mcp\node_modules\.pnpm\cross-spawn@7.0.6\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
code: -32000,
data: undefined
}
Reproduce
mcp sdk will execute commands in the following way:
spawn("docker", [],{
stdio: "inherit",
env: getDefaultEnvironment()
})
The mcp subcommand cannot be found when calling with this method.
> tsc && chmod 755 build/index.js
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Common Commands:
run Create and run a new container from an image
exec Execute a command in a running container
ps List containers
build Build an image from a Dockerfile
pull Download an image from a registry
push Upload an image to a registry
images List images
login Authenticate to a registry
logout Log out from a registry
search Search Docker Hub for images
version Show the Docker version information
info Display system-wide information
Management Commands:
builder Manage builds
container Manage containers
context Manage contexts
image Manage images
manifest Manage Docker image manifests and manifest lists
network Manage networks
plugin Manage plugins
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Swarm Commands:
swarm Manage Swarm
Commands:
attach Attach local standard input, output, and error streams to a running container
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
export Export a container's filesystem as a tar archive
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
wait Block until one or more containers stop, then print their exit codes
Global Options:
--config string Location of client config files (default
"C:\\Users\\chen\\.docker")
-c, --context string Name of the context to use to connect to the
daemon (overrides DOCKER_HOST env var and
default context set with "docker context use")
-D, --debug Enable debug mode
-H, --host list Daemon socket to connect to
-l, --log-level string Set the logging level ("debug", "info",
"warn", "error", "fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default
"C:\\Users\\chen\\.docker\\ca.pem")
--tlscert string Path to TLS certificate file (default
"C:\\Users\\chen\\.docker\\cert.pem")
--tlskey string Path to TLS key file (default
"C:\\Users\\chen\\.docker\\key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
### Expected behavior
Working properly
### docker version
```bash
Client:
Version: 28.2.2
API version: 1.50
Go version: go1.24.3
Git commit: e6534b4
Built: Fri May 30 12:07:16 2025
OS/Arch: windows/amd64
Context: desktop-linux
Server: Docker Desktop 4.42.1 (196648)
Engine:
Version: 28.2.2
API version: 1.50 (minimum version 1.24)
Go version: go1.24.3
Git commit: 45873be
Built: Fri May 30 12:07:26 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client:
Version: 28.2.2
Context: desktop-linux
Debug Mode: false
Plugins:
ai: Docker AI Agent - Ask Gordon (Docker Inc.)
Version: v1.4.0
Path: C:\Program Files\Docker\cli-plugins\docker-ai.exe
buildx: Docker Buildx (Docker Inc.)
Version: v0.24.0-desktop.2
Path: C:\Program Files\Docker\cli-plugins\docker-buildx.exe
cloud: Docker Cloud (Docker Inc.)
Version: v0.3.9
Path: C:\Program Files\Docker\cli-plugins\docker-cloud.exe
compose: Docker Compose (Docker Inc.)
Version: v2.37.1-desktop.1
Path: C:\Program Files\Docker\cli-plugins\docker-compose.exe
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.41
Path: C:\Program Files\Docker\cli-plugins\docker-debug.exe
desktop: Docker Desktop commands (Docker Inc.)
Version: v0.1.9
Path: C:\Program Files\Docker\cli-plugins\docker-desktop.exe
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.29
Path: C:\Program Files\Docker\cli-plugins\docker-extension.exe
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.0
Path: C:\Program Files\Docker\cli-plugins\docker-init.exe
mcp: Docker MCP Plugin (Docker Inc.)
Version: dev
Path: C:\Program Files\Docker\cli-plugins\docker-mcp.exe
model: Docker Model Runner (Docker Inc.)
Version: v0.1.24
Path: C:\Program Files\Docker\cli-plugins\docker-model.exe
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
Version: 0.6.0
Path: C:\Program Files\Docker\cli-plugins\docker-sbom.exe
scout: Docker Scout (Docker Inc.)
Version: v1.18.0
Path: C:\Program Files\Docker\cli-plugins\docker-scout.exe
Server:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 6
Server Version: 28.2.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Discovered Devices:
cdi: docker.com/gpu=webgpu
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
runc version: v1.2.5-0-g59923ef
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.10.14-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 1.917GiB
Name: docker-desktop
ID: d68fa413-95e0-459a-85db-9981cfd3060f
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Labels:
com.docker.desktop.address=npipe://\\.\pipe\docker_cli
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
::1/128
127.0.0.0/8
Live Restore Enabled: false
WARNING: DOCKER_INSECURE_NO_IPTABLES_RAW is set
Additional Info
No response
- 主要言語
- Go
- スター
- 6.1k
- フォーク
- 2.2k
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 47
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/cli のほかの issue
-
kind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
kind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
kind/feature status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
kind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
acceptance-tests phase-coding schema-coverage testing triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100