Skip to main content
Glama

mcp-server-docker

npm version npm downloads CI TypeScript License: MIT Agent Plugins

AIコーディングアシスタントからDockerコンテナ、イメージ、サービスを操作できます。コンテナの一覧表示、起動、停止、ログの取得、コンテナ内でのコマンド実行、リソース使用量の確認が可能です。

npx mcp-docker-server

Claude Desktop、Cursor、VS Code Copilot、およびMCP互換の任意のクライアントと互換性があります。APIキーは不要で、ローカルのDockerソケットに自動的に接続します。

Dockerコンテナ、ログ、リソース監視のためのMCPサーバー

デモは remotion-readme-kit で作成

なぜ

毎日Dockerを使っているなら、その流れをご存じでしょう。ターミナルに切り替えて docker ps と入力し、ログをスクロールし、コンテナIDをコピーし、サービスを再起動する。これが積み重なっていきます。このMCPサーバーを使えば、AIアシスタントがそれらのタスクを処理してくれるので、コードに集中できます。どのコンテナが実行されているかを確認したり、障害が起きているサービスのログを取得したり、スタックしたものを再起動したりと、依頼するだけでOKです。ローカルソケット経由でDockerのAPIと通信するため、設定は不要で、認証情報の管理もありません。

Related MCP server: Docker Manager MCP

ツール

ツール

説明

list_containers

実行中(またはすべて)のコンテナを、ステータス、ポート、イメージ情報とともに一覧表示します

container_logs

コンテナの最近のログを取得します

start_container

停止中のコンテナを起動します

stop_container

実行中のコンテナを停止します

restart_container

コンテナを再起動します

remove_container

コンテナを削除します(オプションで強制削除)

exec_command

実行中のコンテナ内でコマンドを実行します

container_stats

CPU、メモリ、ネットワークのライブ統計を取得します

list_images

ホスト上のすべてのDockerイメージを一覧表示します

remove_image

Dockerイメージを削除します

クイックスタート

Cursor

.cursor/mcp.json に追加:

{
  "mcpServers": {
    "docker": {
      "command": "npx",
      "args": ["-y", "mcp-docker-server"]
    }
  }
}

Claude Desktop

claude_desktop_config.json に追加:

{
  "mcpServers": {
    "docker": {
      "command": "npx",
      "args": ["-y", "mcp-docker-server"]
    }
  }
}

VS Code

ユーザー設定または .vscode/mcp.json に追加:

{
  "mcp": {
    "servers": {
      "docker": {
        "command": "npx",
        "args": ["-y", "mcp-docker-server"]
      }
    }
  }
}

例

  • 実行中のすべてのDockerコンテナを一覧表示する

  • nginxコンテナのログを表示する

  • api-serverコンテナを再起動する

  • postgresコンテナのCPUとメモリ使用量は?

  • webコンテナ内で ls -la /app を実行する

  • すべてのDockerイメージとそのサイズを一覧表示する

  • 古いイメージを使用しているすべてのコンテナを停止する

前提条件

  • お使いのマシンで Docker が実行されている必要があります

  • サーバーは /var/run/docker.sock(Linux/macOS)またはWindowsの名前付きパイプのDockerソケットに接続します

  • APIキーやトークンは不要です

Agent Plugins

このリポジトリは Agent Plugins 1.0.0 パッケージです。plugin.json、ポータブルな mcp.json、skills/ はMCPサーバーと一緒に配布されます。

Cursorの場合は、リポジトリをクローンして ~/.cursor/plugins/local/mcp-server-docker にコピーまたはシンボリックリンクを作成し、ウィンドウをリロードしてください。スキルとMCPは Customize > Plugins に表示されます。

上記のCursorおよびVS Codeのインストールボタンは引き続き機能します。手動のJSONと同じ npx -y mcp-docker-server stdioサーバーを追加します。

よくある質問

mcp-docker-serverとは何ですか?

このMCPサーバーのnpmパッケージです(リポジトリ名は mcp-server-docker)。ローカルのDockerソケットと通信して、コンテナの一覧表示、ログの追跡、コマンドの実行、イメージの管理を行います。

Docker Desktopを実行している必要がありますか?

はい。デーモンが起動している必要があり、MCPプロセスが docker.sock(またはWindowsの名前付きパイプ)に到達できる必要があります。

本番コンテナにとって安全ですか?

停止・削除・再起動は破壊的と見なしてください。本番ワークロードを変更する前にユーザーに確認してください。

CursorでAgent Pluginとしてインストールできますか?

はい。~/.cursor/plugins/local/mcp-server-docker を使用すると、同梱の docker-management スキルがMCP設定とともに読み込まれます。

APIキーは必要ですか?

いいえ。ローカルのDockerアクセスのみです。

開発

git clone https://github.com/ofershap/mcp-server-docker.git
cd mcp-server-docker
npm install
npm test
npm run build

関連項目

その他のMCPサーバーや開発者ツールは、私の ポートフォリオ にあります。

著者

ofershap による

LinkedIn GitHub


README は README Builder で作成されました

ライセンス

MIT © 2026 Ofer Shapira

Available Tools

10 tools
container_logsC

Get logs from a Docker container.

Inputs: id (required), tail.

container_statsA

Get CPU, memory, and network stats for a running Docker container.

Inputs: id (required).

exec_commandC

Execute a command inside a running Docker container.

Inputs: id (required), command (required).

list_containersB

List Docker containers. Set all=true to include stopped containers.

Inputs: all.

list_imagesB

List Docker images on the host.

Inputs: no named parameters.

remove_containerA

Remove a Docker container. Use force=true to remove running containers.

Inputs: id (required), force.

remove_imageB

Remove a Docker image. Use force=true to force removal.

Inputs: id (required), force.

restart_containerC

Restart a Docker container.

Inputs: id (required).

start_containerA

Start a stopped Docker container.

Inputs: id (required).

stop_containerC

Stop a running Docker container.

Inputs: id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific Docker operations: logs, stats, exec, listing containers/images, removal, restart, start, and stop. There is no overlap or ambiguity between tools, as each handles a unique action on a well-defined resource.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case (e.g., list_containers, remove_image, start_container). The naming is predictable and uniform across all tools, making them easily readable and systematic.

    Tool Count5/5

    With 10 tools, the server is well-scoped for Docker management, covering essential operations like lifecycle control (start, stop, restart), inspection (logs, stats, list), and cleanup (remove). Each tool earns its place without redundancy or bloat.

    Completeness4/5

    The toolset provides strong coverage for core Docker workflows, including CRUD-like operations for containers and images. A minor gap exists in creating or building images (e.g., build_image or pull_image), but agents can still perform most common tasks effectively with the available tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • 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.
      94 npm
      2
      MIT