MCP Server Docker

Manage Docker containers, images, networks and volumes on a local or remote engine

By Christian Kreiling (individual) Python Local · stdio DevOps and monitoring

66 popularity score ★ 754 ↓ 7.9k/mo

Connect your client

Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add docker -- uvx mcp-server-docker
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "docker": {
      "command": "uvx",
      "args": [
        "mcp-server-docker"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "docker": {
      "command": "uvx",
      "args": [
        "mcp-server-docker"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "docker": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-docker"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.docker]
command = "uvx"
args = ["mcp-server-docker"]
Gemini CLITerminal
gemini mcp add --scope user docker uvx -- mcp-server-docker
Local (container)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

FirstTerminal
git clone https://github.com/ckreiling/mcp-server-docker.git
cd mcp-server-docker
docker build -t mcp-server-docker .
Claude CodeTerminal
claude mcp add docker -- docker run -i --rm -v /var/run/docker.sock:/var/run/docker.sock mcp-server-docker:latest
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "docker": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/var/run/docker.sock:/var/run/docker.sock",
        "mcp-server-docker:latest"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "docker": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/var/run/docker.sock:/var/run/docker.sock",
        "mcp-server-docker:latest"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "docker": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/var/run/docker.sock:/var/run/docker.sock",
        "mcp-server-docker:latest"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.docker]
command = "docker"
args = ["run", "-i", "--rm", "-v", "/var/run/docker.sock:/var/run/docker.sock", "mcp-server-docker:latest"]
Gemini CLITerminal
gemini mcp add --scope user docker docker -- run -i --rm -v /var/run/docker.sock:/var/run/docker.sock mcp-server-docker:latest

Settings 3

DOCKER_HOST Optional: Address of the Docker engine; set an ssh://user@host URL to manage a remote engine. Defaults to the local socket.
DOCKER_TLS_VERIFY Optional: Turn on TLS verification for a TCP DOCKER_HOST (read by the Docker SDK's from_env).
DOCKER_CERT_PATH Optional: Folder holding the TLS certificates for a TCP DOCKER_HOST.

In a container, a setting goes in with -e NAME=value after docker run.

What it does

MCP Server Docker is a Python server that gives an assistant control of a Docker engine through the Docker SDK for Python. It works on the daemon your environment points at: the local socket by default, or a remote engine over SSH when DOCKER_HOST is set to an ssh:// address.

Its 19 tools cover four kinds of object. For containers it can list, create, run, recreate, start, stop and remove them and fetch their logs; for images it can list, pull, push, build and remove; networks and volumes can each be listed, created and removed. Two resource templates return a container's last 100 log lines and a one-off snapshot of its resource usage, given its ID or name.

It also ships a docker_compose prompt for describing a set of containers in plain language. The prompt has the assistant label and prefix every resource with a project name, present a plan, and apply it only after you approve; starting a new chat with the same project name passes in the containers, volumes and networks already carrying that label, which helps when cleaning up after a lost session.

In version 0.3.0 the fetch_container_logs tool returns the last 100 lines by default; its tail argument takes another number or "all" (server.py). There is no tool to run a command inside a running container.

What it needs

RuntimePythonorDocker

uv (for the uvx command) and Python, plus a reachable Docker engine: a running local daemon whose socket your user can use, or a remote engine reached over SSH with an ssh:// DOCKER_HOST and working SSH access. The container way needs a clone of the repository and a locally built image, since the docs publish none.

Limits

Its makers leave out sensitive Docker options such as --privileged and --cap-add/--cap-drop, and no tool takes them. It has no tool to exec into a running container or to manage Compose files; the docker_compose prompt works through the individual container, network and volume tools. The makers warn not to configure containers with secrets such as API keys or database passwords, since anything passed through the assistant should be treated as exposed unless the model runs locally. The container way has no published image: you build it yourself from the repository.

Who it suits

It suits developers and administrators who want an assistant to bring up, inspect and tear down containers on their own machine or on a remote host they reach over SSH, and who will review what it creates. It is a third-party server, not one from Docker, and its tools can delete containers, images and volumes and mount host paths, so it is a poor fit for a shared or production engine you cannot afford to have changed. Someone who only wants to read logs or list containers gets no read-only mode here.

Tools 19

list_containers
List running containers, or all with a flag, optionally filtered by label
create_container
Create a container from an image with ports, volumes, environment, network and labels
run_container
Create and start a container in one step
recreate_container
Stop and remove a container, then create it again with new settings
start_container
Start a stopped container
fetch_container_logs
Return a container's log lines, the last 100 by default
stop_container
Stop a running container
remove_container
Delete a container, forcibly if asked
list_images
List local images, with optional dangling and label filters
pull_image
Download an image from a registry
push_image
Upload an image tag to a registry
build_image
Build an image from a build context path and Dockerfile
remove_image
Delete a local image, forcibly if asked
list_networks
List Docker networks, optionally filtered by label
create_network
Create a Docker network
remove_network
Delete a Docker network
list_volumes
List Docker volumes
create_volume
Create a named volume
remove_volume
Delete a volume, forcibly if asked

Similar servers