Docker Container Manager MCP Server
An MCP server that gives any LLM client the ability to list, inspect, start, stop, and monitor Docker containers on the host machine.
README
Docker Container Manager MCP Server
An MCP server that gives any LLM client the ability to list, inspect, start, stop, and monitor Docker containers on the host machine — putting your entire container stack at your AI assistant's fingertips.
Overview
This server wraps the Docker SDK for Python using FastMCP, exposing container management operations as tools any MCP-compatible client can call. Connect it to Claude Desktop and you can ask Claude to check container health, fetch logs, inspect configuration, or monitor live CPU and memory usage — all from a single conversation.
The server connects to the Docker daemon via the Unix socket on startup, verifies connectivity with a ping, and shares the client across all tool calls via FastMCP's lifespan context. No tokens required — just a running Docker daemon.
Tools
| Tool | Description |
|---|---|
list_containers |
List running or all containers with status and port mappings |
start_container |
Start a stopped container by name or ID |
stop_container |
Stop a running container gracefully |
get_container_logs |
Fetch the last N lines of timestamped logs |
inspect_container |
Get full container details — image, env vars, mounts, network |
get_container_stats |
Get live CPU and memory usage matching docker stats output |
Project Structure
docker-manager-mcp/
├── server.py # FastMCP instance, lifespan, tool registration
├── config.py # Environment variables and constants
├── tools/
│ ├── __init__.py
│ ├── containers.py # list, start, stop, logs, inspect
│ └── stats.py # get_container_stats with accurate CPU/memory calculation
├── .env # Optional overrides
├── .env.example # Template
├── requirements.txt
├── Dockerfile
└── README.md
Requirements
- Python 3.11+
- uv
- Docker running on the host machine
- Your user in the
dockergroup:sudo usermod -aG docker $USER
Setup
1. Clone the repository:
git clone https://github.com/Festuskipkoech/docker-manager-mcp.git
cd docker-manager-mcp
2. Install dependencies:
uv sync
3. Configure your environment (optional):
cp .env.example .env
The defaults work out of the box on Linux and macOS. No tokens or credentials needed.
DOCKER_HOST=unix:///var/run/docker.sock
DEFAULT_LOG_LINES=50
DEFAULT_STOP_TIMEOUT=10
Running Locally
uv run python server.py
Or with the FastMCP CLI on Streamable HTTP transport:
fastmcp run server.py:mcp --transport streamable-http
Testing with MCP Inspector
Start the server in one terminal:
fastmcp run server.py:mcp --transport streamable-http
Launch the Inspector in a second terminal:
npx -y @modelcontextprotocol/inspector
In the Inspector UI:
- Transport: Streamable HTTP
- URL:
http://127.0.0.1:8000/mcp - Click Connect
Recommended test sequence:
| Step | Tool | Input |
|---|---|---|
| 1 | list_containers |
{"all_containers": false} |
| 2 | get_container_logs |
{"container_name": "your_container", "lines": 20} |
| 3 | inspect_container |
{"container_name": "your_container"} |
| 4 | get_container_stats |
{"container_name": "your_container"} |
| 5 | stop_container |
{"container_name": "your_container"} |
| 6 | start_container |
{"container_name": "your_container"} |
Using with Claude Desktop
Add the following to ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"docker-manager": {
"command": "/home/your-user/.local/bin/uv",
"args": [
"run",
"--directory",
"/absolute/path/to/docker-manager-mcp",
"python",
"server.py"
]
}
}
}
Use the full path to uv (find it with which uv). Restart Claude Desktop after saving, then try:
List all my running Docker containers and show me their status and ports
Claude calls list_containers and returns your full container stack:

Inspect a container and check live resource usage:
Inspect the prepwise_postgres container and show me its CPU and memory usage

Running with Docker
When running the server itself inside a container, mount the Docker socket so it can reach the host daemon:
docker build -t docker-manager-mcp .
docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8000:8000 docker-manager-mcp
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Cannot connect to Docker daemon |
Docker not running or socket inaccessible | Run docker ps to verify Docker is up |
Permission denied on socket |
User not in docker group | Run sudo usermod -aG docker $USER then log out and back in |
Container not found |
Wrong name or ID | Run list_containers with all_containers: true to see all containers |
Stats only available for running containers |
Container is stopped | Start the container first with start_container |
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。