Enables management of Docker containers, viewing logs, monitoring resources, and troubleshooting issues. Includes capabilities for starting, stopping, and restarting containers, inspecting container details, retrieving logs, and getting system information.
Mentioned specifically as a container type that can be managed and troubleshooted, including diagnostics for restart issues.
Supports connecting to remote Docker instances running on Ubuntu servers via SSH, allowing management of Docker containers on Ubuntu-based remote systems.
Docker MCP
A Model Context Protocol (MCP) server that enables AI assistants like Claude and Cursor IDE to interact with Docker containers. Your AI can now manage Docker containers, view logs, monitor resources, and troubleshoot issues without you needing to know Docker commands.
Stack: Node.js, TypeScript, dockerode, MCP
Quick Start 🚀
For Cursor IDE Users
- Install the package:
- Add to your Cursor settings:Open Cursor → Settings → Features → Model Context ProtocolAdd this configuration:
For Claude Desktop Users
- Install the package:
- Configure Claude Desktop:Edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add this configuration:
- macOS:
- Restart Claude Desktop
Remote Docker Setup 🌐
For Remote VMs or Servers
If your Docker containers are running on a remote server or VM:
SSH Config Integration
If you have SSH hosts configured in ~/.ssh/config
:
Then simply use:
What Can Your AI Do? 🤖
Once configured, your AI assistant can help you with:
- 📦 Container Management: Start, stop, restart, and inspect containers
- 📋 Monitoring: View container logs, resource usage, and health status
- 🔍 Troubleshooting: Debug container issues, check port mappings, and analyze restarts
- 🧹 Cleanup: Remove unused images, volumes, and networks to free up space
- 🐳 Docker Compose: Manage multi-container applications
- 📊 System Info: Get Docker version, system information, and disk usage
Example Conversations
"Show me all running containers" → AI will list all your containers with their status, ports, and resource usage
"Why did my nginx container restart 5 times?" → AI will check logs, detect restart loops, and help diagnose issues
"Clean up unused Docker resources" → AI will safely remove dangling images, unused volumes, and networks
"Show me the logs for my web server from the last hour" → AI will fetch and display recent logs with timestamps
Configuration Options ⚙️
Environment Variables
Variable | Description | Example |
---|---|---|
DOCKER_MCP_LOCAL | Use local Docker daemon | "true" |
DOCKER_MCP_HOST | Remote Docker host | "ssh://my-vm" |
DOCKER_MCP_USERNAME | SSH username | "ubuntu" |
DOCKER_MCP_PRIVATE_KEY | SSH private key path | "~/.ssh/id_rsa" |
DOCKER_MCP_PORT | SSH port (default: 22) | "22" |
DOCKER_MCP_PASSPHRASE | SSH key passphrase | "mypassphrase" |
Common Configurations
Local Docker (most users):
Remote Docker with VM name:
Remote Docker with IP and credentials:
Troubleshooting 🔧
Common Issues
"Cannot connect to Docker daemon"
- Make sure Docker is running on your system
- For remote hosts, verify SSH access:
ssh your-vm-name
"Permission denied"
- Add your user to the docker group:
sudo usermod -aG docker $USER
- For remote hosts, ensure the SSH user has Docker permissions
"Connection timeout"
- Check network connectivity to remote host
- Verify SSH key authentication is working
Getting Help
Run the diagnostic command:
This will show your current configuration and help identify issues.
For Developers 🛠️
Available Tools
The MCP server provides these Docker management tools:
✅ Implemented Tools
Container Management:
docker_container_list
- List all containers with status and detailsdocker_container_inspect
- Get detailed container informationdocker_container_start
- Start a stopped containerdocker_container_stop
- Stop a running containerdocker_container_restart
- Restart a containerdocker_container_logs
- Get container logs with time filtering
System Information:
docker_system_info
- Get Docker system informationdocker_system_version
- Get Docker version details
🚧 Planned Tools (Future Development)
Container Management (Extended):
remove_container
- Remove a containercreate_container
- Create a new container from an imagefollow_container_logs
- Stream live logs from a containerget_container_stats
- Get real-time resource usage statisticsexecute_in_container
- Execute commands inside a running containerdetect_restart_loops
- Detect containers that are restarting frequentlycontainer_processes
- List processes running inside a containercontainer_port_mappings
- Show port mappings for containerscontainer_file_changes
- Show filesystem changes in a containerexport_container
- Export container as tar archivecopy_from_container
- Copy files from container to hostcopy_to_container
- Copy files from host to container
Docker Compose:
compose_up
- Start services defined in docker-compose.ymlcompose_down
- Stop and remove compose servicescompose_pull
- Pull latest images for compose servicescompose_logs
- Get logs from compose services
Image Management:
list_images
- List available Docker imagespull_image
- Pull an image from a registryremove_image
- Remove an imageinspect_image
- Get detailed image information
Network & Volume Management:
list_networks
- List Docker networksinspect_network
- Get network details including connected containerslist_volumes
- List Docker volumesinspect_volume
- Get volume details
System & Cleanup:
system_df
- Show Docker disk usagecleanup_unused_images
- Remove unused/dangling imagescleanup_unused_volumes
- Remove unused volumescleanup_unused_networks
- Remove unused networkscleanup_unused_containers
- Remove stopped containerscleanup_build_cache
- Remove build cachecleanup_all
- Comprehensive cleanup of all unused resourcesget_cleanup_summary
- Show what would be cleaned up without removing
Development Progress
Currently 8 out of 40 tools implemented (20%)
Manual Installation & Development
Testing the Server
Architecture
- MCP Server: Built with
@modelcontextprotocol/sdk
- Docker Integration: Uses
dockerode
for Docker API communication - SSH Support: Native SSH connection via
dockerode
sshOptions - Transport: Stdio transport for AI assistant communication
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
This server cannot be installed
A tool that helps AI agents interact with Docker containers on local or remote machines, allowing users to manage and troubleshoot containers without Docker knowledge.
Related MCP Servers
- -securityFlicense-qualityEnables AI interactions with a running Minecraft server inside a Docker container using RCON, allowing models to programmatically create Minecraft builds and manage the server.Last updated -6Python
- -securityAlicense-qualityAn open-source self-hosted browser agent that provides a dockerized browser environment for AI automation, allowing other AI apps and agents to perform human-like web browsing tasks through natural language instructions.Last updated -6661TypeScriptApache 2.0
- -securityFlicense-qualityA secure Docker-based environment that allows AI assistants to safely execute code without direct access to the host system by running all code within isolated containers.Last updated -2Python
- -securityAlicense-qualityA middleware service that allows LLMs and AI assistants to directly interact with the Dokploy platform through a standardized interface, providing access to Docker, project, and application management capabilities.Last updated -4TypeScriptMIT License