hetzner-mcp
Provides full API automation for Hetzner Cloud and Storage services, allowing management of servers, networking, load balancers, firewalls, volumes, DNS zones, and storage boxes.
Click on "Install 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-mcpCreate a CX22 server in fsn1-dc14 with my SSH key"
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
Model Context Protocol server for full Hetzner Cloud + Storage API automation
Expose all official Hetzner operations as MCP tools so AI agents can manage servers, networking, load balancers, firewalls, volumes, DNS zones, and storage boxes from one server.
Install
pipx install hetzner-mcp
hetzner-mcp installThen set your token and restart your MCP client:
export HETZNER_TOKEN="your_token_here"Or configure it once via CLI (persisted local config):
hetzner-mcp auth set --token "your_token_here"What It Does
hetzner-mcp loads official OpenAPI specs from Hetzner and exposes operations as MCP tools.
Full Cloud API coverage:
https://api.hetzner.cloud/v1Full Storage API coverage:
https://api.hetzner.com/v1Dynamic tool generation from operation IDs
Helper tools for discovery, search, and operation schema inspection
Action polling helper for async action workflows
Core helper tools
Tool | What it does |
| List all operations with filters (domain/tag/method/query) |
| Search operations by keyword |
| Inspect full operation details and input schema |
| List all API categories/tags with docs descriptions |
| Explain one category in depth with all endpoints inside |
| Show configured project profiles and active credential context |
| Switch active project profile for agent execution context |
| Poll cloud/storage actions until completion |
All API operations are also exposed directly as tools using the official operation ID names (for example create_server, get_action, create_storage_box).
For agent-friendly documentation, every endpoint and category also has dedicated guide tools:
Endpoint guide tool pattern:
guide_<operation_id>Example:
guide_create_server
Category guide tool pattern:
category_guide_<api_domain>_<category_slug>Example:
category_guide_cloud_servers
These guide tools include docs text from the OpenAPI documentation, explicit purpose, parameter explanations, and example tool arguments.
Docs-first execution lock (required)
This server enforces a docs-first workflow for endpoint execution:
Call
guide_<operation_id>first for the endpoint you want to execute.Then call the endpoint tool itself (for example
create_server).
If you skip step 1, execution is rejected with a docs_required error.
Unlocking is based on context freshness (interaction distance in the current session), not wall-clock time:
Docs must be read before execution.
Recently executed endpoints remain trusted while context is still fresh.
After enough unrelated tool interactions (context drift), docs must be read again.
Full Coverage
Current generated operation coverage:
Total operations: 221
Cloud operations: 189
Storage operations: 32
You can verify this locally:
python scripts/verify_operation_coverage.pyExample Prompts
"List all Hetzner operations related to firewalls"
"Create a CX22 server in fsn1-dc14 with my SSH key"
"Attach volume 12345 to server 67890"
"Create a load balancer and add target server 1001"
"Enable rescue mode on server 123 and wait for action completion"
"Create a storage box and reset its password"
"Show operation details for update_storage_box_access_settings"Authentication
You can configure auth in two ways:
Environment variables (recommended for CI/ephemeral environments)
Local CLI config file (recommended for local workstation use)
Environment variables (highest precedence):
HETZNER_TOKENfor both Cloud and Storage APIsHETZNER_CLOUD_TOKENto override cloud auth tokenHETZNER_STORAGE_TOKENto override storage auth tokenHETZNER_PROJECTto choose one configured local project profile for this session
Base URL safety:
Default API targets are locked to the official Hetzner HTTPS endpoints.
HETZNER_CLOUD_BASE_URLandHETZNER_STORAGE_BASE_URLare validated before any token is attached.Custom base URLs are blocked by default to prevent credential exfiltration to non-Hetzner hosts.
For controlled test environments only, opt in explicitly with
HETZNER_ALLOW_CUSTOM_BASE_URLS=true.
Local CLI config examples:
# set default token
hetzner-mcp auth set --token "your_token_here"
# auth set auto-probes what the provided key can do
# (cloud/storage + read/write capability hints)
# set per-domain overrides
hetzner-mcp auth set --cloud-token "cloud_token" --storage-token "storage_token"
# inspect effective token sources (env/file/unset)
hetzner-mcp auth show
# open full local config in your editor
hetzner-mcp config editMulti-project profile examples:
# create per-environment profiles
hetzner-mcp project add prod --description "Production Hetzner" --token "prod_token" --activate
hetzner-mcp project add staging --description "Staging Hetzner" --token "staging_token"
# project add also auto-detects capability hints for entered keys
# see which profile is active and what each one is for
hetzner-mcp project list
# switch active profile
hetzner-mcp project use stagingCapability probing notes:
auth setandproject addautomatically probe entered keys and print capability hints.Report format includes per-domain read/write level plus probe status codes (for example
cloud:read+write,storage:no-access).Detection uses safe representative
GET/POSTchecks and is best-effort guidance, not a formal permission matrix.
Config file location:
~/.config/hetzner-mcp/config.json(macOS/Linux)%APPDATA%\\hetzner-mcp\\config.json(Windows)Override path with
HETZNER_MCP_CONFIG_PATH
Optional runtime controls:
HETZNER_CLOUD_BASE_URLHETZNER_STORAGE_BASE_URLHETZNER_TIMEOUT_SECONDSHETZNER_MAX_RETRIESHETZNER_BACKOFF_BASE_SECONDS
Supported MCP Clients
Auto-configuration is included for:
Client | Auto-config |
Claude Desktop | Yes |
Claude Code | Yes |
Cursor | Yes |
Cline | Yes |
Windsurf | Yes |
OpenCode | Yes |
Run:
hetzner-mcp installOpenCode integration note:
This installer writes OpenCode MCP config to the global OpenCode config file (
opencode.jsonc) under themcpkey.Legacy
~/.opencode/mcp.jsonis not used.
Manual Configuration
{
"mcpServers": {
"hetzner-mcp": {
"command": "hetzner-mcp-server",
"args": []
}
}
}CLI Commands
Command | Description |
| Show effective runtime config + registry + client status |
| Print detailed diagnostics |
| Run stdio MCP server |
| Refresh specs and re-apply client integration |
| Configure supported MCP clients |
| Show client config installation state |
| Re-apply configuration entries |
| Remove MCP config entries |
| Configure API keys directly from CLI and auto-detect key capabilities |
| Show token status and source |
| Clear stored token entries |
| Manage multiple project credential profiles (with capability probing on add) |
| Show stored + effective config |
| Read/write persisted config keys |
| Edit persisted config file in |
Legacy aliases still work: install, repair, uninstall, diagnose.
Development
git clone https://github.com/devinoldenburg/hetzner-mcp.git
cd hetzner-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Validate quality
ruff check .
mypy src
pytest
# Refresh specs and inspect counts
python scripts/sync_specs.py
python scripts/verify_operation_coverage.pySecurity Notes
Never commit API tokens.
Tokens can be read from environment variables or persisted local config, but outbound API targets are validated before Authorization headers are sent.
Official Hetzner HTTPS base URLs are enforced by default; custom base URLs require explicit opt-in with
HETZNER_ALLOW_CUSTOM_BASE_URLS=true.Dynamic endpoint calls now validate path, query, and JSON body inputs against the loaded OpenAPI schema before making HTTP requests.
MCP tool responses redact common secret fields such as
token,password,secret, andauthorizationto avoid leaking credentials into transcripts.set_active_api_projectnow switches the active project for the current MCP session by default; usepersist=trueonly when you intentionally want to update local config.Server logs are routed to stderr to keep stdio JSON-RPC clean.
Network retries are limited and capped.
Troubleshooting
ModuleNotFoundError: hetzner_mcp in local scripts
Install editable package:
pip install -e .
No operations listed in MCP client
Run
hetzner-mcp statusVerify config file includes
hetzner-mcpRestart the client process after installation
Auth failures (401 unauthorized)
Ensure
HETZNER_TOKENor domain-specific token is exported in the client runtime environment
Rate limiting (429)
The client retries transient failures automatically; reduce request burst and retry later
License
MIT
This server cannot be installed
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/devinoldenburg/hetzner-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server