Docker

Community
ckreiling
GitHubWebsite
710 stars2.8kUpdated 1y ago11/100

An MCP server for managing Docker with natural language.

This MCP server enables natural language interaction for Docker. It allows users to compose, introspect, and debug running containers, and manage persistent data with Docker volumes. It is for server administrators, tinkerers, and AI enthusiasts.

What it does

  • Container run, stop, start, restart, and log tailing
  • Image pull, build from a Dockerfile, tag, push, and prune
  • Compose up, down, and ps against a specified project directory
  • Volume and network list, create, and remove
  • Streams stdout and stderr back as MCP progress notifications during long operations
  • Works against a local socket or a remote daemon via DOCKER_HOST

Best for

CI failure reproductionContainer lifecycle automationCompose project agentsLocal stack orchestrationCompose containers with natural languageIntrospect and debug running containersManage persistent data with Docker volumesConnect to remote Docker engines
Low reliability scoreLicense GPL-3.0 โ€” review before use
About Docker

Docker is a MCP server categorised under devops, community, docker, containers. This MCP server enables natural language interaction for Docker. It allows users to compose, introspect, and debug running containers, and manage persistent data with Docker volumes. It is for server administrators, tinkerers, and AI enthusiasts.

How to install

Pick your MCP client from the Install panel on this page to get a one-click install link (Cursor, VS Code) or a ready-to-paste configuration for Claude Desktop, Claude Code, Gemini, Codex, Windsurf, and other MCP-compatible clients. No local setup required for remote servers.

License

Docker is released under the GPL-3.0 license. Review the upstream license text before deploying to production.

Comments

No comments yet

Be the first to leave a comment after using this server in production.

README

Refreshed 1mo ago

๐Ÿ‹ 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: link

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 implements a couple resources for every container:

  • Stats: CPU, memory, etc. for a container
  • Logs: tail some logs from a container

๐Ÿ”จ 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.

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"
    ]
  },

Alternatives

cloud service
8.9k

A suite of specialized MCP servers that help you get the most out of AWS.

99/100python
version control
1.4k

Manages GitLab projects, merge requests, issues, and pipelines for AI clients.

93/100typescript
web scraping
445

Automates browser interactions using Puppeteer for new or existing Chrome window

14/100typescript