home / mcp / docker mcp server
MCP server for Docker
Configuration
View docs{
"mcpServers": {
"ckreiling-mcp-server-docker": {
"command": "uvx",
"args": [
"mcp-server-docker"
],
"env": {
"DOCKER_HOST": "ssh://[email protected]"
}
}
}
}You have a Docker MCP Server that lets you manage Docker engines using natural language. It lets you compose containers, introspect running services, and handle persistent data with Docker volumes, all through an intuitive command-flow driven by natural language prompts.
Connect with an MCP client and use the docker_compose prompt to plan and apply container configurations through plain language. You provide a project name and a description of the containers you want, and the system guides you from plan to apply. If you need to adjust the plan, you can give feedback and the system recalculates.
Prerequisites: You need a runtime to execute MCP servers. The server can run via PyPi with uvx or inside a Docker container.
"mcpServers": {
"mcp-server-docker": {
"command": "uvx",
"args": [
"mcp-server-docker"
]
}
}Install from PyPi with uvx if you donβt have uvx installed yet. Then add the MCP server configuration snippet shown above to your MCP servers file.
Or run the server in Docker for convenience. Build the image and start with the provided runtime configuration.
# Build the Docker image
docker build -t mcp-server-docker .
# Start the MCP server using the Docker socket for local Docker accessThen add this Docker-based MCP server configuration snippet to your MCP servers file to run the server locally with Docker access.
"mcpServers": {
"mcp-server-docker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/var/run/docker.sock:/var/run/docker.sock",
"mcp-server-docker:latest"
]
}
}This MCP server connects to Docker using the Python Docker SDK and supports connecting to remote engines. You can configure remote access by providing a host URL via DOCKER_HOST, including SSH-based connections.
"mcpServers": {
"mcp-server-docker": {
"command": "uvx",
"args": [
"mcp-server-docker"
],
"env": {
"DOCKER_HOST": "ssh://[email protected]"
}
}
}Be mindful of security when running containers and never include sensitive data like API keys or passwords directly in prompts. The MCP server does not enable privileged containers or cap-add/cap-drop by default for safety.
Review any containers created by the LLM before they run on your host. Docker is not a sandbox, so monitor and manage access carefully.
If you need to connect to a remote Docker daemon over SSH, include the SSH-based host URL in the MCP server definition as shown in the remote example.
List containers with basic details such as id, name, status, and image.
Create a new container from an image with specified configurations.
Run a container from an image with command and options.
Recreate an existing container using updated settings.
Start a stopped container.
Fetch and tail logs from a running or completed container.
Stop a running container.
Remove a container from the host.
List available Docker images.
Pull an image from a registry.
Push an image to a registry.
Build a new image from a Dockerfile.
Remove an image from the local daemon.
List Docker networks.
Create a new Docker network.
Remove a Docker network.
List Docker volumes.
Create a new Docker volume.
Remove a Docker volume.