Skip to main content
Glama
docker-mcp-server

docker-mcp-server

@supernova123/docker-mcp-server

npm version npm downloads License: MIT MCP Claude Desktop

Awesome Glama

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 fails

If 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:

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 tools
build_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

    B3.1/5.0

    Scored across 31 tools

    Disambiguation3/5

    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.

    Naming Consistency3/5

    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.

    Tool Count2/5

    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.

    Completeness3/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to autonomously check, diagnose, and recover Dockerized services through safe, tool-based ops without direct host shell access.
      MIT