# mcp-server-docker

> MCP Server

This repository provides an MCP server that uses natural language to manage Docker containers. It allows users to compose, introspect, debug, and manage persistent data with Docker volumes.

## Overview

- **Category:** System Tools
- **Language:** Python
- **Stars:** 737
- **Forks:** 24
- **Owner:** ckreiling
- **GitHub:** https://github.com/ckreiling/mcp-server-docker
- **Created:** 2024-12-07T02:52:14+00:00
- **Updated:** 2025-03-28T23:59:04+00:00
- **Source:** https://model-context-protocol.com/servers/docker-container-management-natural-language-server

## Setup

## Setup

**Claude Desktop Configuration:**

*   On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
*   On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

**Install with `uv`:**

1.  Run: `uv pip install git+https://github.com/ckreiling/mcp-server-docker`
2.  Add the following to your MCP servers file:

```
"mcpServers": {
  "mcp-server-docker": {
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/repo",
      "run",
      "mcp-server-docker"
    ]
  }
}
```

**Install with Docker:**

1.  Clone the repository.
2.  Build the Docker image: `docker build -t mcp-server-docker .`
3.  Add the following to your MCP servers file:

```
"mcpServers": {
  "mcp-server-docker": {
    "command": "docker",
    "args": [
      "run",
      "-i",
      "--rm",
      "-v",
      "/var/run/docker.sock:/var/run/docker.sock",
      "mcp-server-docker:latest"
    ]
  }
}
```

## Tools

## Available Tools

1.  Compose containers with natural language (Compose containers with natural language).
2.  Introspect & debug running containers (Introspect & debug running containers).
3.  Manage persistent data with Docker volumes (Manage persistent data with Docker volumes).
4.  `docker_compose` prompt (Use natural language to compose containers).
5.  Stats resource (CPU, memory, etc. for a container).
6.  Logs resource (Tail some logs from a container).
7.  `list_containers` (List containers).
8.  `create_container` (Create a container).
9.  `run_container` (Run a container).
10. `recreate_container` (Recreate a container).
11. `start_container` (Start a container).
12. `fetch_container_logs` (Fetch container logs).
13. `stop_container` (Stop a container).
14. `remove_container` (Remove a container).
15. `list_images` (List images).
16. `pull_image` (Pull an image).
17. `push_image` (Push an image).
18. `build_image` (Build an image).
19. `remove_image` (Remove an image).
20. `list_networks` (List networks).
21. `create_network` (Create a network).
22. `remove_network` (Remove a network).
23. `list_volumes` (List volumes).
24. `create_volume` (Create a volume).
25. `remove_volume` (Remove a volume).
