Docker MCP server tools: which ones reach your host, and how to make your agent ask

All 19 tools of mcp-server-docker 0.3.0 (ckreiling), checked by running it against Docker: how run_container mounts any host folder, why container logs can carry secrets while the listing does not, what force does on the remove tools, and the Claude Code settings that make the rest ask.

Checked on by running mcp-server-docker 0.3.0 (PyPI, run with uvx) from ckreiling/mcp-server-docker and reading its tools/list answer. Each tier is the tool risk checker’s reading, with our reason wherever we changed it. Written by the people who make VariantGate.

The short answer

It has no read-only mode and can mount any host folder into a container running as root, so it can do whatever the Docker socket can. Allow the 4 list tools, let the other 15 ask, and point it at a Docker engine that holds nothing you care about.

Can run on their own
4
Should ask a person
15

Which Docker server this is

This page is about ckreiling/mcp-server-docker, a community server published on PyPI as mcp-server-docker. It drives one Docker engine through the Docker SDK for Python. Docker’s own MCP Toolkit and its docker mcp gateway command are a different thing: a gateway that runs other MCP servers for you.

We ran 0.3.0 with uvx against Docker Desktop, using only containers, volumes and networks we created and the alpine image. It offered the same 19 tools every time. There is no read-only mode and no flag or setting to switch tools off: the code reads nothing but the Docker connection. It sends no telemetry. The five list and log tools are marked read-only and the rest carry a destructive hint, true for the five that remove or recreate. It also has a docker_compose prompt and two resources, a container’s last 100 log lines and its stats.

A new container can reach the host

run_container and create_container take a volumes map, and any host path is accepted as its source. We ran alpine with a scratch folder mounted at /h and the command echo written-from-container > /h/proof.txt. The file appeared in the folder on our Mac. On Linux the same call with / as the source is the whole machine; on Docker Desktop it reaches any folder Docker Desktop shares. The container runs as root unless the image says otherwise.

  • network: "host" is passed to Docker as the network mode. Our container saw the host’s interfaces instead of a bridge address.
  • privileged, pid_mode and cap_add are not parameters. We sent them anyway; the container started without them, and no error said they were dropped.
  • build_image takes any folder as its build context and runs the Dockerfile. Ours copied a file from the host folder, printed it in the build log, ran as user 0, and left its build container behind.

Logs carry secrets, the listing does not

We started two containers with DEMO_SECRET=not-a-real-secret. list_containers returned names, image, state, ports, labels and mounts, but no environment, so the value did not come back. One container ran env, and fetch_container_logs and the logs resource both returned DEMO_SECRET=not-a-real-secret. Logs show whatever any container on the engine prints, not only the agent’s own, so the log tool asks below. The logs resource is not a tool: Claude Code reads resources through an @-mention or its own ReadMcpResourceTool, not through an mcp__docker__ name, so as far as we can tell the rules below do not cover it; we did not test that. If that matters, keep the server away from engines whose containers print secrets.

What removing takes

There is no prune tool. Without force, remove_container refused a running container and remove_image refused an image a container used. With force: true, remove_container removed the running container at once. remove_volume failed on a volume in use with and without force. remove_network has no force. recreate_container needs no force at all: it stops and removes the container it is given, then runs a new one from the call’s settings only. Ours had a volume before and no mounts after. stop_container stops any container, not only the agent’s. When Docker refuses, the model sees only “Error executing tool”, not Docker’s reason.

The docker_compose prompt asks the model to label and prefix what it creates and to show a plan before it applies one. That is an instruction to the model; the tools check nothing.

Point it at a Docker you can lose

claude mcp add docker -e DOCKER_HOST=ssh://agent@docker-sandbox -- uvx mcp-server-docker==0.3.0

ssh://agent@docker-sandbox stands for an engine of your own that you can lose. The server reads DOCKER_HOST, or /var/run/docker.sock when it is unset, and ignores docker context. Our Mac had no /var/run/docker.sock, so without DOCKER_HOST the server exited at start. On Linux, the same command with no DOCKER_HOST drives your own engine. Whatever engine it reaches, it can do all that engine can. Give it one that runs nothing you care about: a separate VM, or a remote host through DOCKER_HOST=ssh://…, which its README documents. A socket proxy that lets only GET requests through would work as a read-only mode; we did not test one.

All 19 tools

Hard to undo8 toolsAsk a person every time. Consider two people, or deny it if the agent never needs it.

  • create_container

    Create a new Docker container

    Server gives no read-only or destructive hint

    Our call: Takes any host folder as a volume, and the container runs as root unless its image says otherwise. We mounted a scratch folder and a file written inside the container appeared on the host; the same call with / would be the whole machine.

  • run_container

    Run an image in a new Docker container (preferred over `create_container` + `start_container`)

    Server gives no read-only or destructive hint

    Our call: Takes any host folder as a volume, and the container runs as root unless its image says otherwise. We mounted a scratch folder and a file written inside the container appeared on the host; the same call with / would be the whole machine.

  • recreate_container

    Stop and remove a container, then run a new container.

    Server says: destructive

    Our call: Stops and removes the named container, then runs a new one from only the settings in the call. We recreated one that had a volume, and the new container had no mounts.

  • remove_container

    Remove a Docker container

    Server says: destructive

    Our call: Without force, Docker refused to remove a running container. With force: true it removed it at once.

  • build_image

    Build a Docker image from a Dockerfile

    Server gives no read-only or destructive hint

    Our call: Sends any folder it is given to Docker and runs the Dockerfile's RUN lines. Our build printed a file from the host folder, ran as user 0, and left its build container behind.

  • remove_image

    Remove a Docker image

    Server says: destructive

  • remove_network

    Remove a Docker network

    Server says: destructive

  • remove_volume

    Remove a Docker volume

    Server says: destructive

    Our call: Deletes the volume's data for good. While a container used it, the call failed with and without force.

Reaches people1 toolAsk a person: once it reaches someone, it cannot be unsent.

  • push_image

    Push a Docker image

    Server gives no read-only or destructive hint

    Our call: Uploads an image to a registry, where others may pull it. We did not run it.

Not sure2 toolsAsk a person until you have checked what it does.

  • fetch_container_logs

    Fetch logs for a Docker container

    Server says: read-only

    Our call: Marked read-only, and it changes nothing, but it returns whatever a container printed. A container that ran env gave us DEMO_SECRET=not-a-real-secret in plain text.

  • pull_image

    Pull a Docker image

    Server gives no read-only or destructive hint

Changes data4 toolsAsk a person. Once it is routine, a standing rule can answer.

  • start_container

    Start a Docker container

    Server gives no read-only or destructive hint

  • stop_container

    Stop a Docker container

    Server gives no read-only or destructive hint

    Our call: Stops any container Docker runs, not only ones the agent started, and the server marks it not destructive.

  • create_network

    Create a Docker network

    Server gives no read-only or destructive hint

  • create_volume

    Create a Docker volume

    Server gives no read-only or destructive hint

Only looks4 toolsLet it run. It only looks.

  • list_containers

    List all Docker containers

    Server says: read-only

    Our call: Returns names, images, state, ports, labels and mounts, but not the environment. We listed a container started with DEMO_SECRET and the value did not come back.

  • list_images

    List Docker images

    Server says: read-only

  • list_networks

    List Docker networks

    Server says: read-only

  • list_volumes

    List Docker volumes

    Server says: read-only

Let the reads run in Claude Code

Claude Code asks before every MCP tool it has no rule for. Added as docker, this server’s tools are named mcp__docker__<tool>. These allow rules, in .claude/settings.json or ~/.claude/settings.json, let the tools that only look run without a prompt. Everything else keeps asking, including any tool a later version of the server adds.

{
  "permissions": {
    "allow": [
      "mcp__docker__list_containers",
      "mcp__docker__list_images",
      "mcp__docker__list_networks",
      "mcp__docker__list_volumes"
    ]
  }
}

The command that adds the server:

claude mcp add docker -e DOCKER_HOST=ssh://agent@docker-sandbox -- uvx mcp-server-docker==0.3.0

Send the rest to a person, not the terminal

A prompt in the terminal only works while someone is watching it. With this hook, every other tool of the server becomes a request in your VariantGate inbox, on your phone or in Slack, and Claude Code waits for the answer. The matcher names the look-only tools, so a tool added later is sent too. Put the key in VARIANTGATE_KEY, or run the one-command setup for Claude Code first.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "mcp__docker__(?!(list_containers|list_images|list_networks|list_volumes)$).*",
        "hooks": [
          { "type": "command", "command": "variantgate hook claude-code", "timeout": 180 }
        ]
      }
    ]
  }
}

Disagree with a tier, or run the server with other flags? Open these tools in the tool risk checker, change what you like, and copy the settings for your own setup. It runs in your browser and starts from its own reading, so a tool we marked as only looking by hand asks there until you change it.

Any MCP client: put the proxy in front

Claude Desktop, Cursor and most other MCP clients have no hook to send a call to a person. The VariantGate MCP proxy does it in the server’s place: it starts the server, lets the look-only tools above through, and holds every other call until someone approves it in the inbox. Run npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz login once to save a key, then use this in claude_desktop_config.json or ~/.cursor/mcp.json:

{
  "mcpServers": {
    "docker": {
      "args": [
        "-y",
        "https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz",
        "mcp-proxy",
        "--name",
        "docker",
        "--look-only",
        "list_containers,list_images,list_networks,list_volumes",
        "--",
        "uvx",
        "mcp-server-docker==0.3.0"
      ],
      "command": "npx",
      "env": {
        "DOCKER_HOST": "ssh://agent@docker-sandbox"
      }
    }
  }
}

Already have it in Claude Desktop? One command rewrites the file for you, with these look-only tools filled in, and keeps the old one (setup vscode does the same for VS Code; how it works):

npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz setup claude-desktop

The same in Claude Code, instead of the hook. The proxy now asks about every call that matters, so an allow rule for the whole server, mcp__docker, keeps Claude Code from asking a second time in the terminal:

claude mcp add docker -e DOCKER_HOST=ssh://agent@docker-sandbox -- npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz mcp-proxy --name docker --look-only list_containers,list_images,list_networks,list_volumes -- uvx mcp-server-docker==0.3.0

When the agent should write

Every tool that starts, stops, builds, pushes or removes should ask, and the person who answers should read the volumes, network and ports of each run before saying yes. A mount of /or your home folder hands the container those files, whatever the command says.

See it before you decide.

The playground runs the whole approval loop in your browser, no account needed. When it fits, the free plan covers 100 requests a month.