Skip to content
Back to search

mcp-server-docker

MCP server for Docker

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ckreiling--mcp-server-docker/badge.svg)](/listings/ckreiling--mcp-server-docker)

HTML

<a href="/listings/ckreiling--mcp-server-docker"><img src="/api/listings/ckreiling--mcp-server-docker/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install

Claude Desktop

On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`

On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

<details> <summary>Install from PyPi with uv</summary>

If you don't have `uv` installed, follow the installation instructions for your system: [link](https://docs.astral.sh/uv/getting-started/installation/#installation-methods)

Then add the following to your MCP servers file:

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

</details>

<details> <summary>Install with Docker</summary>

Purely for convenience, the server can run in a Docker container.

After cloning this repository, build the Docker image:

docker build -t mcp-server-docker .

And then 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"
    ]
  }
}

Note that we mount the Docker socket as a volume; this ensures the MCP server can connect to and control the local Docker daemon.

</details>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 248 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # 🐋 Docker MCP server
  2. An MCP server for managing Docker with natural language!
  3. ## 🪩 What can it do?
  4. - 🚀 Compose containers with natural language
  5. - 🔍 Introspect & debug running containers
  6. - 📀 Manage persistent data with Docker volumes
  7. ## ❓ Who is this for?
  8. - Server administrators: connect to remote Docker engines for e.g. managing a
  9. public-facing website.
  10. - Tinkerers: run containers locally and experiment with open-source apps
  11. supporting Docker.
  12. - AI enthusiasts: push the limits of that an LLM is capable of!
  13. ## Demo
  14. A quick demo showing a WordPress deployment using natural language:
  15. https://github.com/user-attachments/assets/65e35e67-bce0-4449-af7e-9f4dd773b4b3
  16. ## 🏎️ Quickstart
  17. ### Install
  18. #### Claude Desktop
  19. On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
  20. On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
  21. <details>
  22. <summary>Install from PyPi with uv</summary>
  23. If you don't have `uv` installed, follow the installation instructions for your
  24. system:
  25. [link](https://docs.astral.sh/uv/getting-started/installation/#installation-methods)
  26. Then add the following to your MCP servers file:
  27. ```
  28. "mcpServers": {
  29. "mcp-server-docker": {
  30. "command": "uvx",
  31. "args": [
  32. "mcp-server-docker"
  33. ]
  34. }
  35. }
  36. ```
  37. </details>
  38. <details>
  39. <summary>Install with Docker</summary>
  40. Purely for convenience, the server can run in a Docker container.
  41. After cloning this repository, build the Docker image:
  42. ```bash
  43. docker build -t mcp-server-docker .
  44. ```
  45. And then add the following to your MCP servers file:
  46. ```
  47. "mcpServers": {
  48. "mcp-server-docker": {
  49. "command": "docker",
  50. "args": [
  51. "run",
  52. "-i",
  53. "--rm",
  54. "-v",
  55. "/var/run/docker.sock:/var/run/docker.sock",
  56. "mcp-server-docker:latest"
  57. ]
  58. }
  59. }
  60. ```
  61. Note that we mount the Docker socket as a volume; this ensures the MCP server
  62. can connect to and control the local Docker daemon.
  63. </details>
  64. ## 📝 Prompts
  65. ### 🎻 `docker_compose`
  66. Use natural language to compose containers. [See above](#demo) for a demo.
  67. Provide a Project Name, and a description of desired containers, and let the LLM
  68. do the rest.
  69. This prompt instructs the LLM to enter a `plan+apply` loop. Your interaction
  70. with the LLM will involve the following steps:
  71. 1. You give the LLM instructions for which containers to bring up
  72. 2. The LLM calculates a concise natural language plan and presents it to you
  73. 3. You either:
  74. - Apply the plan
  75. - Provide the LLM feedback, and the LLM recalculates the plan
  76. #### Examples
  77. - name: `nginx`, containers: "deploy an nginx container exposing it on port
  78. 9000"
  79. - name: `wordpress`, containers: "deploy a WordPress container and a supporting
  80. MySQL container, exposing Wordpress on port 9000"
  81. #### Resuming a Project
  82. When starting a new chat with this prompt, the LLM will receive the status of
  83. any containers, volumes, and networks created with the given project `name`.
  84. This is mainly useful for cleaning up, in-case you lose a chat that was
  85. responsible for many containers.
  86. ## 📔 Resources
  87. The server exposes resource templates rather than enumerating currently-running containers:
  88. - `docker://containers/{container_id}/logs` (`text/plain`)
  89. - `docker://containers/{container_id}/stats` (`application/json`)
  90. Read either URI with a Docker container ID or name.
  91. ## 🔨 Tools
  92. ### Containers
  93. - `list_containers`
  94. - `create_container`
  95. - `run_container`
  96. - `recreate_container`
  97. - `start_container`
  98. - `fetch_container_logs`
  99. - `stop_container`
  100. - `remove_container`
  101. ### Images
  102. - `list_images`
  103. - `pull_image`
  104. - `push_image`
  105. - `build_image`
  106. - `remove_image`
  107. ### Networks
  108. - `list_networks`
  109. - `create_network`
  110. - `remove_network`
  111. ### Volumes
  112. - `list_volumes`
  113. - `create_volume`
  114. - `remove_volume`
  115. ## 🚧 Disclaimers
  116. ### Sensitive Data
  117. **DO NOT CONFIGURE CONTAINERS WITH SENSITIVE DATA.** This includes API keys,
  118. database passwords, etc.
  119. Any sensitive data exchanged with the LLM is inherently compromised, unless the
  120. LLM is running on your local machine.
  121. If you are interested in securely passing secrets to containers, file an issue
  122. on this repository with your use-case.
  123. ### Reviewing Created Containers
  124. Be careful to review the containers that the LLM creates. Docker is not a secure
  125. sandbox, and therefore the MCP server can potentially impact the host machine
  126. through Docker.
  127. For safety reasons, this MCP server doesn't support sensitive Docker options
  128. like `--privileged` or `--cap-add/--cap-drop`. If these features are of interest
  129. to you, file an issue on this repository with your use-case.
  130. ## 🛠️ Configuration
  131. This server uses the Python Docker SDK's `from_env` method. For configuration
  132. details, see
  133. [the documentation](https://docker-py.readthedocs.io/en/stable/client.html#docker.client.from_env).
  134. ### Connect to Docker over SSH
  135. This MCP server can connect to a remote Docker daemon over SSH.
  136. Simply set a `ssh://` host URL in the MCP server definition:
  137. ```
  138. "mcpServers": {
  139. "mcp-server-docker": {
  140. "command": "uvx",
  141. "args": [
  142. "mcp-server-docker"
  143. ],
  144. "env": {
  145. "DOCKER_HOST": "ssh://myusername@myhost.example.com"
  146. }
  147. }
  148. }
  149. ```
  150. ## 💻 Development
  151. Prefer using Devbox to configure your development environment. The server uses
  152. MCP Python SDK v2's high-level `MCPServer` API and can be inspected directly:
  153. ```bash
  154. uv sync --all-groups
  155. uv run mcp dev src/mcp_server_docker/server.py:app
  156. # or: npx @modelcontextprotocol/inspector uv run mcp-server-docker
  157. ```
  158. Run the hermetic test and lint suite without a Docker daemon:
  159. ```bash
  160. uv run pytest
  161. uv run ruff format --check src tests
  162. uv run ruff check src tests
  163. ```
  164. See the `devbox.json` for helpful development commands.
  165. After setting up devbox you can configure your Claude MCP config to use it:
  166. ```
  167. "docker": {
  168. "command": "/path/to/repo/.devbox/nix/profile/default/bin/uv",
  169. "args": [
  170. "--directory",
  171. "/path/to/repo/",
  172. "run",
  173. "mcp-server-docker"
  174. ]
  175. },
  176. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.