hetzner-mcp
Manages Caddy reverse-proxy routes on registered hosts, with fenced edits, backups, validation, rollback, and reload.
Manages Cloudflare DNS zones and records, including listing zones, setting and deleting records, and checking DNS configuration.
Inspects and controls Docker workloads on managed hosts, including listing containers, viewing logs, and running Docker Compose actions.
Manages Hetzner Cloud and DNS resources, including servers, snapshots, firewalls, volumes, networks, floating IPs, SSH keys, and DNS records.
Click on "Deploy 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., "@hetzner-mcp rebuild srv-web-1 with the latest Ubuntu image"
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.
hetzner-mcp
An MCP server that lets Claude operate a Hetzner estate: Cloud servers, DNS (Cloudflare and Hetzner DNS), hosts over SSH, Coolify, and multi-step recipes. Every write is a dry run until confirmed, protected servers refuse destructive calls, and every call is audited.
Status: v0.1.0. Built and tested against mocked APIs, a real SSH host, real Docker and a real Caddy. Not yet pointed at a live Hetzner project.
Modules and tools (53 with everything configured)
Module | Switched on by | Tools |
fleet | always |
|
cloud |
|
|
dns |
|
|
host |
|
|
coolify |
|
|
recipes | SSH key (+ |
|
audit | always |
|
hz_capabilities is always present and says which modules are on and what each one needs.
Related MCP server: hetzner-mcp-server
Safety model
Dry run by default. Write tools return a plan unless called with
confirm: true. Delete and rebuild also needconfirm_nameequal to the server name.Protected resources. A server is protected when it is in
PROTECTED_SERVERS, has the Hetzner labelprotected=true, is markedprotectedin the host registry, or has Hetzner delete/rebuild protection on. Destructive calls on it are refused even withconfirm: true.Host registry. SSH only reaches hosts listed in
config/hosts.json. File reads and writes stay inside each host'sallowed_paths..envfiles return their keys, never values.Audit log. Every call (read, dry run, refused, executed) is appended to
data/audit.jsonlwith secrets masked.Caddy edits are fenced with markers, backed up, validated and rolled back on failure before a reload.
Stack
Node 22, TypeScript (strict), @modelcontextprotocol/sdk, zod, ssh2, Express (Streamable HTTP), Biome, Vitest, pnpm, Docker.
Quickstart (local, stdio)
pnpm install
cp .env.example .env # fill in what you have
cp config/hosts.example.json config/hosts.json
pnpm buildClaude Desktop / Claude Code config:
{
"mcpServers": {
"hetzner": {
"command": "node",
"args": ["C:\\path\\to\\hetzner-mcp\\dist\\index.js"],
"env": { "HCLOUD_TOKEN": "…", "SSH_KEY_PATH": "C:\\Users\\you\\.ssh\\hetzner_mcp_ed25519", "HOSTS_FILE": "C:\\path\\to\\hetzner-mcp\\config\\hosts.json" }
}
}
}Hosted (HTTP, behind Caddy on the app server): see docs/RUNBOOK.md.
CI checks
pnpm typecheck && pnpm lint && pnpm testCI runs the same three plus pnpm build and a gitleaks secret scan.
Growing it
Add a folder under src/modules/<id>/ exporting a Module (status() + register()), register tools through the ToolKit (t.read / t.write), and list it in src/modules/index.ts. The guard, audit and capability report come for free. See docs/CONTRIBUTING.md.
License
MIT
Available Tools
6 toolsaudit_logAudit logBRead-onlyIdempotent
Most recent calls through this MCP, newest first: tool, mode (read/dry_run/execute/refused), result, summary.
Inputs: mode, tool, limit, errors_only.
hz_capabilitiesCapabilitiesBRead-onlyIdempotent
Which modules are on, what they point at, and what to configure to switch the others on.
Inputs: no named parameters.
hz_fleet_overviewFleet overviewARead-onlyIdempotent
Every server in every configured Hetzner project: status, type, location, IP, backups, volumes, gross €/month, registry name and role, protection. Volume and traffic costs are not included in the total.
Inputs: no named parameters.
hz_host_listList registered hostsCRead-onlyIdempotent
The host registry: SSH targets, roles, protection, allowed paths, Caddy.
Inputs: no named parameters.
hz_host_registerRegister or update hostA
Add a host to the registry (or replace its entry). Only registered hosts are reachable over SSH. Set protected=true on the mail server. test_ssh checks the login before saving.
Safety: dry run unless confirm=true.
Inputs: name (required), address (required), port, role, +11 more.
hz_host_removeRemove host from registryADestructive
Remove a host entry. The server itself is untouched; SSH tools can no longer reach it.
Safety: dry run unless confirm=true; refused on protected resources.
Inputs: name (required), confirm.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct job: registry listing, registration, removal, fleet inventory, audit history, and capability reporting. The only mild overlap is hz_host_list vs hz_fleet_overview (registry SSH targets vs Hetzner cloud servers with costs), but descriptions make the distinction clear enough.
Most tools follow a hz_<resource>_<action> snake_case pattern (hz_host_list, hz_host_register, hz_host_remove, hz_fleet_overview), which is predictable. Deviations are minor: audit_log lacks the hz_ prefix and hz_capabilities is resource-only with no verb.
Six tools is well-scoped for a registry-plus-inventory server; each earns its place (three host CRUD operations, one fleet read, plus two meta/observability tools). Nothing feels redundant or padded.
Registry lifecycle is covered (list/register/replace/remove), but there is no get-single-host detail tool and no Hetzner server lifecycle operations (create, delete, power, resize, snapshots) despite the server's name implying cloud management. hz_capabilities hints modules may be toggled on, so the surface is intentionally partial but has notable gaps.
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Agent personas for Claude. 16 tools, 13 personas, 3 workflows. Zero extra API cost. Free.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables conversational management of Hetzner Cloud, DNS, and Storage Box infrastructure through 137 MCP tools for CRUD operations and actions like server power control, DNS zone management, and storage box snapshots.100MIT
- AlicenseAqualityDmaintenanceEnables Claude Code to manage Hetzner Cloud servers, including creating, deleting, powering on/off, and rebooting servers, as well as managing SSH keys and listing resources.1446 npm1MIT
- AlicenseBqualityDmaintenanceEnables agentic administration of Infomaniak accounts via Claude, offering 169 tools for web hosting, mail, domains, DNS, and more, with a strict two-phase commit for safe mutations.1003 npmMIT
- AlicenseAqualityBmaintenanceEnables infrastructure operations through Claude Code by exposing 195 tools across 7 providers including Coolify, VPS, Hetzner, Namecheap, Cloudflare, Supabase, and GitHub for server management, DNS, cloud resources, and more.93MIT