Docker MCP Server
Manage containers, images, and volumes from Claude Desktop using the Docker socket
The Docker MCP server connects Claude to your local Docker daemon via the Docker socket. It lets AI agents list running containers, start and stop them, exec commands inside containers, pull images, and inspect logs — without ever leaving your chat interface.
This is useful for debugging containerised applications: tell Claude "check why the postgres container keeps restarting" and it will fetch the logs, inspect the config, and suggest a fix.
Prerequisites
- Docker Desktop or Docker Engine running locally
- Node.js 18+ for the npx runner
- Your user account must have access to the Docker socket (
/var/run/docker.sock) — on Linux, add yourself to thedockergroup
Installation & Configuration
Add this block to your claude_desktop_config.json:
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-docker"]
}
}
}
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Available Tools (6)
list_containers
List running/stopped containersstart_container
Start a stopped containerstop_container
Gracefully stop a containerget_container_logs
Fetch stdout/stderr logsexec_in_container
Run a command inside a containerlist_images
List local Docker images
Use Cases
- Debug a crashing container: "why does my redis container keep exiting?"
- Inspect running services and their exposed ports
- Run a one-off command inside a container for quick data checks
Tips & Gotchas
docker group, the server will fail to connect to the socket with a permissions error. Run sudo usermod -aG docker $USER and log out/back in.exec_in_container runs commands as the container's default user (often root). Be intentional about which containers you grant Claude access to.Source & Documentation
GitHub Repository: https://github.com/modelcontextprotocol/servers/tree/main/src/docker
Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io
20 ready-to-paste server configs + installer + doctor script