# 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. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```json { "mcpServers": { "docker": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-docker"] } } } ``` Now ask your AI agent: ``` "List all running containers" "Start a PostgreSQL container on port 5432" "Show logs for the api container" "Build the Dockerfile in ./backend and run it" ``` ## What is Docker MCP? Docker MCP is a Model Context Protocol server that gives AI agents structured access to Docker. Instead of running raw `docker` CLI commands, agents use typed tools for container lifecycle management — list, run, stop, remove, inspect, logs, and build. This enables AI-driven DevOps workflows where agents manage infrastructure autonomously. **Answer-Ready**: Docker MCP gives AI agents container management via MCP tools. List, run, stop, inspect, build, and read logs through structured tool calls. Enables AI-driven DevOps and automated container workflows. Works with Claude Code and Cursor. **Best for**: AI agents managing Docker containers for dev/test/deploy. **Works with**: Claude Code, Cursor, Claude Desktop. **Setup time**: Under 1 minute. ## Core Tools ### Container Management | Tool | What It Does | |------|-------------| | list_containers | List running/all containers | | run_container | Start a new container | | stop_container | Stop a running container | | remove_container | Delete a container | | inspect_container | Get container details | | container_logs | Read container output logs | ### Image Management | Tool | What It Does | |------|-------------| | list_images | List available images | | pull_image | Download an image | | build_image | Build from Dockerfile | | remove_image | Delete an image | ### System | Tool | What It Does | |------|-------------| | docker_info | System-wide Docker info | | docker_compose_up | Start compose services | | docker_compose_down | Stop compose services | ## Use Cases | Use Case | Example | |----------|---------| | Dev Environment | "Spin up PostgreSQL and Redis for local dev" | | Testing | "Build and run the test suite in a container" | | Debugging | "Show me the last 100 lines of the API container logs" | | Cleanup | "Remove all stopped containers and dangling images" | | Deployment | "Build the Dockerfile and push to registry" | ## FAQ **Q: Is it safe to give AI agents Docker access?** A: Use with caution in production. For dev/test, it is very useful. Consider restricting to read-only operations in sensitive environments. **Q: Does it support Docker Compose?** A: Yes, includes compose up/down tools for multi-container orchestration. **Q: Can it build images?** A: Yes, the build_image tool accepts a Dockerfile path and build context. ## Source & Thanks > Part of the [Model Context Protocol Servers](https://github.com/modelcontextprotocol/servers) collection. > > Docker MCP — Container management for AI agents ## Quick Use ```json {"mcpServers": {"docker": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-docker"]}}} ``` Let AI agents manage Docker containers. ## What is Docker MCP? An MCP server for AI agents to manage Docker container lifecycles through tool calls. **TL;DR**: Docker MCP server. AI agents manage containers via tools (list/run/stop/logs/build). AI-driven DevOps workflows. ## Core Tools Containers: list/run/stop/remove/inspect/logs Images: list/pull/build/remove Compose: up/down ## FAQ **Q: Is it safe?** A: Great for dev/test environments; restrict to read-only in production. ## Source & Thanks > [modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers) --- Source: https://tokrepo.com/en/workflows/docker-mcp-container-management-ai-agents-a2214d04 Author: MCP Hub