# Docker MCP server

> Enables AI agents to manage Docker containers, Compose stacks, logs, and databases locally or over SSH using structured data.

- Repository: https://github.com/hypnosis/docker-mcp-server
- Page: https://hostedmcp.org/servers/hypnosis/docker-mcp-server
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 2.0.1

## Install

### Claude Code

```sh
claude mcp add docker-mcp-server -- npx -y @hypnosis/docker-mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "docker-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hypnosis/docker-mcp-server"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "docker-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@hypnosis/docker-mcp-server"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"docker-mcp-server","type":"stdio","command":"npx","args":["-y","@hypnosis/docker-mcp-server"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "docker-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hypnosis/docker-mcp-server"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add docker-mcp-server -- npx -y @hypnosis/docker-mcp-server
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.docker-mcp-server]
command = "npx"
args = ["-y", "@hypnosis/docker-mcp-server"]
```

### Gemini CLI

```sh
gemini mcp add -s user docker-mcp-server npx -- -y @hypnosis/docker-mcp-server
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "docker-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hypnosis/docker-mcp-server"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DOCKER_MCP_ALLOW_SSH_FALLBACK` | no | no | Keep going when a profile's SSH key is missing, instead of refusing the profile. Defaults to false. |
| `DOCKER_MCP_PROFILES_FILE` | no | no | Absolute path to the JSON file describing the Docker hosts this agent may reach. Without it the server answers about the Docker on this machine. |
| `DOCKER_PROFILES` | no | no | The same profiles JSON inline, used when no profiles file is set. |
| `LOG_LEVEL` | no | no | Log verbosity: error, warn, info or debug. Defaults to info. |

## Tools (10)

- `docker_container`
- `docker_logs`
- `docker_compose`
- `docker_health`
- `docker_resource`
- `docker_container_control`
- `docker_compose_control`
- `docker_db`
- `docker_db_admin`
- `docker_exec`

## FAQ

### Can I manage remote Docker hosts?

Yes, you can manage remote hosts over SSH by creating a profiles file that includes the host, username, and private key path.

### Does the server require Docker to be running?

The server will start even if the Docker daemon is down; it will simply inform the agent to start Docker.

### What are the system requirements?

You need Node.js 18+ and a reachable Docker daemon, either via a local socket or a remote host over SSH.
