docker-copilot-mcp
Provides tools for inspecting and managing Docker containers, including listing containers, retrieving status and logs, checking system health, and restarting containers with a gated confirmation flow and audit trail.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@docker-copilot-mcpshow me the status of all my Docker containers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
docker-copilot-mcp
A local MCP server that lets Claude inspect and safely manage Docker containers on your machine — built as a hands-on project to learn the Model Context Protocol (tools, transports, state, and safety-gated destructive actions).
What it does
Read-only inspection: list containers, get detailed status, fetch logs, check system health (CPU/memory/disk)
Safe destructive actions: restart a container, but only after a two-step confirmation flow — the agent must first request a plan + token, then explicitly confirm before anything actually happens
Scoped: only containers on an explicit whitelist can ever be restarted, regardless of what the agent is asked to do
Audited: every tool call (especially restarts) is logged to a local SQLite database with timestamp, arguments, result, and success/failure
Related MCP server: Docker MCP
Why this project
Most MCP tutorials stop at "here's a tool that returns data." The interesting and hard part of building real agent tooling is deciding what an agent should be allowed to do without asking, and what it must never do without a human explicitly confirming. This project exists to practice that boundary, not just the MCP plumbing.
Architecture
Claude Desktop (MCP client) → stdio transport → FastMCP server (server.py) → Tools (list_containers, get_container_status, get_container_logs, get_system_health, restart_container) → Safety Gate (scope check → confirmation token → validate → execute) → Docker Client + Audit Log (SQLite)
The safety model
Every destructive tool (currently just restart_container) goes through a
gate before touching Docker:
Scope check — is this target even allowed? The server maintains an explicit whitelist (
safety/scope.py); anything outside it is refused immediately, no matter how the request is phrased.Dry run by default — calling
restart_containerwithout aconfirmation_tokennever restarts anything. It returns a plan description and a token bound to that exact action (tool + target + parameters).Explicit confirmation — only a second call, with the matching token, actually executes. Tokens are single-use and expire after 2 minutes, so a stale or reused confirmation can't silently trigger an old, possibly outdated action.
Audit trail — both the dry-run request and the real execution are logged to SQLite, so there's always a record of what was proposed and what actually happened.
Setup
python -m venv venv
venv\Scripts\Activate.ps1
pip install -r requirements.txtRequires Docker Desktop running locally.
Running
Manually (for testing):
python src/server.pyVia Claude Desktop: add to your config:
{
"mcpServers": {
"homelab-ops": {
"command": "/absolute/path/to/venv/Scripts/python.exe",
"args": ["/absolute/path/to/src/server.py"]
}
}
}Tools
Tool | Type | Description |
| read-only | List all containers, running or stopped |
| read-only | Detailed status for one container |
| read-only | Recent logs from a container |
| read-only | Host CPU / memory / disk usage |
| destructive, gated | Restart a container (requires confirmation) |
Tests
pytest tests/test_safety_gate.py -vWhat I learned building this
The difference between MCP tools (actions) and the transport/routing layer
Why destructive tool calls need a confirmation flow, not just try/except
How to scope an agent's permissions explicitly, not just via prompt instructions
Debugging a live MCP integration end-to-end, including finding that Claude Desktop reads config from a sandboxed AppData path, not the documented default
Possible extensions
HTTP transport + OAuth for remote/shared access
systemd service management alongside Docker
Config-driven scope whitelist instead of hardcoded list
/diagnose <container>prompt template for guided investigation
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityFmaintenanceAllows Claude and other AI assistants to interact with Docker through the MCP protocol, enabling container and image management including listing, running, stopping, and pulling Docker resources.6914MIT
- Flicense-qualityDmaintenanceEnables Docker container management directly through Claude using the Model Context Protocol. Provides 14 tools for managing containers, images, volumes, and Docker Compose deployments through natural language commands.
- AlicenseAqualityDmaintenanceEnables managing Docker containers (run, list, stop, remove, view logs) through Claude Desktop using natural language commands.591MIT
- Flicense-qualityDmaintenanceEnables Claude to manage Docker Compose containers by updating, running commands, and viewing status/logs.
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Hadolint-grade Dockerfile audit — 19 checks: secrets, privileges, supply chain, hygiene.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/trijal-s/docker-copilot-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server