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
Most tools target distinct resources and actions (containers, images, volumes, networks, compose, labs), and descriptions clarify boundaries. However, the lab_* group closely mirrors compose_* operations (lab_up vs compose_up, lab_exec vs compose_exec, lab_logs vs compose_logs), and bulk cleanup tools like prune overlap conceptually with individual remove_* tools, which could cause occasional misselection.
The dominant pattern is verb_noun snake_case (list_containers, remove_network, create_volume), which is applied consistently across most tool families. Deviations include resource-first names like container_logs, container_stats, and container_processes, plus compose_ps instead of a list-style verb, but the overall scheme remains predictable.
With 47 tools, the surface is heavy for a Docker management server and exceeds the typical well-scoped range. Many operations are naturally grouped (container lifecycle, image lifecycle, compose, labs), and some could be consolidated without losing capability.
Coverage is broad: complete container lifecycle (run, start, stop, restart, remove, exec, copy, logs, stats, processes, inspect), image operations, volume and network CRUD, compose lifecycle, and lab workflows. Minor gaps exist (e.g., container pause/unpause, rename/update, image save/load, network connect/disconnect), but core workflows are well supported.