Docker MCP Server
The Docker Model Context Protocol server enables seamless interaction with Docker containers and infrastructure through function calling.
Capabilities
- 🚀 Compose containers with natural language
- 🔍 Introspect & debug running containers
- 📀 Manage persistent data with Docker volumes
Target Users
- Server administrators: Connect to remote Docker engines for managing public-facing websites and services
- Tinkerers: Spin up containers locally without manual command execution
Installation
Claude Desktop Configuration
Add to your configuration file at:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
Docker Compose
Use natural language to compose containers. Provide a Project Name and description of desired containers, and let the LLM handle the rest.
Workflow
- Provide container setup instructions to the LLM
- Review the LLM's natural language plan
- Either:
- Apply the plan
- Provide feedback for plan recalculation
Examples
name: nginx, containers: "deploy an nginx container exposing it on port 9000"
name: wordpress, containers: "deploy a WordPress container and a supporting MySQL container, exposing WordPress on port 9000"Available Tools
Container Management
list_containers: View all containerscreate_container: Create a new containerrun_container: Create and start a containerrecreate_container: Recreate an existing containerstart_container: Start a stopped containerfetch_container_logs: View container logsstop_container: Stop a running containerremove_container: Remove a container
Image Management
list_images: View available imagespull_image: Download an imagepush_image: Upload an imagebuild_image: Build a new imageremove_image: Delete an image
Network Management
list_networks: View all networkscreate_network: Create a new networkremove_network: Delete a network
Volume Management
list_volumes: View all volumescreate_volume: Create a new volumeremove_volume: Delete a volume
Resources
The server provides these resources for each container:
- Stats: CPU, memory, and other container metrics
- Logs: Container log access and tailing
Security Considerations
Important Security Notes
- Do not configure containers with sensitive data (API keys, passwords, etc.)
- Any sensitive data shared with the LLM is potentially compromised unless running locally
- Review all containers created by the LLM as Docker is not a secure sandbox
- The server does not support sensitive Docker options like --privileged or --cap-add/--cap-drop
Configuration
This server uses the Python Docker SDK's from_env method. For detailed configuration options, refer to the official documentation.
