docker-mcp-server
This server provides comprehensive Docker management capabilities for AI agents, enabling full control over containers, images, Compose stacks, health checks, and fleet monitoring — running directly on the Docker socket without external dependencies or API keys.
Container Lifecycle Management
List containers with filters (state, label, name), inspect detailed config/state
Start, stop, restart, remove, recreate, and run new containers with full options (env, ports, volumes, restart policy, command override)
Set restart policy on a running container without recreating it
Image Management
List, pull, build (from Dockerfile), and remove Docker images
Docker Compose Orchestration
Bring up/down stacks (
compose_up/compose_down) with optional build and volume removalList service states (
compose_ps), tail logs (compose_logs), and restart services
Health Checks & Self-Healing
Run HTTP, TCP, or exec health probes (auto-detects from container HEALTHCHECK)
Poll until a container becomes healthy or times out (
watch_health)Dynamically set restart policies to keep containers running
Logs & Debugging
Stream logs with tail count, timestamp filtering, and follow mode
Search logs across multiple containers using regex pattern matching
Execute commands inside running containers with stdout/stderr/exit code output
Fleet Monitoring & Alerting
Health status, uptime, and restart counts for all running containers
Real-time CPU, memory, and network I/O usage across all containers, sortable by metric
Stream Docker events (start, stop, die, OOM, health_status) over a configurable time window
Alert when containers exceed CPU%, memory%, or restart count thresholds
Single-call monitor dashboard combining health, top resource consumers, recent events, and threshold violations
Infrastructure
List Docker networks and volumes with optional filters
Provides tools for managing Docker containers, images, Compose stacks, health checks, logs, and more, enabling agents to keep containers running and perform operations through the Docker API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@docker-mcp-server list running containers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@supernova123/docker-mcp-server
The Docker MCP server designed for agents that need their containers to stay running.
Runs locally. No API keys. No paid plan. Connects directly to your Docker socket — no cloud service, no auth tokens, no monthly fee.
Without this: Your agent deploys a container, it crashes at 3am, and nobody notices until the user complains. Compose stacks drift. Health checks are manual. Logs are scattered across terminals.
With this: Your agent checks health, watches for readiness, restarts crashed containers, and follows logs, all through a single MCP interface. Containers stay running because your agent knows how to keep them running.
Why This Server?
There are 11+ Docker MCP servers on npm. Most are stale, GPL-licensed, or only cover basic CRUD. This one is different:
This server | ckreiling/mcp-server-docker | docker/hub-mcp | |
License | MIT | GPL-3.0 | Apache-2.0 |
Runs locally | ✅ No API keys, no paid plan | ✅ | ❌ Requires Docker Hub auth |
Last updated | Active | Jun 2025 (stale) | Active |
Health checks | ✅ HTTP/TCP/exec probes | ❌ | ❌ |
Auto-restart | ✅ set_restart_policy | ❌ | ❌ |
Compose lifecycle | ✅ up/down/ps/logs/restart | ❌ | ❌ |
Log streaming | ✅ tail + timestamp filter | Basic | Basic |
Fleet monitoring | ✅ 6 fleet tools (status, stats, events, logs, thresholds, dashboard) | ❌ | ❌ |
Agent positioning | ✅ Built for agents | Generic Docker | Registry API |
Related MCP server: Docker Manager MCP
Use Cases
Agent-managed deployments: Your agent deploys a new version, checks health, waits for readiness, then switches traffic. If the health check fails, it auto-rolls back.
Self-healing infrastructure: Set restart: always on critical containers. Your agent monitors health, detects crashes, and restarts them before anyone notices.
Compose stack orchestration: Your agent brings up a full stack (app + db + redis), monitors service states, tails logs for errors, and tears down cleanly when done.
Debugging sessions: Your agent execs into a container, runs diagnostics, streams logs with timestamp filters, and captures stats — all without SSH.
How It Works
Here's what an agent actually does with this server during a deployment:
1. Deploy: run_container(image="myapp:v2", ports={8080:80})
2. Health check: check_health(container="myapp", type="http", path="/ready")
3. Wait: watch_health(container="myapp", timeout=30)
4. Monitor: fleet_status() → see all containers, health states, uptime
5. Watch: watch_events(window=60) → detect crashes, restarts, health changes
6. Debug: search_logs(pattern="ERROR", containers=["myapp"])
7. Rollback: recreate_container(name="myapp", image="myapp:v1") if v2 failsIf the health check fails at step 2, your agent catches it immediately — no 3am alerts, no user complaints. If the container crashes at step 5, set_restart_policy ensures it comes back automatically. The agent doesn't just deploy containers — it keeps them running.
Blog Posts
Real data from building and running this server:
I Cut My Docker MCP Server From 50 to 12 Tools — why fewer tools = better agent UX
MCP Server Performance Optimization — benchmarking tool execution latency
Building an MCP Server From Scratch — the full development process
What 6,000 npm Downloads Taught Me — distribution and growth data
The MCP Server Naming Playbook — how naming affects discoverability
Built by Nova
This server was built by Nova, an autonomous AI agent that runs its own infrastructure, manages its own treasury, and ships tools based on real operational experience. Nova doesn't just write Docker scripts — it runs Docker every day to deploy its own services, monitor its own containers, and keep its own infrastructure alive.
The health checks, auto-restart policies, and fleet monitoring in this server exist because Nova needed them. Every tool solves a problem Nova actually hit.
Nova's other projects: MCP servers for 9 SaaS APIs, agent-native business strategy, and honest distribution data.
License
MIT
Available Tools
31 toolsbuild_imageB
Build a Docker image from a Dockerfile or build context path.
Inputs: context (required), tag (required), dockerfile, build_args, +1 more.
check_healthB
Run a health probe against a container. Supports HTTP, TCP, and exec probes. Auto-detects from container HEALTHCHECK if available.
Inputs: container_id (required), type, endpoint, command.
compose_downA
Tear down Docker Compose services. Optionally remove named volumes.
Inputs: path (required), volumes, timeout.
compose_logsC
Tail logs from Docker Compose services. Supports filtering by service and line count.
Inputs: path (required), services, tail, follow.
compose_psB
List service states across a Docker Compose stack.
Inputs: path (required).
compose_restartB
Restart Docker Compose services. Restart specific services or the entire stack.
Inputs: path (required), services, timeout.
compose_upB
Bring up Docker Compose services from a docker-compose.yml file. Optionally build images first.
Inputs: path (required), build, detach, services.
container_health_statusA
Check health status, uptime, and restart count for all running Docker containers. Returns JSON with container name, state, health probe status, and restart count.
Inputs: no named parameters.
container_resource_usageA
Monitor CPU, memory, and network I/O across all running Docker containers. Returns sorted resource usage metrics with percentage breakdowns.
Inputs: sort_by.
container_statsB
Get real-time resource usage statistics for a Docker container (CPU, memory, network, I/O).
Inputs: container_id (required).
exec_in_containerA
Execute a command inside a running Docker container. Returns stdout, stderr, and exit code.
Inputs: container_id (required), command (required), working_dir, env.
inspect_containerA
Get detailed configuration and state of a Docker container by ID or name.
Inputs: container_id (required).
list_containersB
List Docker containers with optional filters (state, label, name). Returns container IDs, names, images, states, ports, and labels.
Inputs: all, label, name, state.
list_imagesA
List Docker images with optional filters. Returns image IDs, tags, sizes, and creation dates.
Inputs: all, filter.
list_networksA
List Docker networks with optional filter. Returns network IDs, names, drivers, and scopes.
Inputs: filter.
list_volumesA
List Docker volumes with optional filter. Returns volume names, drivers, mount points, and labels.
Inputs: filter.
monitor_dashboardA
Comprehensive Docker fleet dashboard in a single API call. Returns health status, top resource consumers, recent events, and threshold violations.
Inputs: no named parameters.
pull_imageB
Pull a Docker image from a registry. Returns pull progress events.
Inputs: image (required), tag.
recreate_containerA
Recreate a container with the same configuration (stop, remove, re-create). Useful for applying config changes.
Inputs: container_id (required), timeout.
remove_containerA
Remove a Docker container by ID or name. Use force to remove running containers.
Inputs: container_id (required), force.
remove_imageA
Remove a Docker image by name or ID. Use force to remove even if tagged.
Inputs: image (required), force.
resource_alert_checkB
Alert when Docker containers exceed resource thresholds (CPU%, memory%, restart count). Returns violations with specific metrics that triggered alerts.
Inputs: cpu_percent, memory_percent, restart_count.
restart_containerC
Restart a Docker container by ID or name with optional timeout.
Inputs: container_id (required), timeout.
run_containerA
Create and start a new Docker container with one command. Supports image, env, ports, volumes, restart policy, and command override. Auto-pulls missing images.
Inputs: image (required), name, env, ports, +4 more.
search_logsA
Search Docker container logs across multiple containers using regex pattern matching. Returns matching log lines with container name and timestamp.
Inputs: pattern (required), containers, tail, since, +1 more.
set_restart_policyB
Change the restart policy of a running container without recreating it.
Inputs: container_id (required), policy (required), max_retry_count.
start_containerA
Start a stopped Docker container by ID or name.
Inputs: container_id (required).
stop_containerA
Stop a running Docker container by ID or name with optional timeout.
Inputs: container_id (required), timeout.
stream_logsC
Get logs from a Docker container. Supports tail count, timestamp filtering, and follow mode.
Inputs: container_id (required), tail, since, follow.
watch_eventsB
Stream Docker container events (start, stop, die, restart, health_status) over a configurable time window. Filter by specific container or event type.
Inputs: container, event_type, since, duration.
watch_healthA
Poll a container's health status until it becomes healthy or times out. Useful for waiting on service startup.
Inputs: container_id (required), timeout, interval.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 31 tools
Most tools have distinct container/image/compose purposes, but the health and monitoring cluster is crowded: check_health, watch_health, container_health_status, container_stats, container_resource_usage, resource_alert_check, and monitor_dashboard all overlap in status/resource concerns. Descriptions help separate them, but an agent could still easily pick the wrong tool for a health or monitoring task.
Many tools follow a clean verb_noun snake_case pattern like list_containers, start_container, and pull_image. However, the monitoring/health group breaks this with noun-first names like container_stats, container_health_status, and container_resource_usage, and the compose tools use a different style like compose_up and compose_down.
With 31 tools, this exceeds the 25-tool threshold for a well-scoped server. The count feels padded by overlapping health and monitoring tools that could reasonably be consolidated into fewer, more focused tools.
Container and image lifecycle coverage is strong, including run, inspect, start, stop, remove, build, pull, and compose operations. However, networks and volumes only have list operations with no create, update, or delete, and there are no prune, push, or tag operations, leaving notable gaps for a Docker management surface.
Maintenance
Related MCP Connectors
Hosting for AI agents: your AI client deploys Docker apps to live HTTPS URLs over MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
MCP-Native LLM Orchestration Agent
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude to manage Docker containers, images, and Docker Compose deployments through the Model Context Protocol. Provides secure container lifecycle management, image operations, and multi-host Docker server connections.1,176 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Docker containers, deploy stacks, and monitor services across multiple Docker hosts from one centralized location. Supports container lifecycle management, Docker Compose operations, and infrastructure orchestration through natural language commands.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Docker containers, images, networks, volumes, and Compose services through the Model Context Protocol. It supports system operations, command execution within containers, and integration with Docker Hub and GitHub Container Registry.154 npm2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to autonomously check, diagnose, and recover Dockerized services through safe, tool-based ops without direct host shell access.MIT