by ckreiling
Manage Docker containers, images, networks, and volumes using natural language commands via an MCP server.
Docker Mcp Server enables natural‑language interaction with Docker. It exposes a set of tools and resources that let an LLM compose, inspect, and control containers, images, networks, and volumes without writing Docker CLI commands.
uvx mcp-server-docker
or run the supplied Docker image after building it (docker build -t mcp-server-docker .
).uvx
or docker run …
) and, if needed, set DOCKER_HOST
(e.g., ssh://user@host
) for remote daemon access.docker_compose
) and describe the desired state in plain English. The server will generate a plan, apply it, and return status, logs, and stats.DOCKER_HOST
.Q: Can I store secrets in containers created by the server? A: No. The server deliberately blocks configuration that includes sensitive data. Use external secret management instead.
Q: Does the server support privileged containers? A: Not currently; privileged mode and custom capability flags are blocked for safety.
Q: How do I connect to a remote Docker host?
A: Set DOCKER_HOST
to an ssh://
URI in the MCP server definition.
Q: What programming language is the server written in?
A: Python, using the Docker SDK (docker.from_env
).
Q: Can I run the server itself in Docker?
A: Yes. Build the image with docker build -t mcp-server-docker .
and run it as shown in the README, mounting the Docker socket.
An MCP server for managing Docker with natural language!
A quick demo showing a WordPress deployment using natural language:
https://github.com/user-attachments/assets/65e35e67-bce0-4449-af7e-9f4dd773b4b3
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:
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.
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:
nginx
, containers: "deploy an nginx container exposing it on port
9000"wordpress
, containers: "deploy a WordPress container and a supporting
MySQL container, exposing Wordpress on port 9000"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.
The server implements a couple resources for every container:
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
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.
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.
This server uses the Python Docker SDK's from_env
method. For configuration
details, see
the documentation.
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"
}
}
}
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"
]
},
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.