A Model Context Protocol (MCP) server that enables Claude to manage Docker containers, images, and more on macOS.
- 🐳 Container Management: Start, stop, restart, and remove containers
- 📦 Image Management: List, pull, and remove Docker images
- 📊 Monitoring: View container logs and resource statistics
- ⚙️ Execution: Run commands inside containers
- 🔧 Docker Compose: Manage multi-container applications
- 🌐 Networks & Volumes: List and manage Docker networks and volumes
- Docker Desktop for Mac (running)
- Python 3.10 or higher
- Claude Desktop
-
Clone this repository:
git clone https://github.com/cwalinapj/docker-mcp-server.git cd docker-mcp-server -
Install dependencies:
pip install -r requirements.txt
-
Configure Claude Desktop:
Edit your Claude Desktop config at:
~/Library/Application Support/Claude/claude_desktop_config.jsonAdd:
{ "mcpServers": { "docker": { "command": "python3", "args": ["/Users/YOUR_USERNAME/docker-mcp-server/scripts/docker_mcp_server.py"] } } }Replace
/Users/YOUR_USERNAME/with your actual home directory path. -
Restart Claude Desktop
Once configured, you can ask Claude to manage Docker:
- "Show me all running containers"
- "Pull the latest nginx image"
- "Start the my-app container"
- "Show logs for container xyz"
- "Execute 'ls -la' in the nginx container"
- "Run an nginx container on port 8080"
- "Stop all running containers"
The server provides 17 Docker operations:
docker_ps- List containersdocker_start- Start containersdocker_stop- Stop containersdocker_restart- Restart containersdocker_rm- Remove containersdocker_logs- View logsdocker_exec- Execute commandsdocker_stats- Resource statisticsdocker_inspect- Detailed information
docker_images- List imagesdocker_pull- Pull imagesdocker_rmi- Remove imagesdocker_run- Create and start containers
docker_compose_up- Start servicesdocker_compose_down- Stop services
docker_network_ls- List networksdocker_volume_ls- List volumes
MCP server not working?
- Verify Docker is running:
docker ps - Check config path is correct
- Ensure Python 3 is available:
python3 --version - Verify mcp package:
pip show mcp - Check Claude Desktop logs
This is an MCP skill that follows Anthropic's skill creation guidelines. The server uses the mcp Python package to communicate with Claude Desktop.
MIT
Paul Walinap (cwalinapj)