mcp-server-docker

by @ckreiling

Docker MCP Server

Manage Docker containers, images, networks, and persistent volumes through natural language from local or remote SSH Docker hosts. Built on MCP Python SDK v2 under GPL-3.0, `ckreiling/mcp-server-docker` runs over stdio via `uvx` or a Docker container and includes a plan-and-apply `docker_compose` prompt.

Cloud & DevOps762pythonGPL-3.0

Server facts

mcp-server-docker

GitHub stars

762

Last commit

Aug 7, 2026

Runtime

python

License

GPL-3.0

Project

Author
ckreiling
License
GPL-3.0

Tech

Runtime
python
Transports
stdio
Remote access
No
Authentication
Local Docker Socket or SSH DOCKER_HOST

Activity

GitHub stars
762
Last commit
Data as of

Overview

Developers comparing docker mcp options should distinguish Docker Inc.'s Docker MCP Toolkit/Gateway from this open-source, community-built server (`ckreiling/mcp-server-docker`, GPL-3.0) designed specifically to control a Docker daemon via natural language. Implemented with MCP Python SDK v2's `MCPServer` API and the Python Docker SDK (`from_env`), it exposes 19 focused tools covering container lifecycle management (listing, creating, running, recreating, starting, stopping, removing, and pulling logs with `fetch_container_logs`) alongside Docker image, network, and persistent volume operations, plus live resource templates for container logs (`docker://containers/{container_id}/logs`) and JSON stats (`docker://containers/{container_id}/stats`). A built-in `docker_compose` prompt guides the LLM through a structured `plan+apply` review loop and resumes project state across fresh chats.

Install it quickly in Claude Desktop or any stdio MCP host via `uvx mcp-server-docker`, or build the repository's Dockerfile locally and bind-mount `/var/run/docker.sock` inside a container running over interactive stdio. To administer remote engines without installing an HTTP gateway, pass `DOCKER_HOST=ssh://user@host` in `env`. For host safety, the server deliberately omits dangerous flags such as `--privileged` and `--cap-add`/`--cap-drop`, and the README warns never to pass API keys or database passwords into containers through cloud LLMs.

Install & configure

Requirements

  • `uv`/`uvx` (from Astral) to launch `mcp-server-docker` from PyPI, or Docker to build and run the local image
  • Running local Docker daemon (with `/var/run/docker.sock` access) or remote Docker daemon reachable over `DOCKER_HOST=ssh://...`
  • Stdio MCP client such as Claude Desktop
Documented launch / install command
uvx mcp-server-docker

Add `uvx mcp-server-docker` to `claude_desktop_config.json`, or clone and build `docker build -t mcp-server-docker .` and mount `/var/run/docker.sock`. Set `DOCKER_HOST` to `ssh://user@host` in `env` to control a remote engine over SSH.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "mcp-server-docker": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-docker"
      ]
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "mcp-server-docker": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-docker"
      ]
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
list_containersLists containers managed by the connected local or remote Docker engine.
create_containerCreates a new Docker container definition without starting it immediately.
run_containerCreates and starts a Docker container in a single step.
recreate_containerRecreates an existing Docker container cleanly with updated settings.
start_containerStarts a stopped Docker container.
fetch_container_logsRetrieves output logs from a running or stopped container for debugging.
stop_containerStops a running Docker container.
remove_containerRemoves a Docker container from the host daemon.
list_imagesLists container images stored on the connected Docker daemon.
pull_imagePulls a container image from a configured registry.
push_imagePushes a local Docker image to a registry.
build_imageBuilds a Docker image through the connected Docker engine.
remove_imageDeletes a container image from the Docker daemon.
list_networksLists Docker networks configured on the daemon.
create_networkCreates a Docker network for inter-container communication.
remove_networkRemoves an existing Docker network.
list_volumesLists persistent Docker volumes on the host.
create_volumeCreates a persistent Docker volume for stateful containers.
remove_volumeDeletes a Docker volume from the host.

Use cases

  • Spin up multi-container prototypes (such as WordPress plus MySQL on port 9000) interactively using the `docker_compose` plan+apply prompt.
  • Troubleshoot failing containers by reading `fetch_container_logs` and resource URIs (`docker://containers/{container_id}/logs` and `stats`).
  • Manage containers, images, volumes, and networks on a remote Linux host over SSH by setting `DOCKER_HOST=ssh://...`.
  • Resume and cleanly tear down previously composed project stacks in a new chat session by referencing the project name.

Strengths

  • Covers 19 container, image, network, and volume tools plus log/stats resource templates and a resumable `docker_compose` plan+apply prompt.
  • Supports remote Docker hosts natively via Python Docker SDK `from_env` and `DOCKER_HOST=ssh://...` with no extra gateway software.
  • Intentionally blocks dangerous Docker flags like `--privileged` and `--cap-add`/`--cap-drop` to reduce host risk.

Limitations

  • Docker is not a security sandbox—review every container action before approval, and never pass API keys or database passwords through cloud LLMs.
  • Licensed under GPL-3.0 (copyleft) and runs over local stdio only, without a built-in HTTP server transport.
  • Containerized installation requires cloning and running `docker build` locally while mounting `/var/run/docker.sock`.

mcp-server-docker setup notes

  • mcp-server-docker's stdio example needs a client that launches local processes.

Frequently asked questions

Install `uv` and add an `mcp-server-docker` entry to `claude_desktop_config.json` with command `uvx` and args `["mcp-server-docker"]`. Alternatively, clone the repository, build `docker build -t mcp-server-docker .`, and configure Claude Desktop to run the image with `/var/run/docker.sock` mounted.

Related MCP servers