MCP Hub
Back to servers

Docker/Hetzner MCP Server

Provides tools for managing Docker containers, Compose stacks, and system resources on Hetzner servers via SSH. It also includes capabilities for reloading Caddy configurations and managing Cloudflare DNS records.

glama
Updated
Mar 28, 2026

Docker/Hetzner MCP Server

MCP (Model Context Protocol) server for managing Docker containers, Compose stacks, and server resources on a Hetzner dedicated server via SSH. Also includes Cloudflare DNS record management.

Tools

Containers

  • list_containers -- List running (or all) Docker containers
  • container_logs -- Get recent logs from a container
  • container_stats -- Get CPU, memory, and network I/O for a container
  • restart_container -- Restart a container
  • stop_container -- Stop a running container
  • start_container -- Start a stopped container

Stacks

  • list_stacks -- List all Docker Compose stacks found under /opt/
  • stack_status -- Get status of a Compose stack

System

  • system_info -- Docker system info (disk usage, image/container counts)
  • disk_usage -- Server disk usage for all mount points and key directories
  • system_resources -- CPU, RAM, load average, uptime, top processes
  • list_images -- List Docker images sorted by size
  • prune_system -- Prune unused Docker resources (not volumes)

Caddy

  • caddy_reload -- Reload the Caddy reverse proxy configuration

Cloudflare DNS

  • list_dns_records -- List all DNS records for a Cloudflare zone

Setup

cd docker-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Configure
cp run-mcp.sh.example run-mcp.sh
chmod +x run-mcp.sh
# Edit run-mcp.sh and set your credentials

Prerequisites

  • SSH access to the Hetzner server (configured in ~/.ssh/config as an alias)
  • Docker installed on the remote server
  • (Optional) Cloudflare API credentials for DNS management

Environment Variables

VariableRequiredDescription
HETZNER_SSH_HOSTYesSSH host alias (default: hetzner)
CLOUDFLARE_ZONE_IDNoCloudflare Zone ID (for DNS tools)
CLOUDFLARE_EMAILNoCloudflare account email
CLOUDFLARE_API_KEYNoCloudflare Global API Key

Claude Code Configuration

Add to ~/.mcp.json:

{
  "mcpServers": {
    "docker": {
      "command": "/path/to/docker-mcp/run-mcp.sh",
      "type": "stdio"
    }
  }
}

License

MIT -- see LICENSE

Reviews

No reviews yet

Sign in to write a review