docker-mcp
Docker MCP Server(docker-mcp)
Model Context Protocol(MCP)サーバーです。Docker Engine および Docker Compose 環境を調査、オーケストレーション、トラブルシューティングするための高効率なツールを提供します。
@thargy/mcp-server-core を基盤として、John Ousterhout の Deep Module 哲学(A Philosophy of Software Design)に従っています。
1. アーキテクチャのビジョン:Deep Module 対ツールの肥大化
従来の MCP サーバーは Docker CLI のコマンドと 1:1 で対応しており、25+ もの浅いツールを生成していました。そのため LLM のコンテキストウィンドウが肥大化し(1ターンあたり 4,000 以上のプロンプトトークンを消費)、ハルシネーションも増加します。
docker-mcp は、ポリモーフィックな型付きアクション判別子を持つ統合された 6 つの高効率ツールのみを公開し、消費トークンは1,000 未満です。
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 --> HostRelated MCP server: Docker MCP Server
2. 統合されたMCPツールカタログ
Tool | Actions | Capabilities & Highlights |
|
| 名前・ステータスの正規表現フィルタリング、リアルタイムの CPU/RAM 計算、多重化された stdout/stderr ログ抽出、コマンド実行、安全なタイムアウト。 |
|
| ラベル・ディレクトリによるマルチコンテナスタックの検出、ライフサイクルオーケストレーション、ヘルスチェックによる準備完了確認。 |
|
| イメージ一覧、仮想サイズのフォーマット、タグ解決、d指しオヤイメージのクリーンアップ。 |
|
| 永続ボリュームのカタログ、ドライバーの検査、孤児ボリュームの prune。 |
|
| bridge・overlay・macvlan ネットワークのトポロジー検査とサブネット解決。 |
|
| デーモンのヘルスチェック、エンジンバージョン、ディスク使用量の内訳、システム全体の領域回収。 |
3. クイックスタートと設定
環境変数
変数 | デフォルト | 説明 |
|
| HTTP / SSE のリッスンポート |
|
| バインドアドレス |
| 任意 | HTTP / SSE での Bearer 認証用シークレットトークン |
|
| ローカル Unix Docker ソケットへのパス |
| 任意 | リモート Docker TCP URL(例: |
| 任意 | TLS 証明書の検証を有効化( |
| 任意 | クライアント TLS 証明書へのパス( |
Stdio での実行(Claude Desktop / ローカル CLI)
{
"mcpServers": {
"docker": {
"command": "node",
"args": ["/Users/craigdean/Repos/docker-mcp/dist/src/index.js"],
"env": {
"DOCKER_SOCKET": "/var/run/docker.sock"
}
}
}
}Docker Compose と mcp-gateway での実行
docker compose up -d --buildHTTP SSE には http://localhost:3008/docker/mcp または http://www.localhost:3008/docker/sse でアクセスできます。
4.テストとコومド品質
ユニットテストの 100% が InMemoryDockerClient に対して実行されるため、実際のDocker ソケットは必要ありません。
# Run unit tests
npm test
# Run test coverage (>85% required)
npm run test:coverage
# TypeScript compile check
npm run types:checkライセンス
MIT © 2026 Craig Dean
This server cannot be deployed
Maintenance
Related MCP Connectors
327 dev tools via REST API and MCP. Generate Dockerfiles, schemas, K8s, APIs, and more.
Single-connection MCP gateway discovering and executing 490+ verified MCP & A2A tools.
151MCP deployment checks: required tools, schema drift and verifiable receipts. Free preflight.
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables remote Docker management over SSH via a local MCP server, providing tools to manage containers, images, Compose, and system resources.1GPL 3.0
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that provides advanced Docker operations through a unified interface with 16 MCP tools and 25+ CLI aliases, enabling secure container lifecycle management, multi-container orchestration, registry publishing, and system maintenance.19 npm15ISC
- AlicenseBqualityDmaintenanceProvides MCP tools for setting up and managing Hephaestus development environment with Docker containers, including starting/stopping services, initializing databases, and troubleshooting.7MIT
- AlicenseAqualityCmaintenanceWraps the Docker Engine API as MCP tools for container and image management. Reduces token consumption by providing typed tools with default summaries and field selection.17148 npmMIT