# Is the Docker MCP server safe? Toolkit vs Docker control

> Docker’s MCP Toolkit isolates servers in containers. A Docker-control server hands over the daemon. See the difference and how to limit both.

Two different things get called the Docker MCP server. The Docker MCP Toolkit and its MCP Gateway run other MCP servers inside isolated containers for you. A Docker-control server such as ckreiling/mcp-server-docker lets an agent run, build and remove containers on your daemon. The first limits what servers can touch. The second gives the agent the Docker daemon, which its own README says is not a secure sandbox.

## Docker MCP Toolkit and Gateway

The Toolkit is a management interface in Docker Desktop. Docker’s documentation says each MCP tool runs in its own container, limited to 1 CPU and 2 GB of memory, and that servers have no access to the host filesystem by default. You grant file mounts to specific servers. Requests to and from tools that contain sensitive information such as secrets are blocked, and OAuth servers such as GitHub, Notion and Linear are authorized through your browser.

Servers are grouped into profiles, which are named collections of servers with their configuration. The Gateway serves a profile to a client. The docker/mcp-gateway README lists these commands.

| Command | Use |
| --- | --- |
| `docker mcp gateway run --profile <name>` | start a gateway for a profile |
| `docker mcp profile tools` | manage the tool allowlist in a profile |
| `docker mcp client connect <client> --profile <id>` | link a client to a profile |
| `docker mcp tools ls`, `tools call` | list and invoke tools |
| `docker mcp secret`, `docker mcp oauth` | handle credentials |

That README says npx and uvx servers get minimal host privileges and that each catalog server runs in an isolated container. Tool allowlists are set per profile. Whatever a catalog server does with its granted access, such as a GitHub server with your token, is still its own risk, so read that server’s guide too.

## A Docker-control server

mcp-server-docker lists these tools.

| Group | Tools |
| --- | --- |
| Read | `list_containers`, `fetch_container_logs`, `list_images`, `list_networks`, `list_volumes` |
| Create and run | `create_container`, `run_container`, `recreate_container`, `start_container`, `pull_image`, `build_image`, `create_network`, `create_volume` |
| Stop and delete | `stop_container`, `remove_container`, `remove_image`, `remove_network`, `remove_volume` |
| Push | `push_image` |

It connects through the Docker socket, mounted as `/var/run/docker.sock`, or to a remote daemon when `DOCKER_HOST` is an `ssh://` URL. Its README warns "Docker is not a secure sandbox" and that the server can potentially affect the host through Docker. It also warns against putting sensitive data in containers you configure, because anything exchanged with the model is compromised unless the model runs locally. It doesn’t support `--privileged` or `--cap-add`.

Deleting volumes deletes their data. `push_image` sends an image to a registry.

## Limit it in Claude Code

Rules use `mcp__<server>__<tool>`. For a Docker-control server named `docker`:

```json
{
  "permissions": {
    "allow": ["mcp__docker__list_containers", "mcp__docker__fetch_container_logs"],
    "deny": [
      "mcp__docker__remove_volume",
      "mcp__docker__remove_image",
      "mcp__docker__push_image",
      "mcp__docker__run_container"
    ]
  }
}
```

The Toolkit’s page documents Claude Desktop and VS Code connections, not Claude Code. Claude Code runs stdio servers with `claude mcp add <name> -- <command>`, so a Gateway entry could use `docker mcp gateway run --profile <name>` as the command. Treat that as your own setup and test it with a harmless profile.

## Limit it in Codex

```toml
[mcp_servers.docker]
command = "docker"
args = ["mcp", "gateway", "run", "--profile", "work"]
```

Use `enabled_tools` or `disabled_tools` in the same table to trim what the Gateway serves.

## Checklist

- Say which one you mean before you install.
- Give each server only the mounts it needs.
- Keep the Docker socket away from agents you don’t supervise.
- Deny remove and push tools.
- Use a profile per project.

Checked against the vendor documentation on November 25, 2026. [Docker MCP Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/) · [docker/mcp-gateway](https://github.com/docker/mcp-gateway) · [mcp-server-docker](https://github.com/ckreiling/mcp-server-docker) · [Claude Code MCP](https://code.claude.com/docs/en/mcp) · [Codex MCP](https://learn.chatgpt.com/docs/extend/mcp?surface=cli)

## What Excellent covers

Excellent doesn’t inspect MCP servers themselves, so it can’t tell you what a server exposes. Its free scan reads supported logs on the Mac and reports findings for review. It reads the session logs of Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code, which shows what an agent did after it used a server. For a local report without installing an app, [run the free scan](https://www.excellent.so/scan). Its script uses Python 3.9 or later when your Mac has it and the shell when it doesn’t, reads the logs locally and makes no network requests. [See a sample report](https://www.excellent.so/r/sample).

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Commands sent into an already running Codex shell fall outside that check. [Agent coverage](https://www.excellent.so/agents) · [Pricing](https://www.excellent.so/pricing). Pro is US-only for now.

Source: https://www.excellent.so/guides/docker-mcp-server
