Hetzner

Developer tools

A Model Context Protocol (MCP) server for interacting with the Hetzner Cloud API. This server allows language models to manage Hetzner Cloud resources through structured functions.

Your AI app calls the Hetzner MCP server, which does the work through tools like list_servers, get_server, create_server and delete_server and sends the result back to the chat.

About Hetzner

Hetzner is a community MCP server from dkruyt, filed in our directory under developer tools. A Model Context Protocol (MCP) server for interacting with the Hetzner Cloud API. This server allows language models to manage Hetzner Cloud resources through structured functions.

The README for Hetzner lists tools such as list_servers, get_server, create_server and delete_server, which your AI app can call once the server is connected.

At a glance

Publisher
dkruyt (community)
Runs
See the README for setup
Written in
Python
License
MIT
GitHub stars
158

Tools Hetzner gives your AI app

  • list_serversList all servers in your Hetzner Cloud account.
  • get_serverGet details about a specific server.
  • create_serverCreate a new server.
  • delete_serverDelete a server.
  • power_onPower on a server.
  • power_offPower off a server.
  • rebootReboot a server.
  • list_volumesList all volumes in your Hetzner Cloud account.
  • get_volumeGet details about a specific volume.
  • create_volumeCreate a new volume.
  • delete_volumeDelete a volume.
  • attach_volumeAttach a volume to a server.
  • detach_volumeDetach a volume from a server.
  • resize_volumeIncrease the size of a volume.
  • list_firewallsList all firewalls in your Hetzner Cloud account.
  • get_firewallGet details about a specific firewall.
  • create_firewallCreate a new firewall.
  • update_firewallUpdate firewall name or labels.
  • delete_firewallDelete a firewall.
  • set_firewall_rulesSet or update firewall rules.
  • apply_firewall_to_resourcesApply a firewall to servers or server groups.
  • remove_firewall_from_resourcesRemove a firewall from servers or server groups.
  • list_ssh_keysList all SSH keys in your Hetzner Cloud account.
  • get_ssh_keyGet details about a specific SSH key.

Tool names as the Hetzner README lists them. Your AI app shows the live list once Hetzner is connected.

How to set up Hetzner

  1. Follow the install steps in the Hetzner README; it is written in Python, so have that toolchain ready.
  2. Check the Hetzner README for keys or settings; the registry lists none that Hetzner requires.
  3. Add Hetzner to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Hetzner tools to confirm the connection.
  5. Run one read-only task with Hetzner first, such as a call to list_servers, before you allow anything that writes or sends.

Hetzner compared with similar servers

  • Pcbparts by Averyy has fewer GitHub stars than Hetzner (158 against 158); both are community servers, and Pcbparts runs as a remote server and Hetzner runs on your own machine.
  • GEmojiSharp by hlaueriksson has fewer GitHub stars than Hetzner (158 against 158); both are community servers, and both run locally.
  • Postman (delano) by delano has fewer GitHub stars than Hetzner (158 against 158); both are community servers, and both run locally.

Before you connect Hetzner

  • Give Hetzner its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Hetzner tool call until you trust what it does with them.
  • Treat text that Hetzner fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Hetzner on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Hetzner

How marketing and sales teams put Hetzner to work, by company size. Pick the size closest to yours and start Hetzner on one use case.

Small business

  • A small business with a developer can use Hetzner to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Hetzner to explain and fix a marketing site issue without context switching between tools.
  • Hetzner runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Hetzner to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Hetzner to keep scripts and automations documented and versioned as they change.
  • Start with list_servers and get_server, the tools Hetzner lists first, and add more once the team trusts the results.

Enterprise

  • Enterprise engineering teams can roll out Hetzner with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Hetzner so web and marketing engineering share one reviewed way of working with AI.
  • Hetzner is a community server, so have security review the code and pin a version before Hetzner touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Hetzner README

From dkruyt/mcp-hetzner on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Hetzner Cloud MCP Server

A Model Context Protocol (MCP) server for interacting with the Hetzner Cloud API. This server allows language models to manage Hetzner Cloud resources through structured functions.

Features

  • List, create, and manage Hetzner Cloud servers
  • Create, attach, detach, and resize volumes
  • Manage firewall rules and apply them to servers
  • Create and manage SSH keys for secure server access
  • View available images, server types, and locations
  • Power on/off and reboot servers
  • Simple, structured API for language model interaction
  • Claude Code integration for managing Hetzner resources directly from Claude

Requirements

  • Python 3.11+
  • Hetzner Cloud API token

Installation

Method 1: Direct Installation
  1. Clone this repository:
git clone https://github.com/dkruyt/mcp-hetzner.git
cd mcp-hetzner
  1. Install dependencies:
pip install -e .
  1. Create a .env file and add your Hetzner Cloud API token:
HCLOUD_TOKEN=your_hetzner_cloud_api_token_here
Method 2: Install as a Package
# Install directly from the repository
pip install git+https://github.com/dkruyt/mcp-hetzner.git

After installing as a package, create a .env file in your working directory with your Hetzner Cloud API token.

Usage

Starting the Server

Option 1: Run the installed package:

# Using default stdio transport
mcp-hetzner

# Using SSE transport
mcp-hetzner --transport sse

# Setting a custom port
mcp-hetzner --transport sse --port 8000

Option 2: Run as a module:

python -m mcp_hetzner
# or
python -m mcp_hetzner.server

The server supports two transport modes:

  • stdio (default): Standard I/O transport, typically used with Claude Code
  • sse: Server-Sent Events transport, suitable for HTTP clients

By default, the server runs on localhost:8080. You can customize the host and port by:

  1. Setting the MCP_HOST and MCP_PORT environment variables in your .env file
  2. Using the --port command line argument (overrides the environment variable)
Using with Claude Code

To use with Claude Code, run the server with SSE transport:

# Start the server with SSE transport
mcp-hetzner --transport sse --port 8080

# In another terminal, connect Claude Code to the server
claude-code --mcp-server localhost:8080
Testing the API

A test client is included to verify the server functionality:

python -m mcp_hetzner.client

Example Workflows

Basic Server Management
# List all your servers
list_servers

# Create a new server
create_server {
  "name": "web-server", 
  "server_type": "cx11", 
  "image": "ubuntu-22.04"
}

# Power operations
power_off {"server_id": 12345}
power_on {"server_id": 12345}
reboot {"server_id": 12345}

# Delete a server when no longer needed
delete_server {"server_id": 12345}
Volume Management
# List all volumes
list_volumes

# Create a new volume
create_volume {
  "name": "data-volume",
  "size": 10,
  "location": "nbg1",
  "format": "ext4"
}

# Attach volume to a server
attach_volume {
  "volume_id": 12345,
  "server_id": 67890,
  "automount": true
}

# Detach volume from server
detach_volume {
  "volume_id": 12345
}

# Resize a volume (can only increase size)
resize_volume {
  "volume_id": 12345,
  "size": 50
}

# Delete a volume when no longer needed
delete_volume {
  "volume_id": 12345
}
Firewall Management
# List all firewalls
list_firewalls

# Create a firewall for web servers
create_firewall {
  "name": "web-firewall",
  "rules": [
    {
      "direction": "in",
      "protocol": "tcp",
      "port": "80",
      "source_ips": ["0.0.0.0/0", "::/0"]
    },
    {
      "direction": "in",
      "protocol": "tcp",
      "port": "443",
      "source_ips": ["0.0.0.0/0", "::/0"]
    }
  ]
}

# Apply firewall to a server
apply_firewall_to_resources {
  "firewall_id": 12345,
  "resources": [
    {
      "type": "server",
      "server_id": 67890
    }
  ]
}
SSH Key Management
# List all SSH keys
list_ssh_keys

# Create a new SSH key
create_ssh_key {
  "name": "my-laptop",
  "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAA... user@laptop"
}

# Use the SSH key when creating a server
create_server {
  "name": "secure-server",
  "server_type": "cx11",
  "image": "ubuntu-22.04",
  "ssh_keys": [12345]
}

# Update an SSH key's name
update_ssh_key {
  "ssh_key_id": 12345,
  "name": "work-laptop"
}

# Delete an SSH key
delete_ssh_key {
  "ssh_key_id": 12345
}
Infrastructure Planning
# Explore available resources
list_server_types
list_images
list_locations

# Get specific server information
get_server {"server_id": 12345}

Available Functions

The MCP server provides the following functions:

Server Management
  • list_servers: List all servers in your Hetzner Cloud account
  • get_server: Get details about a specific server
  • create_server: Create a new server
  • delete_server: Delete a server
  • power_on: Power on a server
  • power_off: Power off a server
  • reboot: Reboot a server
Volume Management
  • list_volumes: List all volumes in your Hetzner Cloud account
  • get_volume: Get details about a specific volume
  • create_volume: Create a new volume
  • delete_volume: Delete a volume
  • attach_volume: Attach a volume to a server
  • detach_volume: Detach a volume from a server
  • resize_volume: Increase the size of a volume
Firewall Management
  • list_firewalls: List all firewalls in your Hetzner Cloud account
  • get_firewall: Get details about a specific firewall
  • create_firewall: Create a new firewall
  • update_firewall: Update firewall name or labels
  • delete_firewall: Delete a firewall
  • set_firewall_rules: Set or update firewall rules
  • apply_firewall_to_resources: Apply a firewall to servers or server groups
  • remove_firewall_from_resources: Remove a firewall from servers or server groups
SSH Key Management
  • list_ssh_keys: List all SSH keys in your Hetzner Cloud account
  • get_ssh_key: Get details about a specific SSH key
  • create_ssh_key: Create a new SSH key
  • update_ssh_key: Update SSH key name or labels
  • delete_ssh_key: Delete an SSH key
Information
  • list_images: List available OS images
  • list_server_types: List available server types
  • list_locations: List available datacenter locations

License

MIT

Questions about Hetzner

What is the Hetzner MCP server?

A Model Context Protocol (MCP) server for interacting with the Hetzner Cloud API. This server allows language models to manage Hetzner Cloud resources through structured functions. Hetzner is maintained by dkruyt on GitHub at dkruyt/mcp-hetzner, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Hetzner MCP server?

Hetzner doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (dkruyt/mcp-hetzner). Like most servers, Hetzner ends with a command or URL you paste into your AI app's MCP config.

Does Hetzner need an API key?

The registry lists no required keys for Hetzner. Check the Hetzner README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Hetzner an official MCP server?

No. Hetzner is a community server maintained by dkruyt. Community servers can be excellent; read the code and the open issues before you give Hetzner access to company data.

What license is Hetzner under?

Hetzner is released under the MIT license, according to its GitHub repository. The license covers the code of Hetzner; the service it connects to has its own terms.