- Home
- MCP servers
- Docker
Docker
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"diegofornalha-docker-mcp-py": {
"command": "/root/.claude/docker-mcp-py/start-docker.sh",
"args": [],
"env": {
"ENV": "YOUR_VALUE"
}
}
}
}You can manage Docker containers directly through Claude using the MCP (Model Context Protocol). This server lets you control Docker from your MCP client, enabling actions like creating containers, listing images, starting and stopping containers, and deploying Compose configurations, all via MCP commands.
How to use
Operate the MCP server from your MCP client by selecting the docker_mcp_py server configuration and issuing standard MCP actions. You can create containers, list running containers, fetch logs, manage images and volumes, and deploy Docker Compose configurations from your Claude integration. For each action, specify the corresponding MCP server and command, and Claude will execute the action on the host's Docker daemon through the containerized or local Python server.
How to install
Prerequisites: you need Docker installed on the host machine and a working Claude setup that can register MCP servers. You should also have Python available if you choose the legacy local setup.
Installation steps (containerized method)
# 1. Navigate to the project directory
cd /root/.claude/docker-mcp-py
# 2. Build the Docker image if it does not exist yet
docker build -t docker-mcp-py:latest .
# 3. Add the MCP server to Claude using the container startup script
claude mcp add docker-mcp-py -s user -- /root/.claude/docker-mcp-py/start-docker.sh
# 4. Verify the MCP server is registered
claude mcp list
Installation steps (legacy Python method)
# Use this only if you prefer not to use Docker
claude mcp add docker-mcp-py -s user -- \
/root/.claude/docker-mcp-py/venv/bin/python3 \
/root/.claude/docker-mcp-py/docker_mcp_server.py
Troubleshooting
If you encounter the error docker-mcp-py: failed, refer to the definitive error resolution file for guidance and remediation steps.
# Reinstallation flow
claude mcp remove docker-mcp-py -s user
claude mcp add docker-mcp-py -s user -- /root/.claude/docker-mcp-py/start-docker.sh
Migration and notes
When migrating to the containerized setup, first test the container with the startup script, then remove the old virtual environment if everything runs smoothly, and finally refresh Claude’s MCP configuration to point to the container startup script.
Files you’ll encounter
Key container-related files include Dockerfile, requirements.txt, start-docker.sh, .dockerignore, and CONTAINERIZATION.md. The core server script and source reside under docker_mcp_server.py and the src directory respectively. For legacy setups, setup.sh installs dependencies.
Migration steps
- Test the container with the provided start script. 2. If it runs as expected, remove the venv directory. 3. Update Claude to point to the containerized entrypoint by re-adding the MCP server with the container start script.
Available tools
create-container
Create a new Docker container with specified image, name, and options.
list-containers
List all containers, with filters for status and other properties.
stop-container
Stop a running container by its ID or name.
start-container
Start a stopped container by its ID or name.
remove-container
Remove a container, with optional force delete.
get-logs
Retrieve logs for a specific container, with options for tail and follow.
get-container-stats
Fetch resource usage statistics for a container.
list-images
List available Docker images on the host.
pull-image
Pull a Docker image from a registry.
remove-image
Remove a Docker image from the host.
list-volumes
List Docker volumes present on the host.
remove-volume
Remove a Docker volume by name.
deploy-compose
Deploy a Docker Compose configuration.
compose-down
Bring down a Docker Compose project, removing containers and networks as defined.