docker-mcp
<div align="center">
<img src="https://raw.githubusercontent.com/falkenslab/docker-mcp/main/docs/static/img/logo.svg" alt="docker-mcp logo: two puzzle pieces fitting together, a robot for the agent and stacked containers for Docker" width="112"/>
# docker-mcp
**Your AI agent works Docker for you: containers, images, Compose and practice labs.**<br/>
A complete set of tools, with modes chosen at startup: only read, only safe labs, or everything.
[](https://www.npmjs.com/package/@falkenslab/docker-mcp)



[](LICENSE)
**[π Documentation](https://falkenslab.github.io/docker-mcp/)** Β· [π DocumentaciΓ³n en espaΓ±ol](https://falkenslab.github.io/docker-mcp/es/)
</div>
docker-mcp is an MCP server that lets an AI agent (Claude Code, Codex, an agent built on [agent-kit](https://github.com/falkenslab/agent-kit)) work the Docker on your computer: run and inspect containers, build and pull images, manage volumes and networks, start Compose projects, clean up, and run practice labs that check themselves. You choose how far it can go when it starts: `read` only looks, `lab` only runs labs under a safety policy, and `full` does everything Docker does, asking before anything dangerous. It drives Docker's own command line, so it works wherever Docker does.
## β¨ Why docker-mcp
- ποΈ **Modes, not trust.** A tool outside the mode doesn't exist for the agent: in `read` it can't change anything, in `lab` it can't run anything but labs.
- π‘οΈ **You confirm, not the agent.** Before removing anything, and before a privileged container, the host's network or the Docker socket, docker-mcp asks you itself through your app, and your answer never passes through the model.
- π§ͺ **Labs for practices.** A folder with a `compose.yaml` and a check: no internet, no host mounts, limits on CPU and memory, refused if it breaks the rules, reset in one call.
- π§° **The whole of Docker.** 47 tools over containers, images, volumes, networks, Compose and the system, each with structured results.
- π§ **Explains, never installs.** Without Docker, or with it stopped, it says how to install or start it.
- π¦ **Nothing to install.** One bundled file run with `npx`, for agent-kit, Claude Code and Codex alike.
## π Quick start
You need [Node.js](https://nodejs.org) 20 or later and [Docker](https://docs.docker.com/get-started/get-docker/) 24 or later, running.
```bash
# Claude Code (full mode)
claude mcp add docker -- npx -y @falkenslab/docker-mcp
# Only labs, with the practices in a folder of your own
claude mcp add docker -e DOCKER_MCP_MODE=lab -e DOCKER_MCP_LABS_DIR=/path/to/labs -- npx -y @falkenslab/docker-mcp
```
In Codex, `codex mcp add docker -- npx -y @falkenslab/docker-mcp`. To write it in `.mcp.json` or Codex's `config.toml`, with every setting, see [Configuration](https://falkenslab.github.io/docker-mcp/configuration). In an agent built on agent-kit, or with its skills in Claude Code and Codex, install the `docker-lab` extension from [agent-extensions](https://github.com/falkenslab/agent-extensions), which runs this server at a fixed version. Then ask: "What containers are running?"
## π¬ What you can ask
- π§βπ» "Start a PostgreSQL 17 with a volume for its data, on port 5432 only for this computer."
- π§βπ» "Why does my web container keep restarting? Look at its logs."
- π§βπ» "How much disk is Docker using, and what could I clean up?"
- π©βπ« "Start the volumes lab and check the solution works."
- π§βπ "Reset my lab: I broke the database."
## πΈ See it at work
<p align="center">
<img src="https://raw.githubusercontent.com/falkenslab/docker-mcp/main/docs/static/img/see-it-claude-code.png" alt="Claude Code starting a lab with docker-mcp and its check passing" width="760"/>
</p>
<p align="center"><em>Claude Code, in lab mode: it starts a practice lab and its check passes, all through docker-mcp.</em></p>
<p align="center">
<img src="https://raw.githubusercontent.com/falkenslab/docker-mcp/main/docs/static/img/see-it-codex.png" alt="Codex starting a lab with docker-mcp and running its check" width="760"/>
</p>
<p align="center"><em>Codex, with the same lab: it calls list_labs, lab_up and lab_check, and the check passes.</em></p>
## π§° What's inside
| Area | Tools |
| --- | --- |
| π¦ Containers | `list_containers`, `inspect_container`, `container_logs`, `container_stats`, `container_processes`, `run_container`, `start_container`, `stop_container`, `restart_container`, `remove_container`, `exec_in_container`, `copy_to_container`, `copy_from_container` |
| πΌοΈ Images | `list_images`, `inspect_image`, `pull_image`, `build_image`, `tag_image`, `push_image`, `remove_image` |
| πΎ Volumes and networks | `list_volumes`, `inspect_volume`, `create_volume`, `remove_volume`, and the same for networks |
| π§© Compose | `compose_ps`, `compose_logs`, `compose_build`, `compose_up`, `compose_down`, `compose_exec` |
| βοΈ System | `docker_info`, `disk_usage`, `prune` |
| π§ͺ Labs | `list_labs`, `lab_status`, `lab_logs`, `lab_up`, `lab_exec`, `lab_check`, `lab_reset`, `lab_down` |
| π Server | `server_info`, `check_requirements` |
Every tool, with what each mode keeps: [the tools reference](https://falkenslab.github.io/docker-mcp/reference/tools).
## π Documentation
- **[Getting started](https://falkenslab.github.io/docker-mcp/getting-started)**: installing it in your AI app.
- **[Configuration](https://falkenslab.github.io/docker-mcp/configuration)**: `.mcp.json` for Claude Code and `config.toml` for Codex, or their command lines, with every setting.
- **[Modes and settings](https://falkenslab.github.io/docker-mcp/modes)**: `read`, `lab` and `full`, the areas, and the labs' policy.
- **[Tools](https://falkenslab.github.io/docker-mcp/reference/tools)**: every tool, generated from the server.
## π οΈ Developing
`npm install`, then `npm run build`, `npm test` and `npm run check` before every commit; `CLAUDE.md` lists every command and `.minispec/` the decisions behind them (the modes are ADR-005, the labs' policy ADR-006). Releases are published to npm by the owner.
<div align="center">
Made with π by Falken's Lab Team
</div>
TDQS
Scored across 47 tools
Each family targets a distinct resource (images, containers, volumes, networks, compose projects, labs) and descriptions explicitly separate close pairs, e.g. container_stats vs container_processes, or lab_exec vs exec_in_container. The main ambiguity is the deliberate parallel between compose_* and lab_* tools (compose_up/lab_up, compose_logs/lab_logs, compose_exec/lab_exec), which the descriptions clarify but an agent could still misselect when a project is a lab.
The dominant pattern is resource-prefixed verb_noun (build_image, list_volumes, remove_network, start_container, lab_up, compose_build), which is predictable and readable. Deviations are minor: compose_ps is noun-first, and bare singletons like prune, disk_usage, server_info and check_requirements sit outside the scheme.
47 tools is heavy for any single MCP server and forces the agent to scan a large surface before acting. Much of the bulk comes from near-triplicated compose/lab families, which could be consolidated or split into separate servers.
Coverage is broad and near-lifecycle-complete: images (pull/build/tag/push/list/inspect/remove), containers (run/start/stop/restart/remove/exec/logs/stats/processes/copy), volumes, networks, compose and labs, plus diagnostics and prune. Gaps are modest β no network connect/disconnect, no compose_restart or compose_stop, no restart policy/label update, and no export/save of images.