mcp-server-docker
Control Docker containers, images, and services directly from your AI assistant via the local Docker socket (no API keys required).
Container management:
List running or all containers (including stopped) with status, ports, and image info
Start, stop, restart, or remove containers (force option available for running containers)
Get logs with configurable tail lines
Execute commands inside a running container
Get live CPU, memory, and network resource stats
Image management:
List all Docker images
Remove Docker images (force option available)
Provides tools to manage Docker containers and images, including capabilities to list, start, stop, restart, and remove containers, execute commands, view logs, and monitor real-time resource usage statistics.
mcp-server-docker
Control Docker containers, images, and services from your AI coding assistant. List, start, stop, read logs, run commands inside containers, and check resource usage.
npx mcp-docker-serverCompatible with Claude Desktop, Cursor, VS Code Copilot, and any MCP-compatible client. No API keys needed. Connects to your local Docker socket automatically.

Demo built with remotion-readme-kit
Why
If 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.
Related MCP server: Docker Manager MCP
Tools
Tool | What it does |
| List running (or all) containers with status, ports, and image info |
| Get recent logs from a container |
| Start a stopped container |
| Stop a running container |
| Restart a container |
| Remove a container (with optional force) |
| Execute a command inside a running container |
| Get live CPU, memory, and network stats |
| List all Docker images on the host |
| Remove a Docker image |
Quick Start
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["-y", "mcp-docker-server"]
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["-y", "mcp-docker-server"]
}
}
}VS Code
Add to user settings or .vscode/mcp.json:
{
"mcp": {
"servers": {
"docker": {
"command": "npx",
"args": ["-y", "mcp-docker-server"]
}
}
}
}Examples
"List all running Docker containers"
"Show me the logs from the nginx container"
"Restart the api-server container"
"What's the CPU and memory usage of my postgres container?"
"Execute
ls -la /appinside the web container""List all Docker images and their sizes"
"Stop all containers that are using the old image"
Prerequisites
Docker must be running on your machine
The server connects to the Docker socket at
/var/run/docker.sock(Linux/macOS) or the named pipe on WindowsNo API keys or tokens required
Agent Plugins
This repo is an Agent Plugins 1.0.0 package: plugin.json, portable mcp.json, and skills/ ship together with the MCP server.
For 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.
The Cursor and VS Code install buttons above still work: they add the same npx -y mcp-docker-server stdio server as manual JSON.
FAQ
What is mcp-docker-server?
The 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.
Do I need Docker Desktop running?
Yes. The daemon must be up and the MCP process must reach docker.sock (or the Windows named pipe).
Is this safe for production containers?
Treat stop/remove/restart as destructive. Confirm with the user before changing production workloads.
Can I install it as an Agent Plugin in Cursor?
Yes. Use ~/.cursor/plugins/local/mcp-server-docker so the bundled docker-management skill loads with the MCP config.
Do I need API keys?
No. Only local Docker access.
Development
git clone https://github.com/ofershap/mcp-server-docker.git
cd mcp-server-docker
npm install
npm test
npm run buildSee also
More MCP servers and developer tools on my portfolio.
Author
README built with README Builder
License
MIT © 2026 Ofer Shapira
Available Tools
10 toolscontainer_logsC
Get logs from a Docker container.
Inputs: id (required), tail.
container_statsA
Get CPU, memory, and network stats for a running Docker container.
Inputs: id (required).
exec_commandC
Execute a command inside a running Docker container.
Inputs: id (required), command (required).
list_containersB
List Docker containers. Set all=true to include stopped containers.
Inputs: all.
list_imagesB
List Docker images on the host.
Inputs: no named parameters.
remove_containerA
Remove a Docker container. Use force=true to remove running containers.
Inputs: id (required), force.
remove_imageB
Remove a Docker image. Use force=true to force removal.
Inputs: id (required), force.
restart_containerC
Restart a Docker container.
Inputs: id (required).
start_containerA
Start a stopped Docker container.
Inputs: id (required).
stop_containerC
Stop a running Docker container.
Inputs: id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose targeting specific Docker operations: logs, stats, exec, listing containers/images, removal, restart, start, and stop. There is no overlap or ambiguity between tools, as each handles a unique action on a well-defined resource.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., list_containers, remove_image, start_container). The naming is predictable and uniform across all tools, making them easily readable and systematic.
With 10 tools, the server is well-scoped for Docker management, covering essential operations like lifecycle control (start, stop, restart), inspection (logs, stats, list), and cleanup (remove). Each tool earns its place without redundancy or bloat.
The toolset provides strong coverage for core Docker workflows, including CRUD-like operations for containers and images. A minor gap exists in creating or building images (e.g., build_image or pull_image), but agents can still perform most common tasks effectively with the available tools.
Maintenance
Related MCP Connectors
Manage your own cloud with AI: deploy apps, push and ship custom Docker images, manage resources via your AI agent.
Inspect and control your Northflank projects, services, jobs, and builds from your AI assistant.
Manage VeriTeknik servers, DNS, backups and support tickets from your AI assistant.
Manage Rackspace Spot Kubernetes Cloudspaces, node pools, and VMs from your AI assistant.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables natural language interaction with Docker commands and operations. Supports container management, image operations, system information, and Docker Compose through conversational requests.14101 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Docker containers, deploy stacks, and monitor services across multiple Docker hosts from one centralized location. Supports container lifecycle management, Docker Compose operations, and infrastructure orchestration through natural language commands.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Docker containers, images, networks, volumes, and Compose services through the Model Context Protocol. It supports system operations, command execution within containers, and integration with Docker Hub and GitHub Container Registry.154 npm2MIT
- AlicenseCqualityDmaintenanceEnables AI assistants to manage Docker containers, images, networks, volumes, and Docker Compose services through the Model Context Protocol.27101 npmMIT