docker-mcp
docker-mcp: AI-powered Docker management via MCP. Automate containers and stacks with Claude AI.

docker-mcp Solution Overview
docker-mcp is a Model Context Protocol (MCP) server designed to streamline Docker operations through AI. It empowers AI models like Claude to manage Docker containers and Docker Compose stacks, bridging the gap between natural language commands and container orchestration. Key features include container creation, Docker Compose deployment, log retrieval, and container status monitoring.
This server simplifies complex tasks, allowing developers to manage their containerized applications more efficiently. By integrating with AI models, docker-mcp enables intuitive, conversational control over Docker environments. It's easily installed via Smithery and configured within Claude Desktop, offering a quick start for developers. The server provides tools for creating containers, deploying stacks, and retrieving logs, enhancing the AI's ability to interact with and manage Docker resources. It's a valuable tool for developers seeking to leverage AI in their container management workflows.
docker-mcp Key Capabilities
Container Creation and Instantiation
This core feature allows AI models to directly request the creation of new Docker containers. The AI model provides a JSON payload specifying the container image, name, port mappings, and environment variables. docker-mcp
then leverages the Docker API to instantiate the container based on these specifications. This enables AI models to dynamically provision isolated environments for running specific applications or services.
Use Case: An AI-powered CI/CD pipeline could use this feature to automatically spin up containers for testing code changes. The AI model analyzes the code, determines the necessary dependencies, and then uses docker-mcp
to create a container with the correct environment for running the tests.
Technical Details: The create-container
tool uses the Docker SDK for Python to interact with the Docker daemon. It translates the JSON payload into the appropriate Docker API calls to create and start the container.
Docker Compose Stack Deployment
This feature enables AI models to deploy entire Docker Compose stacks with a single request. The AI model provides a JSON payload containing the project name and the Docker Compose YAML file. docker-mcp
then uses the Docker Compose API to deploy the stack, creating and linking all the necessary containers. This simplifies the deployment of complex multi-container applications.
Use Case: An AI-powered infrastructure management tool could use this feature to deploy a complete web application stack (e.g., web server, database, cache) based on user requirements. The AI model could dynamically generate the Docker Compose YAML file based on the application's needs and then use docker-mcp
to deploy the stack.
Technical Details: The deploy-compose
tool utilizes the Docker Compose Python library to parse the YAML file and orchestrate the deployment of the stack. It handles the creation of networks, volumes, and containers as defined in the Compose file.
Container Logs Retrieval
This feature allows AI models to retrieve logs from specific Docker containers. The AI model provides the container name, and docker-mcp
streams the container's logs back to the AI model. This enables AI models to monitor the health and performance of containers and diagnose issues.
Use Case: An AI-powered monitoring system could use this feature to continuously monitor the logs of critical containers. The AI model could analyze the logs for errors, warnings, or performance bottlenecks and then trigger alerts or take corrective actions.
Technical Details: The get-logs
tool uses the Docker SDK for Python to connect to the Docker daemon and stream the container's logs. It supports filtering logs based on timestamps and keywords.
Container Listing and Status Monitoring
This feature provides AI models with the ability to list all running Docker containers and monitor their status. The AI model sends a request, and docker-mcp
returns a list of containers with their names, IDs, and current status (e.g., running, stopped, paused). This allows AI models to gain a comprehensive view of the Docker environment.
Use Case: An AI-driven resource optimization tool could use this feature to identify idle or underutilized containers. The AI model could then use this information to scale down resources or consolidate containers to improve efficiency.
Technical Details: The list-containers
tool uses the Docker SDK for Python to query the Docker daemon for a list of all containers. It formats the information into a JSON response that is sent back to the AI model.