mcp-server-docker
mcp-server-docker
AIコーディングアシスタントからDockerコンテナ、イメージ、サービスを操作できます。コンテナの一覧表示、起動、停止、ログの取得、コンテナ内でのコマンド実行、リソース使用量の確認が可能です。
npx mcp-docker-serverClaude Desktop、Cursor、VS Code Copilot、およびMCP互換の任意のクライアントと互換性があります。APIキーは不要で、ローカルのDockerソケットに自動的に接続します。

デモは remotion-readme-kit で作成
なぜ
毎日Dockerを使っているなら、その流れをご存じでしょう。ターミナルに切り替えて docker ps と入力し、ログをスクロールし、コンテナIDをコピーし、サービスを再起動する。これが積み重なっていきます。このMCPサーバーを使えば、AIアシスタントがそれらのタスクを処理してくれるので、コードに集中できます。どのコンテナが実行されているかを確認したり、障害が起きているサービスのログを取得したり、スタックしたものを再起動したりと、依頼するだけでOKです。ローカルソケット経由でDockerのAPIと通信するため、設定は不要で、認証情報の管理もありません。
Related MCP server: Docker Manager MCP
ツール
ツール | 説明 |
| 実行中(またはすべて)のコンテナを、ステータス、ポート、イメージ情報とともに一覧表示します |
| コンテナの最近のログを取得します |
| 停止中のコンテナを起動します |
| 実行中のコンテナを停止します |
| コンテナを再起動します |
| コンテナを削除します(オプションで強制削除) |
| 実行中のコンテナ内でコマンドを実行します |
| CPU、メモリ、ネットワークのライブ統計を取得します |
| ホスト上のすべてのDockerイメージを一覧表示します |
| 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サーバーや開発者ツールは、私の ポートフォリオ にあります。
著者
README は README Builder で作成されました
ライセンス
MIT © 2026 Ofer Shapira
Available Tools
10 toolscontainer_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
Scored across 10 tools
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.
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.
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.
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
Related MCP Connectors
Manage your own cloud with AI: deploy apps, push and ship custom Docker images, manage resources via your AI agent.
Inspect and control your Northflank projects, services, jobs, and builds from your AI assistant.
Read-only Linux server and Docker monitoring for AI assistants: CPU, memory, disk, network.
Create, run and manage Homemade dev VMs and projects from your AI agent.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables natural language interaction with Docker commands and operations. Supports container management, image operations, system information, and Docker Compose through conversational requests.141MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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 npm2MIT
- AlicenseCqualityDmaintenanceEnables AI assistants to manage Docker containers, images, networks, volumes, and Docker Compose services through the Model Context Protocol.27MIT