Hetzner Cloud

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.
  • python

78

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "dkruyt-mcp-hetzner": {
      "command": "mcp-hetzner",
      "args": [
        "--transport",
        "sse",
        "--port",
        "8000"
      ],
      "env": {
        "MCP_HOST": "localhost",
        "MCP_PORT": "8000",
        "HCLOUD_TOKEN": "your_token_here"
      }
    }
  }
}

You can manage Hetzner Cloud resources programmatically with this MCP server. It exposes structured actions to list, create, modify, and delete servers, volumes, firewalls, SSH keys, and more, enabling precise control from your language model or automation workflows.

How to use

Connect to the MCP server using a client that understands the MCP protocol. Use the available functions to perform common tasks like listing servers, creating new instances, attaching volumes, managing firewall rules, and configuring SSH access. You can run the server locally or host it remotely and interact with it through the provided transport options.

How to install

Prerequisites: Python 3.11+ and a Hetzner Cloud API token.

# Method 1: Direct installation
git clone https://github.com/dkruyt/mcp-hetzner.git
cd mcp-hetzner
pip install -e .
# Create environment for API token
HCLOUD_TOKEN=your_hetzner_cloud_api_token_here

Option 2 installs as a package directly from the repository. After installation, create your API token file in the working directory.

# Method 2: Install as a Package
pip install git+https://github.com/dkruyt/mcp-hetzner.git

Next, place your Hetzner Cloud API token in a file named ".env" in your working directory with the following content.

HCLOUD_TOKEN=your_hetzner_cloud_api_token_here

Additional setup and usage notes

Start the MCP server to begin interacting with Hetzner Cloud resources. You have two primary options for running the server locally.

# Using the installed package (default stdio transport)
mcp-hetzner

# Using the SSE transport
mcp-hetzner --transport sse

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

Alternatively, run the server as a Python module.

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

Claude Code integration

If you want Claude Code to connect to your MCP server, start the server with SSE transport and then connect Claude Code to the endpoint.

# 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 lightweight test client is provided to verify basic MCP interactions.

python -m mcp_hetzner.client

Available tools

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

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

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

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

list_images

List available OS images

list_server_types

List available server types

list_locations

List available datacenter locations

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational