# ofershap/mcp-server-docker [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/ofershap/mcp-server-docker  
**GitHub Stars:** 2  
**npm Downloads (last month):** 1009  
**Views:** 2  
**Installs:** 1  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ofershap-mcp-server-docker

## Description
Docker operations — manage containers, images, volumes, networks, and compose services.

## Tools
Capabilities this server exposes over MCP:

- **list_containers** — List running (or all) containers with status, ports, and image info
- **container_logs** — Get recent logs from a container
- **start_container** — Start a stopped container
- **stop_container** — Stop a running container
- **restart_container** — Restart a container
- **remove_container** — Remove a container (with optional force)
- **exec_command** — Execute a command inside a running container
- **container_stats** — Get live CPU, memory, and network stats
- **list_images** — List all Docker images on the host
- **remove_image** — Remove a Docker image

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation & README

# mcp-server-docker

[![npm version](https://img.shields.io/npm/v/mcp-docker-server.svg)](https://www.npmjs.com/package/mcp-docker-server)
[![npm downloads](https://img.shields.io/npm/dm/mcp-docker-server.svg)](https://www.npmjs.com/package/mcp-docker-server)
[![CI](https://github.com/ofershap/mcp-server-docker/actions/workflows/ci.yml/badge.svg)](https://github.com/ofershap/mcp-server-docker/actions/workflows/ci.yml)
[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Agent Plugins](https://img.shields.io/badge/Agent_Plugins-1.0.0-0ea5e9.svg)](https://agent-plugins.org)

Control Docker containers, images, and services from your AI coding assistant. List, start, stop, read logs, run commands inside containers, and check resource usage.

```bash
npx mcp-docker-server
```

> Compatible with Claude Desktop, Cursor, VS Code Copilot, and any MCP-compatible client. No API keys needed. Connects to your local Docker socket automatically.

<p align="center">
  <a href="https://cursor.com/en/install-mcp?name=docker&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1kb2NrZXItc2VydmVyIl19"><img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor" height="32" /></a>
  &nbsp;
  <a href="https://github.com/ofershap/mcp-server-docker/blob/HEAD/vscode:mcp/install?%7B%22name%22%3A%22docker%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-docker-server%22%5D%7D"><img src="https://img.shields.io/badge/Add_to_VS_Code-007ACC?style=for-the-badge&logo=visualstudiocode&logoColor=white" alt="Add to VS Code" /></a>
</p>

![MCP server for Docker containers, logs, and resource monitoring](https://raw.githubusercontent.com/ofershap/mcp-server-docker/HEAD/assets/demo.gif)

<sub>Demo built with <a href="https://github.com/ofershap/remotion-readme-kit">remotion-readme-kit</a></sub>

## Why

If you work with Docker daily, you know the routine: switch to a terminal, type `docker ps`, scroll through logs, copy container IDs, restart services. It adds up. This MCP server lets your AI assistant handle those tasks for you while you stay focused on code. Ask it to check which containers are running, pull up logs from a failing service, or restart something that got stuck. It talks to Docker's API through the local socket, so there's nothing to configure and no credentials to manage.

## Tools

| Tool                | What it does                                                        |
| ------------------- | ------------------------------------------------------------------- |
| `list_containers`   | List running (or all) containers with status, ports, and image info |
| `container_logs`    | Get recent logs from a container                                    |
| `start_container`   | Start a stopped container                                           |
| `stop_container`    | Stop a running container                                            |
| `restart_container` | Restart a container                                                 |
| `remove_container`  | Remove a container (with optional force)                            |
| `exec_command`      | Execute a command inside a running container                        |
| `container_stats`   | Get live CPU, memory, and network stats                             |
| `list_images`       | List all Docker images on the host                                  |
| `remove_image`      | Remove a Docker image                                               |

## Quick Start

### Cursor

Add to `.cursor/mcp.json`:

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

### Claude Desktop

Add to `claude_desktop_config.json`:

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

### VS Code

Add to user settings or `.vscode/mcp.json`:

```json
{
  "mcp": {
    "servers": {
      "docker": {
        "command": "npx",
        "args": ["-y", "mcp-docker-server"]
      }
    }
  }
}
```

## Examples

- "List all running Docker containers"
- "Show me the logs from the nginx container"
- "Restart the api-server container"
- "What's the CPU and memory usage of my postgres container?"
- "Execute `ls -la /app` inside the web container"
- "List all Docker images and their sizes"
- "Stop all containers that are using the old image"

## Prerequisites

- **Docker** must be running on your machine
- The server connects to the Docker socket at `/var/run/docker.sock` (Linux/macOS) or the named pipe on Windows
- No API keys or tokens required

## Agent Plugins

This repo is an [Agent Plugins](https://agent-plugins.org) 1.0.0 package: `plugin.json`, portable `mcp.json`, and `skills/` ship together with the MCP server.

For Cursor, clone the repo and copy or symlink it to `~/.cursor/plugins/local/mcp-server-docker`, then reload the window. Skills and MCP show up under Customize > Plugins.

The Cursor and VS Code install buttons above still work: they add the same `npx -y mcp-docker-server` stdio server as manual JSON.

## FAQ

### What is mcp-docker-server?

The npm package for this MCP server (repo name `mcp-server-docker`). It talks to your local Docker socket to list containers, tail logs, exec commands, and manage images.

### Do I need Docker Desktop running?

Yes. The daemon must be up and the MCP process must reach `docker.sock` (or the Windows named pipe).

### Is this safe for production containers?

Treat stop/remove/restart as destructive. Confirm with the user before changing production workloads.

### Can I install it as an Agent Plugin in Cursor?

Yes. Use `~/.cursor/plugins/local/mcp-server-docker` so the bundled `docker-management` skill loads with the MCP config.

### Do I need API keys?

No. Only local Docker access.

## Development

```bash
git clone https://github.com/ofershap/mcp-server-docker.git
cd mcp-server-docker
npm install
npm test
npm run build
```

## See also

More MCP servers and developer tools on my [portfolio](https://gitshow.dev/ofershap).

## Author

[![Made by ofershap](https://gitshow.dev/api/card/ofershap)](https://gitshow.dev/ofershap)

[![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-0A66C2?style=flat&logo=linkedin&logoColor=white)](https://linkedin.com/in/ofershap)
[![GitHub](https://img.shields.io/badge/GitHub-Follow-181717?style=flat&logo=github&logoColor=white)](https://github.com/ofershap)

---

<sub>README built with [README Builder](https://ofershap.github.io/readme-builder/)</sub>

## License

MIT © 2026 Ofer Shapira

