Docker MCP — Container Management for AI Agents
MCP server that gives AI agents Docker container management capabilities. Build, run, stop, and inspect containers through tool calls for automated DevOps workflows.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install a2214d04-c235-4aad-8d6b-b27888d08547 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
Docker MCP is a Model Context Protocol server that gives AI agents direct access to Docker container operations. Through MCP tool calls, an agent can list running containers, start and stop services, inspect container logs, build images, and manage Docker networks and volumes.
This server is for developers who want their AI coding assistant to manage Docker environments without switching to a terminal. It is useful for debugging containerized applications, spinning up development databases, and automating container lifecycle tasks.
How it saves time or tokens
Instead of copying Docker commands between your terminal and AI chat, the agent executes Docker operations directly. It can inspect a failing container's logs, identify the issue, and suggest fixes in one conversation turn. The workflow provides the MCP configuration JSON for immediate setup.
How to use
- Add the Docker MCP server to your
.mcp.json:
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-docker"]
}
}
}
- Restart your MCP-compatible client (Claude Code, Cursor, etc.).
- Ask the agent to manage containers:
'List all running containers'
'Show logs from the postgres container'
'Build and run the Dockerfile in this directory'
'Stop all containers and clean up unused images'
Example
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-docker"]
}
}
}
With this config, the agent can run operations like:
# Agent executes these via MCP tool calls:
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
docker logs --tail 50 my-api-server
docker build -t my-app:latest .
docker run -d --name my-app -p 3000:3000 my-app:latest
Related on TokRepo
- MCP Docker integration -- Full Docker MCP capability reference
- DevOps tools -- Infrastructure automation and container management
Common pitfalls
- The Docker daemon must be running on your machine. The MCP server connects to the local Docker socket and fails silently if Docker Desktop or dockerd is not started.
- Giving the agent Docker access means it can stop or remove containers. Be cautious in environments with production containers running alongside development ones.
- Building large images through the MCP server may time out with default settings. For complex builds, run them directly in the terminal.
Preguntas frecuentes
The agent can list, start, stop, and remove containers. It can also build images, view logs, inspect container details, manage networks and volumes, and execute commands inside running containers.
You need a running Docker daemon. Docker Desktop provides this on macOS and Windows. On Linux, the Docker Engine (dockerd) is sufficient. The MCP server communicates through the standard Docker socket.
Use caution. The agent has the same Docker permissions as your user. It can stop containers, remove images, and create new ones. Avoid using it in environments where production containers share the same Docker daemon.
The MCP server exposes Docker Engine API operations. For Compose-specific commands (docker compose up/down), the agent would need to execute shell commands. Basic container operations work directly through MCP tools.
By default it connects to the local Docker socket. To connect to a remote host, you would need to configure the DOCKER_HOST environment variable in the MCP server configuration.
Referencias (3)
- MCP Servers GitHub— Official MCP server for Docker container management
- MCP Documentation— Model Context Protocol for AI tool integration
- Docker Engine API Docs— Docker Engine API for container operations
Relacionados en TokRepo
Fuente y agradecimientos
Part of the Model Context Protocol Servers collection.
Docker MCP — Container management for AI agents
Discusión
Activos relacionados
Apify MCP Server — 8,000+ Web Scrapers for Agents
Apify MCP Server connects agents to Apify Actors via a hosted endpoint (mcp.apify.com) or local run, turning thousands of web scrapers into callable tools.
WhatsApp MCP Server — Chat with WhatsApp via AI Agents
MCP server connecting Claude and AI agents to your personal WhatsApp. Search contacts, read messages, send replies and media via natural language.
Notte — Browser Automation MCP for AI Agents
MCP server that turns web browsers into AI agent tools. Notte provides structured browser actions like click, type, navigate, and extract for LLM-driven automation.
Google Workspace MCP — Gmail Drive Calendar for AI
Official Google CLI with built-in MCP server for all Workspace APIs. One command gives AI agents access to Gmail, Drive, Calendar, Docs, Sheets, and 10+ Google services.