Docker MCP Server

Container operations in conversation — inspect, run, debug and clean up Docker workloads.

Local serverstdioPythonGPL-3.0 600

What is the Docker MCP server?

The Docker MCP server puts container management on a conversational footing. Built by the community around the Docker SDK, it covers the daily verbs: list and inspect containers, run new ones, read logs, manage images, volumes and networks — the 80% of docker CLI usage that's really about asking "what's running and why is it unhappy?"

Debugging is where it earns its place. "Why does this container keep restarting?" becomes a real diagnostic session: the assistant checks the container state, reads the last hundred log lines, notices the OOM kill or the bad env var, and explains it. That beats copy-pasting docker logs output into a chat window — the assistant drives the investigation itself, following leads across containers.

It also does deployment-by-description: ask for "a WordPress with a MySQL backend on a shared network" and the server can compose the containers, volumes and network without you writing YAML. That's a party trick for production (use real compose files, please) but genuinely handy for spinning up throwaway environments while prototyping.

Since it talks to the Docker socket, it holds root-equivalent power over the host — treat it accordingly and keep tool-call confirmations on for anything destructive. Also worth knowing: Docker Desktop now ships an MCP Toolkit, which runs other MCP servers as containers — different job from this server, which manages Docker itself. If you want an assistant that tends your containers, this is the one.

Guardrails worth setting

  • Ask for a tail limit when reading logs. A chatty service emits thousands of lines a minute and there is no reason to spend your context window on all of them.
  • The stack-from-a-description trick runs through the server's compose prompt, which reconciles a named project against the spec you describe — rerunning it converges on that state instead of piling up duplicate containers.
  • DOCKER_HOST accepts ssh://user@host, so one config can tend a remote box. Remember that the assistant then holds that machine's socket too.
  • The tool surface is about running and inspecting containers rather than building them. Build images in your normal pipeline and let the server run the results.

What you can do with it

Container debugging

Restart loops, port conflicts and OOM kills diagnosed from real logs and state, not guesswork.

Throwaway environments

Describe a stack and get containers, volumes and networking wired up for quick experiments.

Host hygiene

Find what's eating disk — dangling images, dead containers, orphaned volumes — and clean it up.

Available tools

ToolWhat it does
list_containersList running (and stopped) containers with status
create_container / run_containerStart containers from images with ports, env and volumes
fetch_container_logsRead a container's recent log output
stop_container / remove_containerStop and clean up containers
list_images / pull_imageManage local images
list_volumes / list_networksInspect volumes and networks

How to install the Docker MCP server

{
  "mcpServers": {
    "docker": {
      "command": "uvx",
      "args": ["mcp-server-docker"]
    }
  }
}

Needs access to the Docker socket — Docker Desktop or a running dockerd.

Configuration

Python 3.12+ with uv, and a reachable Docker daemon. The server wields socket-level power — confirm destructive calls.

VariableDescriptionRequired
DOCKER_HOSTDocker daemon address if not the default local sockete.g. unix:///var/run/docker.sockOptional

Example prompts to try

  • What containers are running, and is anything in a restart loop?
  • Read the logs of the api container and tell me why it exited.
  • Spin up a Postgres 16 container with a named volume on port 5433.

Frequently asked questions

No — Docker Desktop's MCP Toolkit runs other MCP servers inside containers. This server manages Docker itself: your containers, images, volumes and networks. They solve different problems and coexist fine.