Purpose
docker-mcp is an MCP server that provides AI agents with complete Docker management capabilities, covering objects such as containers, images, networks, volumes, Swarm services, secrets, configs, nodes, and plugins, and can help users create and manage workflows for Docker environments. It provides stronger control and flexibility than calling the Docker CLI directly.
Main capabilities
- Typed tools and safety markers: Each operation is exposed as an independent typed tool, marked as read-only or non-read-only, with destructive operations marked separately, so clients can automatically approve reads and always confirm destructive operations based on this. The entire server can also be switched to read-only or "no-destruction" mode.
- Bounded output: Output has an upper limit and a truncation flag, avoiding silent overflow of the agent context.
- Multi-daemon management: Multiple Docker daemons can be managed in a single session, for example a local development environment and a remote production environment, connected via TCP, TLS, or SSH. Some daemons can be marked as read-only for safe monitoring.
- Can run without a Docker host: It can run on a machine where Docker is not installed, managing remote daemons via SSH, TLS, or TCP (some features require SSH). The AI itself does not need shell or SSH access.
- Monitoring and troubleshooting resources: The server exposes logs, statistics, and other information as resources, making monitoring and troubleshooting easier, for example answering questions such as "why did the container crash," "what is the Swarm status," "is there memory pressure," "disk usage of volumes," and "differences between test and production systems."
- Agent-oriented documentation: It exposes the Docker SDK reference within the session via MCP resources (and provides a callable tool fallback for clients that cannot read resources), and reports the tools registered under the current configuration via a live tool catalog resource. Each tool's description explains its neighboring tools and when to prefer it, prerequisites and side effects, and honestly states when it may still fail, enabling the agent to choose the right tool among more than 150 options on the first try.
How to use
Publishing and installation: The server is published to PyPI under the name docker-mcp-server. Add an entry pointing to uvx in the MCP configuration of the AI tool (usually mcp.json or the corresponding client file), and uv will pull and cache the package on first use. By appending ==<v after the package nameersion> Pin a version (e.g. docker-mcp-server==1.5.0). To install onto PATH, use pipx install docker-mcp-server, which provides the docker-mcp-server console script (and also installs the docker-mcp alias). You can also install an unpublished revision from git by appending @<tag-or-commit> to pin the revision.
Install as a desktop extension (.mcpb): For Claude Desktop, each GitHub Release comes with a one-click package docker-mcp-server-<version>.mcpb (and a matching .sha256). After downloading, drag it into Settings > Extensions, or use Settings > Extensions > Advanced settings > Install extension... to select the file. The install dialog shows the Docker host field and the read-only / no-destructive / disabled-domains toggles, with no need to manually edit JSON. This is a uv-type package: the uv hosted by Claude Desktop resolves dependencies and runs the server, so the only host prerequisite is Docker itself. Leaving the Docker host field empty uses the default Docker context; set an endpoint (ssh://user@host) for a remote daemon, or list multiple.
Install as a Claude plugin: The claude-plugin/ folder packages the server as a plugin for Claude Code and Cowork, for Anthropic's plugin directory. It runs uvx docker-mcp-server==<version>, pinned to the release version at the time the plugin was built, so the host needs uv. It ships with a lock file that pins every dependency by hash. It provides the same settings as the .mcpb install dialog (Docker host, read-only, no-destructive, and disabled domains), configured in Claude Code's plugin settings (/plugin).
Run as a container: Running the server as a container completely removes the Python / uv / git prerequisites; the host only needs Docker. Each release publishes prebuilt multi-architecture images (linux/amd64 + linux/arm64) to Docker Hub (gavinlucas/docker-mcp-server) and GHCR (ghcr.io/l337-org/docker-mcp-server); the two are identical. Point the MCP client at docker run and you're set. -i is required (the server uses MCP over stdio), and --rm cleans up when the client disconnects. To pin a version, replace :latest with a release tag (e.g. :1.5.1). As of 1.5.0 the image was renamed to docker-mcp-server (matching the PyPI name); the old image ghcr.io/gavinlucas/docker-mcp is frozen at 1.4.0 and no longer updated.
Accessing the daemon from inside the container: The image's default DOCKER_HOST is unix:///var/run/docker.sock. On Linux mount -v /var/run/docker.sock:/var/run/docker.sock (for rootless use $XDG_RUNTIME_DIR/docker.sock). On macOS (Docker Desktop) the real socket is usually ~/.docker/run/docker.sock. On Windows (Docker Desktop / WSL2) the engine uses a named pipe; it is recommended to use -e DOCKER_HOST=tcp://host.docker.internal:2375, but this endpoint is unauthenticated and unencrypted and should be bound only to localhost. For remote / TLS / SSH daemons you can skip the socket mount and pass -e DOCKER_HOST=....
When it applies and limitations
It applies to scenarios where AI agents manage, maintain, and audit Docker environments, including multi-environment management and read-only security monitoring. Notes: if you use a containerized MCP server or the MCPB package, the Python and uv dependencies are handled for you; a native install on Intel (x86_64) macOS requires Rust and OpenSSL 3.x, because cryptography no longer provides wheels for that platform as of 49.0.0 and must be built from source.Build; if you do not want to install the toolchain, you can use the container image. The server is optimized to support the new generation of MCP clients with lazy tool loading; for clients that still eagerly load all tools, you can configure it to exclude tools from some domains (such as excluding swarm and scout) to reduce the tool list. The Scout plugin binary adds about 195 MB from no scout to the full version, and the no-scout image defaults to DOCKER_MCP_SERVER_DISABLE=scout.
Remote daemon connection
When DOCKER_HOST is set, the server uses it directly (via docker.from_env(), so DOCKER_TLS_VERIFY / DOCKER_CERT_PATH also take effect). When DOCKER_HOST is not set, the server resolves the daemon in the same way as the docker CLI: it follows the active Docker context (DOCKER_CONTEXT, otherwise currentContext in ~/.docker/config.json), and if there is no result, it probes common socket locations. Priority: a non-empty DOCKER_HOST always takes precedence; DOCKER_CONTEXT / currentContext is queried only when DOCKER_HOST is not set; if neither yields a result, sockets are probed. TLS material attached to a remote context is not automatically applied.
DOCKER_HOST=ssh://user@remote-host is supported through a pure Python transport (paramiko), with no requirement for a system ssh binary, and host installation is consistent with the container image. Authentication uses regular SSH settings: key / agent, host keys are verified through ~/.ssh/known_hosts and unknown hosts are rejected, and fingerprints should be verified through a trusted channel before adding them. Inside the container, SSH material can be mounted read-only (-v $HOME/.ssh:/root/.ssh:ro) or the agent socket can be forwarded. CLI backend tools (Compose, Stack, Buildx, Scout, Context) call the docker CLI, and when run_docker() detects DOCKER_HOST=ssh://..., it transparently starts a local TCP proxy for each invocation, using the same credentials and hostkey policy authentication. The only exception is ProxyCommand in ~/.ssh/config (bastion host / jump host setups).
Information not provided
This material does not provide details such as docker-mcp pricing, cost, platform availability, effectiveness, or specific usage steps.