Skip to main content
Glama
thargy
by thargy

Docker MCP Server(docker-mcp

Node.js Version License: MIT Architecture: Deep Module TypeScript

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 --> Host

2. 統合されたMCPツールカタログ

Tool

Actions

Capabilities & Highlights

docker_containers

list, inspect, start, stop, restart, logs, stats, exec, remove

名前・ステータスの正規表現フィルタリング、リアルタイムの CPU/RAM 計算、多重化された stdout/stderr ログ抽出、コマンド実行、安全なタイムアウト。

docker_compose

ps, up, down, restart, logs

ラベル・ディレクトリによるマルチコンテナスタックの検出、ライフサイクルオーケストレーション、ヘルスチェックによる準備完了確認。

docker_images

list, inspect, pull, prune, remove

イメージ一覧、仮想サイズのフォーマット、タグ解決、d指しオヤイメージのクリーンアップ。

docker_volumes

list, inspect, create, prune, remove

永続ボリュームのカタログ、ドライバーの検査、孤児ボリュームの prune。

docker_networks

list, inspect, create, prune, remove

bridge・overlay・macvlan ネットワークのトポロジー検査とサブネット解決。

docker_system

info, df, prune, version, ping

デーモンのヘルスチェック、エンジンバージョン、ディスク使用量の内訳、システム全体の領域回収。


3. クイックスタートと設定

環境変数

変数

デフォルト

説明

PORT

3008

HTTP / SSE のリッスンポート

HOST

0.0.0.0

バインドアドレス

MCP_TOKEN

任意

HTTP / SSE での Bearer 認証用シークレットトークン

DOCKER_SOCKET

/var/run/docker.sock

ローカル Unix Docker ソケットへのパス

DOCKER_HOST

任意

リモート Docker TCP URL(例: tcp://192.168.86.50:2376

DOCKER_TLS_VERIFY

任意

TLS 証明書の検証を有効化(1 または 0

DOCKER_CERT_PATH

任意

クライアント TLS 証明書へのパス(ca.pemcert.emkey.pem

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 --build

HTTP 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

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.

  • Official Sevalla MCP — full PaaS API access through just 2 tools.

  • 34 production API tools over one hosted MCP endpoint.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thargy/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server