Docker
Created 6 months ago
An MCP server for managing Docker with natural language!
What is Docker?
Integrate with Docker to manage containers, images, volumes, and networks.
Documentation
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.
Quickstart# Install\n\n#### 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.
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. Provide a Project Name, and a description of desired containers, and let the LLM do the rest.
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_containerscreate_containerrun_containerrecreate_containerstart_containerfetch_container_logsstop_containerremove_container
Images
list_imagespull_imagepush_imagebuild_imageremove_image
Networks
list_networkscreate_networkremove_network
Volumes
list_volumescreate_volumeremove_volume
Disclaimers# Sensitive Data
DO NOT CONFIGURE CONTAINERS WITH SENSITIVE DATA.
Reviewing Created Containers
Be careful to review the containers that the LLM creates. Docker is not a secure sandbox.
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.
Development
Prefer using Devbox to configure your development environment.
Server Config
{
"mcpServers": {
"docker-server": {
"command": "npx",
"args": [
"docker"
]
}
}
}