mcp-server-docker

mcp-server-docker

Natural language management of Docker containers via Model Context Protocol.

648
Stars
86
Forks
648
Watchers
11
Issues
mcp-server-docker enables users to manage Docker containers using natural language instructions through the Model Context Protocol. It allows composing, introspecting, and debugging containers, as well as managing persistent Docker volumes. The tool is suitable for server administrators, tinkerers, and AI enthusiasts looking to leverage LLM capabilities for Docker management. Integration with tools like Claude Desktop and Docker ensures flexible deployment and easy connectivity to Docker engines.

Key Features

Compose Docker containers using natural language
Introspect and debug running containers
Manage Docker volumes for persistent data
Remote Docker engine connectivity
Seamless integration with Claude Desktop
Support for project-based container grouping
Container logs and stats retrieval
Automated plan-and-apply workflows
Flexible installation via PyPi or Docker
Standardized toolset for managing images, networks, and volumes

Use Cases

Managing Docker containers through conversational commands
Deploying complex multi-container applications without manual scripting
Monitoring and troubleshooting running containers using LLMs
Automating infrastructure tasks for server administrators
Learning and experimenting with open-source Dockerized applications
Connecting and controlling remote or local Docker daemons
Quickly composing and deploying web services with minimal effort
Debugging and introspecting container status and logs
Cleaning up container projects after conversational sessions
Enhancing DevOps workflows with natural language automation

README

🐋 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

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

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

After cloning this repository, build the Docker image:

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

Star History

Star History Chart

Repository Owner

ckreiling
ckreiling

User

Repository Details

Language Python
Default Branch main
Size 144 KB
Contributors 3
License GNU General Public License v3.0
MCP Verified Nov 12, 2025

Programming Languages

Python
97.19%
Dockerfile
2.81%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • docker-mcp

    docker-mcp

    A powerful MCP server for seamless Docker container and compose stack management.

    docker-mcp is a Model Context Protocol (MCP) server that enables robust Docker container and compose stack management via Claude AI. It offers easy installation through Smithery or manual setup, supporting container creation, Docker Compose stack deployment, log retrieval, and monitoring. Integration with the Claude Desktop app is straightforward, and the included MCP Inspector aids debugging. This tool simplifies Docker operations for automation and AI model interactions.

    • ⭐ 419
    • MCP
    • QuantGeekDev/docker-mcp
  • Docker Hub MCP Server

    Docker Hub MCP Server

    Expose Docker Hub APIs to LLMs via the Model Context Protocol.

    The Docker Hub MCP Server implements the Model Context Protocol (MCP) to make Docker Hub APIs accessible to large language models, enabling AI-powered discovery and management of container images and repositories. It provides an interface for LLMs to access real-time Docker Hub data, recommend images, and streamline developer workflows. The server supports both public and private repositories through configurable authentication, and can be integrated with AI assistants like Gordon and clients such as Claude Desktop.

    • ⭐ 83
    • MCP
    • docker/hub-mcp
  • QuantConnect MCP Server

    QuantConnect MCP Server

    Official bridge for secure AI access to QuantConnect's algorithmic trading cloud platform

    QuantConnect MCP Server enables artificial intelligence systems such as Claude and OpenAI to interface with QuantConnect's cloud platform through an official, secure, and dockerized implementation of the Model Context Protocol (MCP). It facilitates automated project management, strategy writing, backtesting, and live deployment by exposing a comprehensive suite of API tools for users with valid access credentials. As the maintained official version, it ensures security, easy deployment, and cross-platform compatibility for advanced algorithmic trading automation.

    • ⭐ 50
    • MCP
    • QuantConnect/mcp-server
  • ROS MCP

    ROS MCP

    Natural language interface for controlling ROS robots using the Model Context Protocol

    ROS MCP is a server that implements the Model Context Protocol (MCP) to enable natural language control of robots in ROS environments. It facilitates communication with ROS topics, services, and actions, supporting any ROS message type. The system integrates with GUI tools through a socket server and can be used with Claude Desktop for interactive robot management. Key functionalities include topic management, node control, service interaction, and process management for ROS2-powered robots.

    • ⭐ 26
    • MCP
    • Yutarop/ros-mcp
  • Plane MCP Server

    Plane MCP Server

    Enables LLMs to manage Plane.so projects and issues via the Model Context Protocol.

    Plane MCP Server provides a standardized interface to connect large language models with Plane.so project management APIs. It enables LLMs to interact directly with project and issue data, supporting tasks such as listing projects, retrieving detailed information, creating and updating issues, while prioritizing user control and security. Installation is streamlined through tools like Smithery, and configuration supports multiple clients including Claude for Desktop.

    • ⭐ 32
    • MCP
    • kelvin6365/plane-mcp-server
  • Kafka Schema Registry MCP Server

    Kafka Schema Registry MCP Server

    MCP-compliant server for advanced Kafka Schema Registry management and integration.

    Kafka Schema Registry MCP Server is a fully-compliant Model Context Protocol (MCP) server built with the FastMCP 2.8.0+ framework. It provides advanced schema context support, enables multi-registry management, and offers comprehensive schema export capabilities. The tool is designed for seamless integration with Claude Desktop and other MCP clients using JSON-RPC over stdio. It supports Docker-based deployment and includes features to streamline both administrator and end-user workflows.

    • ⭐ 26
    • MCP
    • aywengo/kafka-schema-reg-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results