# Mcp Docker

> An MCP server to manage Docker containers, images, networks, and volumes.

- **Type:** MCP server
- **Install:** `agentstack add mcp-williajm-mcp-docker`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [williajm](https://agentstack.voostack.com/s/williajm)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [williajm](https://github.com/williajm)
- **Source:** https://github.com/williajm/mcp_docker
- **Website:** https://williajm.github.io/mcp_docker/

## Install

```sh
agentstack add mcp-williajm-mcp-docker
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MCP Docker Server

| Category | Status |
| --- | --- |
| **Build & CI** | [](https://github.com/williajm/mcp_docker/actions/workflows/ci.yml) [](https://github.com/williajm/mcp_docker/actions/workflows/codeql.yml) [](https://github.com/williajm/mcp_docker/actions/workflows/pre-commit.yml) [](https://github.com/williajm/mcp_docker/actions/workflows/docs.yml) [](https://codecov.io/gh/williajm/mcp_docker) |
| **Security** | [](https://scorecard.dev/viewer/?uri=github.com/williajm/mcp_docker) [](https://github.com/williajm/mcp_docker/actions/workflows/bandit.yml) [](https://github.com/williajm/mcp_docker/security/dependabot) |
| **Package** | [](https://github.com/williajm/mcp_docker/releases) [](https://pypi.org/project/mcp-docker/) |
| **Technology** | [](https://www.python.org/downloads/) [](https://www.docker.com/) [](https://opensource.org/licenses/MIT) [](https://github.com/astral-sh/ruff) |

A local [Model Context Protocol](https://modelcontextprotocol.io) server for Docker visibility and light lifecycle control.

**12 tools** | **stdio transport only** | **no destructive Docker operations**

## Quick Start

**Claude Code:**

```bash
claude mcp add --transport stdio docker uvx mcp-docker@latest
```

**Codex:**

```bash
codex mcp add docker -- uvx mcp-docker@latest
```

**Claude Desktop** — add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "docker": {
      "command": "uvx",
      "args": ["mcp-docker"]
    }
  }
}
```

The Docker socket is auto-detected for your OS. This package intentionally runs over stdio only; it is not a network-exposed Docker administration service.

## Tools

### Container

| Tool | Description | Safety |
| ---- | ----------- | ------ |
| `docker_list_containers` | List containers with filters | Safe |
| `docker_inspect_container` | Detailed container info | Safe |
| `docker_container_logs` | Get container logs | Safe |
| `docker_container_stats` | Resource usage stats | Safe |
| `docker_start_container` | Start container | Moderate |
| `docker_stop_container` | Stop container gracefully | Moderate |
| `docker_restart_container` | Restart container | Moderate |

### Image

| Tool | Description | Safety |
| ---- | ----------- | ------ |
| `docker_list_images` | List images | Safe |
| `docker_inspect_image` | Image details | Safe |

### Network

| Tool | Description | Safety |
| ---- | ----------- | ------ |
| `docker_list_networks` | List networks | Safe |

### Volume

| Tool | Description | Safety |
| ---- | ----------- | ------ |
| `docker_list_volumes` | List volumes | Safe |

### System

| Tool | Description | Safety |
| ---- | ----------- | ------ |
| `docker_version` | Docker version info | Safe |

## Safety

Safe tools are read-only and always allowed. Moderate tools are reversible lifecycle operations and are allowed by default.

```bash
# Read-only mode: list, inspect, logs, stats, version only
SAFETY_ALLOW_MODERATE_OPERATIONS=false
```

The package does not expose destructive tools such as remove, prune, build, push, or exec.

## Configuration

| Variable | Default | Description |
| -------- | ------- | ----------- |
| `DOCKER_BASE_URL` | Auto-detected | Docker daemon socket URL |
| `DOCKER_TIMEOUT` | `60` | Docker operation timeout in seconds |
| `SAFETY_ALLOW_MODERATE_OPERATIONS` | `true` | Allow reversible start/stop/restart tools |
| `SAFETY_DEFAULT_TOOL_TIMEOUT` | `30` | Tool timeout in seconds, `0` disables |
| `SAFETY_MAX_RESPONSE_BYTES` | `1048576` | Maximum tool response size, `0` disables |
| `MCP_LOG_LEVEL` | `INFO` | Logging level |
| `MCP_JSON_LOGGING` | `false` | Emit JSON logs |
| `MCP_DEBUG_MODE` | `false` | Show unsanitized errors for local debugging |

## Development

```bash
uv sync --group dev
uv run pytest tests/unit/ -v
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy src/mcp_docker/
```

## Requirements

- Python 3.11+
- Docker 20.10+
- Key dependencies: `fastmcp`, `docker`, `pydantic`, `pydantic-settings`, `loguru`

## License

MIT — see [LICENSE](LICENSE).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [williajm](https://github.com/williajm)
- **Source:** [williajm/mcp_docker](https://github.com/williajm/mcp_docker)
- **License:** MIT
- **Homepage:** https://williajm.github.io/mcp_docker/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-williajm-mcp-docker
- Seller: https://agentstack.voostack.com/s/williajm
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
