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.