Description
The Docker MCP server fails to connect to the Docker daemon in Rootless mode because it strictly expects the socket at /var/run/docker.sock, ignoring the DOCKER_HOST environment variable.
Environment
- Docker Mode: Rootless
- DOCKER_HOST:
unix:///run/user/1000/docker.sock
- MCP Host: Cursor / npx
Steps to Reproduce
- Run the server in a Rootless Docker environment where the socket is located at
$XDG_RUNTIME_DIR/docker.sock.
- Provide
DOCKER_HOST via the env block in mcp.json or via shell.
- The server fails with:
Error: connect ENOENT /var/run/docker.sock.
Expected Behavior
The server should respect the DOCKER_HOST environment variable or provide a configuration flag (e.g., --socketPath) to specify a custom socket location.
Actual Behavior
The server hardcodes the connection to /var/run/docker.sock, making it unusable in Rootless environments without root-level symlinks.
Description
The Docker MCP server fails to connect to the Docker daemon in Rootless mode because it strictly expects the socket at
/var/run/docker.sock, ignoring theDOCKER_HOSTenvironment variable.Environment
unix:///run/user/1000/docker.sockSteps to Reproduce
$XDG_RUNTIME_DIR/docker.sock.DOCKER_HOSTvia theenvblock inmcp.jsonor via shell.Error: connect ENOENT /var/run/docker.sock.Expected Behavior
The server should respect the
DOCKER_HOSTenvironment variable or provide a configuration flag (e.g.,--socketPath) to specify a custom socket location.Actual Behavior
The server hardcodes the connection to
/var/run/docker.sock, making it unusable in Rootless environments without root-level symlinks.