Repository navigation
Description
Summary
On a stock macOS machine with Docker Desktop installed and running, mcpproxy cannot launch any Docker-based upstream server. The spawned process fails with zsh:1: command not found: docker, even though:
- Docker Desktop is installed (
/Applications/Docker.app) - The Docker daemon is running (socket present at
~/.docker/run/docker.sock) - mcpproxy's own status reports
docker_available: true/global_enabled: true
The root cause is that a default Docker Desktop install does not place the docker CLI on a standard PATH directory. The binary lives inside the app bundle:
/Applications/Docker.app/Contents/Resources/bin/docker
Docker Desktop only symlinks it into /usr/local/bin if the user opts into "install CLI tools" (which requires admin privileges). mcpproxy spawns upstream servers with a sanitized PATH that does not include the app-bundle bin directory, so docker is unresolvable at spawn time.
This makes Docker isolation / Docker-based servers fail out-of-the-box for any user who installed Docker Desktop the default way.
Environment
- mcpproxy: v0.39.0 (personal), darwin/arm64
- macOS: 26.5.1 (arm64, Apple Silicon)
- Docker Desktop CLI: Docker version 29.5.3, build d1c06ef (resolvable only via full path)
command -v docker→ NOT FOUND (no symlink in/usr/local/binor/opt/homebrew/bin)
PATH mcpproxy uses when spawning servers (from logs):
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
Note /Applications/Docker.app/Contents/Resources/bin is absent.
Steps to reproduce
- Fresh macOS machine. Install Docker Desktop the default way (do not run the optional "install CLI tools" / privileged helper step). Start Docker Desktop.
- Confirm the daemon is up but the CLI is not on PATH:
ls ~/.docker/run/docker.sock→ existscommand -v docker→ not found/Applications/Docker.app/Contents/Resources/bin/docker --version→ works
- Add a Docker-based upstream server, e.g. a server whose command is
docker run --rm -i … <image>. - Observe it never connects.
Expected
mcpproxy either:
- discovers Docker Desktop's bundled CLI path automatically and uses it, or
- surfaces a clear, actionable error ("Docker CLI not found on PATH — install Docker Desktop CLI tools or add
/Applications/Docker.app/Contents/Resources/binto PATH") instead of a raw repeatedcommand not found.
And docker_available should reflect whether the docker binary is actually resolvable on the spawn PATH, not just whether Docker is configured/enabled.
Actual
- Server stays in
Errorstate, retrying (observedretry_count: 21). last_error/ healthdetailis a wall of repeated:failed to connect: stdio transport (command="docker", docker_isolation=true): server process exited before completing the MCP initialize handshake; recent stderr: | zsh:1: command not found: docker | zsh:1: command not found: docker | ... (repeated ~20x)- Meanwhile
upstream_servers listreports"docker_status":{"available":true,"global_enabled":true,...}and per-server"docker_available":true— which is misleading, since the CLI is not actually invocable.
Suggested fixes
- PATH enhancement / Docker discovery: when resolving
docker, also probe well-known Docker Desktop locations, especially/Applications/Docker.app/Contents/Resources/binon macOS (and the equivalent on Windows/Linux). If found, prepend it to the spawn PATH or invoke via absolute path. - Accurate availability check: make
docker_availabletest actual binary resolvability on the PATH used for spawning (e.g.exec.LookPath("docker")against that PATH), not just config/daemon presence. - Better diagnostics: detect
command not found: <cmd>from spawn stderr and replace the repeated raw output with a single actionable message pointing the user to install/symlink the CLI; consider de-duplicating the repeated stderr lines and capping retries with a clearer terminal error.
Workaround (for other users hitting this)
Symlink the bundled CLI into a PATH dir mcpproxy already uses, e.g.:
ln -sf "/Applications/Docker.app/Contents/Resources/bin/docker" /opt/homebrew/bin/docker(or enable Docker Desktop's "Install CLI tools" so it symlinks into /usr/local/bin), then restart the affected servers.
Activity
fix(docker): resolve docker by absolute path on macOS spawn; honest d…
algis-dumbris commentedon Jun 17, 2026
Update: v0.39.1 — partially fixed, core issue remains
Tested on mcpproxy v0.39.1 (darwin/arm64, macOS 26.5.1, Docker Desktop 29.5.3), with the
dockerCLI still not on the user PATH (no symlink in/usr/local/binor/opt/homebrew/bin).✅ Improved
upstream_servers listnow reports the bundled CLI:command not found: docker (repeated 7×).❌ Still broken (the core bug)
Docker-based servers still fail to start. mcpproxy now discovers
docker_pathbut does not use it when spawning the server — it still invokes baredocker, which is unresolvable on the spawn PATH:Both
jira-gcoreandslack-gcoreremain inErrorstate.Ask
Please wire the discovered
docker_pathinto the actual spawn — either invoke docker by its absolute path, or prepend its directory (/Applications/Docker.app/Contents/Resources/bin) to the PATH used to launch upstream servers. Right now detection + diagnostics are correct, but the spawn path isn't using them, so the failure persists.Manual workaround still required:
ln -sf "/Applications/Docker.app/Contents/Resources/bin/docker" /opt/homebrew/bin/dockerfix(docker): preserve Docker daemon env vars on direct-exec spawn path
fix(docker): capture DOCKER_* daemon vars from login shell for direct…
fix(docker): stat-probe overrides live negative cache in ResolveDocke…
fix(docker): stat-probe overrides live negative cache in ResolveDocke…
test(httpapi): add GetDockerCLISource to fakeRuntimeStats for schema v5
feat(telemetry): emit docker isolation flag, CLI source + docker fail…
test(httpapi): add GetDockerCLISource to fakeRuntimeStats for schema v5
fix(shellwrap): set docker source on stat-probe cache upgrade (Codex P2)
fix(diagnostics): classify zsh 'command not found: docker' as CLI-not…
feat(telemetry): emit docker isolation flag, CLI source + docker fail…
test(httpapi): add GetDockerCLISource to fakeRuntimeStats for schema v5
fix(shellwrap): set docker source on stat-probe cache upgrade (Codex P2)
fix(diagnostics): classify zsh 'command not found: docker' as CLI-not…
5 remaining items
feat(connect): stat-only overall status + on-demand content reads (US…
fix(docker): observable spawn decision + accurate transport error lab…
feat(connect): classify config access + macOS TCC denial remediation …
algis-dumbris commentedon Jun 18, 2026
Debug-level trace: the user-supplied
dockercommand path is still shell-wrapped with baredocker(v0.41.0)Reproduced on v0.41.0 with
logging.level=debug. For upstream servers whose command isdocker(e.g.docker run … <image>), mcpproxy resolves the bundled CLI for status (docker_pathis correct) but the spawn is unconditionally shell-wrapped with baredocker— the resolved absolute path is never substituted in. The#703direct-exec fix does not cover this path.Exact spawned process (
core/connection.go→Initialized stdio transport, secrets redacted):Relevant decision lines:
core/connection.go—Docker command detected, setting up container ID trackingcore/connection_stdio.go:391—shellwrap: wrapping command with user login shell…"shell":"/bin/zsh"core/connection_stdio.go:175—Wrapping command with user shell for full environment inheritancetransport/stdio.go:203—Process group configuration applied…"command":"/bin/zsh","args":["-l","-c","docker run …"]And the login-shell hydration that #703's gate depends on captured no docker-bearing PATH and no
DOCKER_*:So
/bin/zsh -l -c "docker …"runs with a login-shell PATH that has nodocker(Docker Desktop bundle dir absent) →zsh:1: command not found: docker.Ask
When the upstream command is
docker(not just the isolation-injected case), substitute the verified absolute docker path into the wrapped command (or direct-exec it), instead of emitting baredockerinto$SHELL -l -c. Right now resolution succeeds for the status field but is ignored at spawn time on this path.Env: mcpproxy v0.41.0, macOS 26.5.1 (arm64), Docker Desktop 29.5.3, docker not symlinked onto PATH.
fix(upstream): direct-exec resolved docker binary for user-supplied d…
Dumbris commentedon Jun 18, 2026
Fixed in #714 (merged to
mainas 5cc9eee). User-supplieddocker runupstreams now go through the same resolve→direct-exec decision as the isolation path (resolveDockerSpawn): on macOS the resolved absolute Docker Desktop bundle binary (/Applications/Docker.app/Contents/Resources/bin/docker) is exec'd directly instead of shell-wrapping baredocker, so it no longer fails withzsh:1: command not found: dockerwhen the CLI isn't on the login-shell PATH. Will ship in the next release.fix(upstream): prepend docker bundle dir to child PATH for credential…
algis-dumbris commentedon Jun 18, 2026
Confirmed fixed in v0.41.1 — docker-command upstreams (jira-gcore, slack-gcore) connect with the docker CLI resolved by absolute path, verified with
dockerstill NOT on PATH (no symlink), macOS 26.5.1, Docker Desktop 29.5.3. The credential-helper follow-on (#715) is also fixed in v0.41.2. Thanks for the fast turnaround!fix(connect): merge onboarding connected_client_ids into wizard clien…
docs(connect): add @failure 403 swagger annotations for denied connec…
feat(connect): on-demand per-client status REST route + denied remedi…
feat(connect): render access_state tri-state + macOS denial remediati…
fix(isolation): report effective isolation state instead of treating …
fix(docker): pick a git-capable isolation image, and classify contain…