Docker is the lingua franca of modern software deployment, and it comes with a command-line interface that developers use constantly. The Docker MCP server exposes your local Docker environment to Claude — so instead of remembering the exact syntax for every docker command, you describe what you want in plain English and Claude handles the execution.

What is Docker?

Docker is the containerization platform that packages applications together with their runtime dependencies into portable, isolated containers. A container runs identically on your laptop, your colleague's machine, and a cloud server — eliminating the "works on my machine" class of problems. Docker Compose extends this for multi-container applications, letting you define a database, a web server, a cache, and a message queue in a single docker-compose.yml file and start the entire stack with one command. Docker has become the standard packaging format for modern software, from microservices to development environments.

What the Docker MCP Server Does

The Docker MCP server connects Claude to your local Docker daemon via the Docker socket. Once installed, Claude can invoke container management tools autonomously during your conversations. The core capabilities include:

  • List running and stopped containers — see all containers with their status, image, ports, and names.
  • Start, stop, and restart containers — control individual containers by name or ID.
  • Read container logs — fetch recent log output from any container, with line count control.
  • List images — see all Docker images on your system with their sizes and tags.
  • Inspect container details — get the full container configuration including environment variables, mounts, and network settings.
  • Manage Docker Compose services — bring compose stacks up or down and check service health.
  • Execute commands inside containers — run arbitrary commands inside running containers for debugging.

Claude selects the appropriate tool based on your description and formats the output in a readable way. For context on how Docker socket access compares to other server types, see our local vs remote MCP servers guide.

Prerequisites

Before installing the Docker MCP server, make sure you have the following:

  • Docker Desktop or Docker Engine — Docker must be installed and the daemon must be running. On macOS and Windows, Docker Desktop is the easiest option. On Linux, install Docker Engine. Verify with docker ps in your terminal.
  • Node.js 18 or higher — check with node --version. Download from nodejs.org if needed.
  • Claude Desktop — the MCP server connects via Claude Desktop's MCP integration.

No API key is required — the server communicates with Docker directly via the local socket. This is one of the simplest MCP servers to set up.

How to Install the Docker MCP Server

  1. Ensure Docker is running. Open Docker Desktop or start the Docker daemon on Linux with sudo systemctl start docker. Confirm it is running with docker ps — you should see a list of containers (or an empty list) without errors.
  2. Open your Claude Desktop config file. This is claude_desktop_config.json. On macOS it lives at ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows at %APPDATA%\Claude\claude_desktop_config.json. See our full claude_desktop_config.json guide for details.
  3. Add the Docker server block using the config JSON below, save the file, and restart Claude Desktop. The Docker server will appear in Claude's tool list within seconds.

The Config JSON

Add this block to your claude_desktop_config.json. No environment variables are needed — the server finds your Docker socket automatically.

{
  "mcpServers": {
    "docker": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-docker"]
    }
  }
}
Full claude_desktop_config.json entry for the Docker MCP server. No API key or credentials needed — it uses your local Docker socket.

Because no credentials are involved, setup is simpler than most MCP servers. However, Docker socket access is powerful — read our MCP security and trust levels guide to understand what this level of access means. Also see our filesystem MCP server guide for another local-access server with similar considerations.

Real Use Cases

Once the server is connected, these are the kinds of requests Claude can handle immediately:

  1. "Show me all running containers and their status." Claude queries the Docker daemon and returns a formatted table of container names, image names, status, uptime, and exposed ports.
  2. "What are the last 100 log lines from my postgres container?" Claude fetches the tail of the postgres container's stdout/stderr and displays it, making it easy to spot errors without opening a terminal.
  3. "Stop the nginx container and restart it." Claude sends a stop command followed by a start command to the named container, confirming each step.
  4. "Which Docker images on my system are larger than 1GB?" Claude lists all local images, filters by size, and returns the image names, tags, and exact sizes — useful for cleaning up disk space.
  5. "Run docker-compose up for my dev environment." Claude locates the compose project and brings up the full stack, streaming status as each service starts.

Pros

  • No API key needed — uses your local Docker socket directly, so setup is faster and there are no credentials to manage.
  • Great for development workflow — replacing repetitive docker commands with natural-language requests speeds up daily container management tasks significantly.
  • Log inspection in Claude is very useful — Claude can not only fetch logs but also analyze them and explain errors in the same response.
  • Compose support for multi-service apps — managing full stacks through Claude is particularly helpful when working with complex development environments.

Cons / Limitations

  • Full Docker socket access — development only — the Docker socket gives Claude the same power as running docker directly. Never install this on a production host. This is a tool for local developer machines only.
  • Destructive actions need caredocker rm, docker rmi, and docker system prune are irreversible. Always confirm before executing commands that delete containers or images.
  • Only works locally — by design the server connects to the local Docker socket. Remote Docker management is possible but not recommended without proper security controls in place.

Frequently Asked Questions

The Docker MCP server connects to your local Docker socket, which gives Claude the same level of access as running docker commands yourself. On a development machine this is generally acceptable. Never install it on a production host — the Docker socket grants full control over all containers and images on that machine, which is a significant security boundary to think through carefully.

Yes — Claude can run new containers from existing images using docker run equivalent API calls. You can specify the image, environment variables, port mappings, and volume mounts in natural language and Claude will translate them into the correct API call. Be specific about what you want to avoid Claude making assumptions about port or volume configuration.

Yes. The Docker MCP server includes Docker Compose support, so Claude can start and stop multi-container services defined in your docker-compose.yml files. Point Claude to the correct project directory and it can bring services up or down, check service status, and read logs from individual compose services.

By default the Docker MCP server connects to the local Docker socket on your machine. If you configure Docker to expose a remote socket (via the DOCKER_HOST environment variable), it is technically possible to point the server at a remote host — but this is not recommended for security reasons. Remote Docker access should be secured with TLS and should not be used for production systems.