Skip to main content
Glama

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

Variable

Required

Description

HETZNER_SSH_HOST

Yes

SSH host alias (default: hetzner)

CLOUDFLARE_ZONE_ID

No

Cloudflare Zone ID (for DNS tools)

CLOUDFLARE_EMAIL

No

Cloudflare account email

CLOUDFLARE_API_KEY

No

Cloudflare 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

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/optimusbasti/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server