docker-mcp
Enables inspecting, orchestrating, and troubleshooting Docker Engine and Docker Compose environments through six consolidated high-leverage MCP tools.
README
Docker MCP Server (docker-mcp)
Model Context Protocol (MCP) server providing high-leverage tools for inspecting, orchestrating, and troubleshooting Docker Engine and Docker Compose environments.
Built on @thargy/mcp-server-core following John Ousterhout’s Deep Module philosophy (A Philosophy of Software Design).
1. Architectural Vision: Deep Module vs. Tool Bloat
Traditional MCP servers map 1:1 to Docker CLI verbs, resulting in 25+ shallow tools that bloat LLM context windows (consuming 4,000+ prompt tokens per turn) and increase hallucinations.
docker-mcp exposes exactly 6 consolidated, high-leverage tools with polymorphic typed action discriminators, consuming <1,000 tokens:
graph LR
subgraph Clients ["MCP Clients"]
Claude["Claude Desktop (Stdio)"]
Agent["Antigravity / Coding Agents"]
Gateway["mcp-gateway (SSE / Streamable HTTP)"]
end
subgraph DeepModule ["docker-mcp (Deep Module)"]
T1["docker_containers"]
T2["docker_compose"]
T3["docker_images"]
T4["docker_volumes"]
T5["docker_networks"]
T6["docker_system"]
Seam["IDockerClient Seam"]
Engine["DockerodeClient / InMemoryDockerClient"]
end
subgraph Host ["Docker Infrastructure"]
Socket["/var/run/docker.sock"]
RemoteTCP["tcp://remote-host:2376"]
RemoteSSH["ssh://user@remote-host"]
end
Clients --> DeepModule
DeepModule --> Seam
Seam --> Engine
Engine --> Host
2. Consolidated MCP Tool Catalog
| Tool | Actions | Capabilities & Highlights |
|---|---|---|
docker_containers |
list, inspect, start, stop, restart, logs, stats, exec, remove |
Name/status regex filtering, real-time CPU/RAM calculation, multiplexed stdout/stderr log extraction, command execution, safe timeouts. |
docker_compose |
ps, up, down, restart, logs |
Multi-container stack discovery via labels/directories, lifecycle orchestration, healthcheck readiness verification. |
docker_images |
list, inspect, pull, prune, remove |
Image inventory, virtual size formatting, tag resolution, dangling image cleanup. |
docker_volumes |
list, inspect, create, prune, remove |
Persistent volume catalog, driver inspection, orphan volume pruning. |
docker_networks |
list, inspect, create, prune, remove |
Bridge, overlay, and macvlan network topology inspection and subnet resolution. |
docker_system |
info, df, prune, version, ping |
Daemon healthcheck, engine version, disk usage breakdown, system-wide reclamation. |
3. Quickstart & Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
3008 |
HTTP / SSE listen port |
HOST |
0.0.0.0 |
Bind address |
MCP_TOKEN |
optional | Secret token for Bearer authentication over HTTP / SSE |
DOCKER_SOCKET |
/var/run/docker.sock |
Path to local Unix Docker socket |
DOCKER_HOST |
optional | Remote Docker TCP URL (e.g. tcp://192.168.86.50:2376) |
DOCKER_TLS_VERIFY |
optional | Enable TLS certificate verification (1 or 0) |
DOCKER_CERT_PATH |
optional | Path to client TLS certificates (ca.pem, cert.pem, key.pem) |
Running with Stdio (Claude Desktop / Local CLI)
{
"mcpServers": {
"docker": {
"command": "node",
"args": ["/Users/craigdean/Repos/docker-mcp/dist/src/index.js"],
"env": {
"DOCKER_SOCKET": "/var/run/docker.sock"
}
}
}
}
Running with Docker Compose & mcp-gateway
docker compose up -d --build
Access HTTP SSE at http://localhost:3008/docker/mcp or http://localhost:3008/docker/sse.
4. Testing & Code Quality
100% of unit tests execute against InMemoryDockerClient without requiring access to a live Docker socket.
# Run unit tests
npm test
# Run test coverage (>85% required)
npm run test:coverage
# TypeScript compile check
npm run types:check
License
MIT © 2026 Craig Dean
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.