dockhand
An MCP server that gives LLMs direct control over a local Docker daemon, enabling container, image, volume, network, and Compose stack management through natural language.
README
Dockhand
An MCP server that gives an LLM (Claude, etc.) direct control over your local Docker daemon — run and manage containers, images, volumes, networks, and Compose stacks through natural language.
Built with FastMCP and the Docker SDK for Python.
Requirements
- Python >= 3.14
- Docker installed and running locally (Docker Desktop, Docker Engine, etc.)
- Docker Compose v2 CLI (
docker compose) available onPATH— required for the stack/compose tools - uv for dependency management
Installation
git clone <this-repo>
cd dockhand
uv sync
This creates a .venv and installs the dependencies pinned in uv.lock.
Running
uv run main.py
The server communicates over stdio, so it's meant to be launched by an MCP client rather than run standalone in a terminal.
Connecting to Claude Desktop / Claude Code
Add an entry to your MCP client's configuration (e.g. claude_desktop_config.json):
{
"mcpServers": {
"dockhand": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/dockhand", "run", "main.py"]
}
}
}
Restart the client and the tools below become available to the model.
Available tools
Containers (containers.py)
| Tool | Description |
|---|---|
run_container |
Runs a container from an image, mapping a container port to a host port |
stop_container |
Stops a running container |
container_start |
Starts a stopped container |
container_restart |
Restarts a container |
delete_container |
Force-removes a container (stops it first if needed) |
list_containers |
Lists all containers and their status |
container_logs |
Fetches the last N log lines from a container |
container_stats |
Reports live CPU % and memory usage |
container_inspect |
Shows env vars, mounts, network IPs, and health status |
container_exec |
Executes a shell command inside a running container |
Images (images.py)
| Tool | Description |
|---|---|
list_images |
Lists all local images with size |
build_image |
Builds an image from a Dockerfile already on disk |
push_image |
Tags and pushes a local image to a registry (requires prior docker login) |
delete_image |
Force-removes a local image |
Volumes & networks (volumes.py)
| Tool | Description |
|---|---|
list_volumes |
Lists volumes with driver and mountpoint |
remove_volume |
Deletes a volume (fails if still in use) |
list_networks |
Lists networks with driver and scope |
Compose stacks (stacks.py)
| Tool | Description |
|---|---|
deploy_stack |
Deploys a stack from an inline docker-compose.yml (compose up -d) |
stop_stack |
Stops a stack's containers without removing them |
remove_stack |
Stops and removes a stack, including its volumes (compose down -v) |
list_stacks |
Lists all compose projects, including stopped ones |
stack_status |
Shows the status of a stack's containers (compose ps) |
stack_logs |
Collects logs from every container in a stack |
Project structure
main.py # Entrypoint: registers tool modules and starts the MCP server
server.py # Shared FastMCP server instance
docker_client.py # Lazy singleton Docker SDK client
compose_client.py # Thin wrapper around the `docker compose` CLI
containers.py # Container lifecycle & inspection tools
images.py # Image build/push/list/delete tools
volumes.py # Volume & network tools
stacks.py # Compose stack tools
Safety notes
This server gives the model real, unsandboxed control over your Docker daemon:
delete_containeranddelete_imageforce-remove resources without confirmation.remove_stackdeletes volumes (-v), which is destructive and irreversible for stateful data.container_execruns arbitrary shell commands inside a container.push_imagepushes to whatever registry you point it at, using your existing local Docker credentials.
Only connect this server to clients/agents you trust, and be deliberate about which containers and stacks you let it touch.
License
No license specified.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。