{
  "markdown": "# mcp-server-docker\n\n[![npm version](https://img.shields.io/npm/v/mcp-docker-server.svg)](https://www.npmjs.com/package/mcp-docker-server)\n[![npm downloads](https://img.shields.io/npm/dm/mcp-docker-server.svg)](https://www.npmjs.com/package/mcp-docker-server)\n[![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)\n[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Agent Plugins](https://img.shields.io/badge/Agent_Plugins-1.0.0-0ea5e9.svg)](https://agent-plugins.org)\n\nControl Docker containers, images, and services from your AI coding assistant. List, start, stop, read logs, run commands inside containers, and check resource usage.\n\n```bash\nnpx mcp-docker-server\n```\n\n> Compatible with Claude Desktop, Cursor, VS Code Copilot, and any MCP-compatible client. No API keys needed. Connects to your local Docker socket automatically.\n\n<p align=\"center\">\n  <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>\n  &nbsp;\n  <a href=\"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>\n</p>\n\n![MCP server for Docker containers, logs, and resource monitoring](assets/demo.gif)\n\n<sub>Demo built with <a href=\"https://github.com/ofershap/remotion-readme-kit\">remotion-readme-kit</a></sub>\n\n## Why\n\nIf 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.\n\n## Tools\n\n| Tool                | What it does                                                        |\n| ------------------- | ------------------------------------------------------------------- |\n| `list_containers`   | List running (or all) containers with status, ports, and image info |\n| `container_logs`    | Get recent logs from a container                                    |\n| `start_container`   | Start a stopped container                                           |\n| `stop_container`    | Stop a running container                                            |\n| `restart_container` | Restart a container                                                 |\n| `remove_container`  | Remove a container (with optional force)                            |\n| `exec_command`      | Execute a command inside a running container                        |\n| `container_stats`   | Get live CPU, memory, and network stats                             |\n| `list_images`       | List all Docker images on the host                                  |\n| `remove_image`      | Remove a Docker image                                               |\n\n## Quick Start\n\n### Cursor\n\nAdd to `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"docker\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-docker-server\"]\n    }\n  }\n}\n```\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"docker\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-docker-server\"]\n    }\n  }\n}\n```\n\n### VS Code\n\nAdd to user settings or `.vscode/mcp.json`:\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"docker\": {\n        \"command\": \"npx\",\n        \"args\": [\"-y\", \"mcp-docker-server\"]\n      }\n    }\n  }\n}\n```\n\n## Examples\n\n- \"List all running Docker containers\"\n- \"Show me the logs from the nginx container\"\n- \"Restart the api-server container\"\n- \"What's the CPU and memory usage of my postgres container?\"\n- \"Execute `ls -la /app` inside the web container\"\n- \"List all Docker images and their sizes\"\n- \"Stop all containers that are using the old image\"\n\n## Prerequisites\n\n- **Docker** must be running on your machine\n- The server connects to the Docker socket at `/var/run/docker.sock` (Linux/macOS) or the named pipe on Windows\n- No API keys or tokens required\n\n## Agent Plugins\n\nThis 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.\n\nFor 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.\n\nThe Cursor and VS Code install buttons above still work: they add the same `npx -y mcp-docker-server` stdio server as manual JSON.\n\n## FAQ\n\n### What is mcp-docker-server?\n\nThe 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.\n\n### Do I need Docker Desktop running?\n\nYes. The daemon must be up and the MCP process must reach `docker.sock` (or the Windows named pipe).\n\n### Is this safe for production containers?\n\nTreat stop/remove/restart as destructive. Confirm with the user before changing production workloads.\n\n### Can I install it as an Agent Plugin in Cursor?\n\nYes. Use `~/.cursor/plugins/local/mcp-server-docker` so the bundled `docker-management` skill loads with the MCP config.\n\n### Do I need API keys?\n\nNo. Only local Docker access.\n\n## Development\n\n```bash\ngit clone https://github.com/ofershap/mcp-server-docker.git\ncd mcp-server-docker\nnpm install\nnpm test\nnpm run build\n```\n\n## See also\n\nMore MCP servers and developer tools on my [portfolio](https://gitshow.dev/ofershap).\n\n## Author\n\n[![Made by ofershap](https://gitshow.dev/api/card/ofershap)](https://gitshow.dev/ofershap)\n\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-0A66C2?style=flat&logo=linkedin&logoColor=white)](https://linkedin.com/in/ofershap)\n[![GitHub](https://img.shields.io/badge/GitHub-Follow-181717?style=flat&logo=github&logoColor=white)](https://github.com/ofershap)\n\n---\n\n<sub>README built with [README Builder](https://ofershap.github.io/readme-builder/)</sub>\n\n## License\n\nMIT © 2026 Ofer Shapira\n",
  "bytes": 6614,
  "sha": "c47fac1d22dca77a71af29369cdfd21274eb46c0425f5255aa303a9361dbbe17",
  "repo_slug": "ofershap/mcp-server-docker",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ofershap_docker_aaf9f663/readme"
}