Barie Hetzner MCP Server
An MCP server that lets an AI agent inspect and operate Hetzner infrastructure through the Hetzner Cloud API and the Hetzner API (Storage Boxes). It is built for DevOps use, with safety rules enforced by the server rather than left to the agent.
Safety model
Every tool belongs to one of three tiers. The tiers you have not enabled are hidden from the agent, and calling them by name is refused.
| Tier | Enabled | Examples |
|---|---|---|
| read | Always | inventory, server metrics, DNS records, certificates, recent actions |
| write | Unless --read-only |
reboot, snapshot, DNS upsert, firewall rules, attach volume, LB targets |
| dangerous | Only with --allow-dangerous, and every call needs confirm=true |
create/delete/rebuild/resize server, delete resources, hard power-off, storage box rollback |
Further protections:
- Hetzner delete/rebuild protection is respected. The server never turns it off.
- Secrets are stripped from results.
create_serverrequires SSH keys, so no root password is generated, and anyroot_passwordthe API returns is redacted. - Async operations are awaited: tools return the final status, not "started".
firewall_set_rules,upsert_dns_recordandupdate_labelsreturn the previous state, so changes can be reverted.- Every change, including refused calls, is written as one JSON audit line to stderr, and
optionally to
--audit-log. - Logs go to stderr only. stdout is the MCP protocol channel.
For a hard guarantee, use a Read-type API token together with --read-only. The API then
rejects writes even if the server had a bug.
Installation
Requirements:
- Python 3.10+
- A Hetzner Console project API token: Project → Security → API Tokens
pip install -e .
barie-hetzner-mcp --api-token <TOKEN> --read-only
Configuration
{
"mcpServers": {
"barie-hetzner-mcp": {
"command": "uvx",
"args": ["barie-hetzner-mcp", "--api-token", "YOUR_HETZNER_API_TOKEN", "--read-only"]
}
}
}
| Option | Default | Description |
|---|---|---|
--api-token |
$HETZNER_API_TOKEN |
Project API token, used for both APIs |
--read-only |
off | Expose and allow read tools only |
--allow-dangerous |
off | Expose the dangerous tier (ignored with --read-only) |
--action-timeout |
120 |
Seconds to wait for async operations before returning running |
--audit-log |
none | Also append the audit log to this file |
A token belongs to one Hetzner project. To work with another project, start the server with that project's token.
Tools
Read (20)
- Overview:
project_overview - Servers:
list_servers,get_server,get_server_metrics,list_server_types,list_images,list_ssh_keys - Storage and networking:
list_volumes,list_firewalls,list_networks,list_ips,list_load_balancers,list_certificates - DNS:
list_dns_zones,list_dns_records - Storage Boxes:
list_storage_boxes,get_storage_box,list_storage_box_snapshots - Actions:
list_recent_actions,get_action
Write (13)
- Servers:
server_power(poweron / shutdown / reboot),create_server_snapshot,set_server_backups - Labels and DNS:
update_labels,upsert_dns_record - Firewalls:
firewall_set_rules,firewall_resources - Volumes, IPs and load balancers:
volume_attachment,resize_volume,ip_assignment,lb_target - Storage Boxes:
storage_box_snapshot,storage_box_snapshot_plan
Dangerous (6)
- Servers:
create_server,rebuild_server,change_server_type - Deletion and rollback:
delete_resource,delete_dns_record,rollback_storage_box_snapshot - Also
server_powerwithpowerofforreset
Resources can be referenced by ID or by exact name. Results are compact JSON summaries, not raw API objects.
License
MIT
Metadata
Release files for barie-hetzner-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| barie_hetzner_mcp-0.1.0.tar.gz | 20.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| barie_hetzner_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.3 kB
Release files / barie_hetzner_mcp-0.1.0.tar.gz
| Download URL | barie_hetzner_mcp-0.1.0.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06e091659eb3887fe94668b0ec2feda0ef6ea2311793995a22ea5934c8f2031f
|
|
BLAKE2b-256 checksum How to use checksums |
8c84504cf48d20a72688194f823ac3e9f815ea7e905efeccb33fae60a99e1055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Release files / barie_hetzner_mcp-0.1.0-py3-none-any.whl
| Download URL | barie_hetzner_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d952d2c0f668cb3a646a68fe60c908ccabb07b309041751f9d0c90aa8a891c8d
|
|
BLAKE2b-256 checksum How to use checksums |
9c671bafb059911fd4bea3e0efdd9977a10519ab672ef787e91ccd21c0ff0c1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Security for barie-hetzner-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.