Docker

Cloud and DevOps

MCP server for Docker.

Your AI app calls the Docker MCP server, which does the work through tools like list_containers, create_container, run_container and recreate_container and sends the result back to the chat.

About Docker

Docker is a community MCP server from ckreiling, filed in our directory under cloud and devops. MCP server for Docker.

The README for Docker lists tools such as list_containers, create_container, run_container and recreate_container, which your AI app can call once the server is connected.

At a glance

Publisher
ckreiling (community)
Runs
See the README for setup
Written in
Python
License
GPL-3.0
GitHub stars
762

Tools Docker gives your AI app

  • list_containers
  • create_container
  • run_container
  • recreate_container
  • start_container
  • fetch_container_logs
  • stop_container
  • remove_container
  • list_images
  • pull_image
  • push_image
  • build_image
  • remove_image
  • list_networks
  • create_network
  • remove_network
  • list_volumes
  • create_volume
  • remove_volume

Tool names as the Docker README lists them. Your AI app shows the live list once Docker is connected.

How to set up Docker

  1. Follow the install steps in the Docker README; it is written in Python, so have that toolchain ready.
  2. Check the Docker README for keys or settings; the registry lists none that Docker requires.
  3. Add Docker to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Docker tools to confirm the connection.
  5. Run one read-only task with Docker first, such as a call to list_containers, before you allow anything that writes or sends.

Docker compared with similar servers

  • Agent Safe Pipeline by decionis has fewer GitHub stars than Docker (650 against 762); both are community servers, and Agent Safe Pipeline runs as a remote server and Docker runs on your own machine.
  • Purple by erickochen has more GitHub stars than Docker (808 against 762); both are community servers, and both run locally.
  • Cloudflare Workers by cloudflare has fewer GitHub stars than Docker (649 against 762); Cloudflare Workers is official while Docker is a community server, and both run locally.

Before you connect Docker

  • Give Docker its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Docker tool call until you trust what it does with them.
  • Treat text that Docker fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Docker on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Docker

How marketing and sales teams put Docker to work, by company size. Pick the size closest to yours and start Docker on one use case.

Small business

  • A small business can ask Docker why the site is slow or down and get the likely cause in plain words.
  • Owners can use Docker to check hosting costs and spot services they pay for but no longer use.
  • Docker runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Web teams can connect Docker to watch deploys during a launch and roll back fast if a campaign page breaks.
  • Marketing engineering can use Docker to spin up preview environments for every landing page review.
  • Start with list_containers and create_container, the tools Docker lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises should give Docker read access first, with changes gated by the same approvals as any infrastructure change.
  • Large orgs can use Docker to answer cost and reliability questions across accounts, so marketing launches are planned with real capacity.
  • Docker is a community server, so have security review the code and pin a version before Docker touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Docker README

From ckreiling/mcp-server-docker on GitHub, shared under its GPL-3.0 license. Images are left out; the original has them.

README.md

🐋 Docker MCP server

An MCP server for managing Docker with natural language!

🪩 What can it do?

  • 🚀 Compose containers with natural language
  • 🔍 Introspect & debug running containers
  • 📀 Manage persistent data with Docker volumes

❓ Who is this for?

  • Server administrators: connect to remote Docker engines for e.g. managing a public-facing website.
  • Tinkerers: run containers locally and experiment with open-source apps supporting Docker.
  • AI enthusiasts: push the limits of that an LLM is capable of!

Demo

A quick demo showing a WordPress deployment using natural language:

https://github.com/user-attachments/assets/65e35e67-bce0-4449-af7e-9f4dd773b4b3

🏎️ Quickstart

Install
Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

Install from PyPi with uv

If you don't have uv installed, follow the installation instructions for your system: docs.astral.sh/uv/getting-started/installation

Then add the following to your MCP servers file:

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

Purely for convenience, the server can run in a Docker container.

After cloning this repository, build the Docker image:

docker build -t mcp-server-docker .

And then add the following to your MCP servers file:

"mcpServers": {
  "mcp-server-docker": {
    "command": "docker",
    "args": [
      "run",
      "-i",
      "--rm",
      "-v",
      "/var/run/docker.sock:/var/run/docker.sock",
      "mcp-server-docker:latest"
    ]
  }
}

Note that we mount the Docker socket as a volume; this ensures the MCP server can connect to and control the local Docker daemon.

📝 Prompts

🎻 docker_compose

Use natural language to compose containers. See above for a demo.

Provide a Project Name, and a description of desired containers, and let the LLM do the rest.

This prompt instructs the LLM to enter a plan+apply loop. Your interaction with the LLM will involve the following steps:

  1. You give the LLM instructions for which containers to bring up
  2. The LLM calculates a concise natural language plan and presents it to you
  3. You either:
    • Apply the plan
    • Provide the LLM feedback, and the LLM recalculates the plan
Examples
  • name: nginx, containers: "deploy an nginx container exposing it on port 9000"
  • name: wordpress, containers: "deploy a WordPress container and a supporting MySQL container, exposing Wordpress on port 9000"
Resuming a Project

When starting a new chat with this prompt, the LLM will receive the status of any containers, volumes, and networks created with the given project name.

This is mainly useful for cleaning up, in-case you lose a chat that was responsible for many containers.

📔 Resources

The server exposes resource templates rather than enumerating currently-running containers:

  • docker://containers/{container_id}/logs (text/plain)
  • docker://containers/{container_id}/stats (application/json)

Read either URI with a Docker container ID or name.

🔨 Tools

Containers
  • list_containers
  • create_container
  • run_container
  • recreate_container
  • start_container
  • fetch_container_logs
  • stop_container
  • remove_container
Images
  • list_images
  • pull_image
  • push_image
  • build_image
  • remove_image
Networks
  • list_networks
  • create_network
  • remove_network
Volumes
  • list_volumes
  • create_volume
  • remove_volume

🚧 Disclaimers

Sensitive Data

DO NOT CONFIGURE CONTAINERS WITH SENSITIVE DATA. This includes API keys, database passwords, etc.

Any sensitive data exchanged with the LLM is inherently compromised, unless the LLM is running on your local machine.

If you are interested in securely passing secrets to containers, file an issue on this repository with your use-case.

Reviewing Created Containers

Be careful to review the containers that the LLM creates. Docker is not a secure sandbox, and therefore the MCP server can potentially impact the host machine through Docker.

For safety reasons, this MCP server doesn't support sensitive Docker options like --privileged or --cap-add/--cap-drop. If these features are of interest to you, file an issue on this repository with your use-case.

🛠️ Configuration

This server uses the Python Docker SDK's from_env method. For configuration details, see the documentation.

Connect to Docker over SSH

This MCP server can connect to a remote Docker daemon over SSH.

Simply set a ssh:// host URL in the MCP server definition:

"mcpServers": {
  "mcp-server-docker": {
    "command": "uvx",
    "args": [
      "mcp-server-docker"
    ],
    "env": {
      "DOCKER_HOST": "ssh://myusername@myhost.example.com"
    }
  }
}

💻 Development

Prefer using Devbox to configure your development environment. The server uses MCP Python SDK v2's high-level MCPServer API and can be inspected directly:

uv sync --all-groups
uv run mcp dev src/mcp_server_docker/server.py:app
# or: npx @modelcontextprotocol/inspector uv run mcp-server-docker

Run the hermetic test and lint suite without a Docker daemon:

uv run pytest
uv run ruff format --check src tests
uv run ruff check src tests

See the devbox.json for helpful development commands.

After setting up devbox you can configure your Claude MCP config to use it:

  "docker": {
    "command": "/path/to/repo/.devbox/nix/profile/default/bin/uv",
    "args": [
      "--directory",
      "/path/to/repo/",
      "run",
      "mcp-server-docker"
    ]
  },

Questions about Docker

What is the Docker MCP server?

MCP server for Docker. Docker is maintained by ckreiling on GitHub at ckreiling/mcp-server-docker, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Docker MCP server?

Docker doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (ckreiling/mcp-server-docker). Like most servers, Docker ends with a command or URL you paste into your AI app's MCP config.

Does Docker need an API key?

The registry lists no required keys for Docker. Check the Docker README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Docker an official MCP server?

No. Docker is a community server maintained by ckreiling. Community servers can be excellent; read the code and the open issues before you give Docker access to company data.

What license is Docker under?

Docker is released under the GPL-3.0 license, according to its GitHub repository. The license covers the code of Docker; the service it connects to has its own terms.