Disclaimer: This project is not affiliated with or endorsed by Hetzner. The Hetzner logo is used solely to visually associate this repository with Hetzner Cloud services.
A next-generation Model Context Protocol (MCP) server for Hetzner Cloud, providing seamless, programmatic access to the entire Hetzner API via the official hcloud-python SDK.
call_hetzner
: Run any SDK call as a string, with robust error handling and structured results.hetzner_help
: Instantly discover all available SDK resources, methods, signatures, and documentation—perfect for LLMs, agents, and power users.echo
: Simple echo for connectivity and round-trip testing.mcp_health
: Health check endpoint for automation and monitoring.call_hetzner
tool, due to limitations of the Hetzner SDK and the need for full SDK flexibility. Any code using the client
object can be executed, including list comprehensions, attribute access, and more..env
or environment variable..env
file and API token..env
File cp .env.example .env
.env
and paste your Hetzner API token:
HETZNER_API_TOKEN=your_hetzner_api_token_here
Never commit your real
.env
file to version control!
Need a token? See the Hetzner docs:
👉 How to generate your Hetzner API Token
To enable agent/LLM workflows in VS Code:
.vscode
folder in your workspace if it doesn’t exist..vscode/mcp.json
and add the following configuration:{
"servers": {
"hetzner-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}/.env:/app/.env:ro",
"betancourtosmar/hetzner-mcp"
]
}
}
}
This will allow you to launch the MCP server with your credentials for agent-driven workflows.
pip install -r requirements.txt
.env
file is present and contains your Hetzner API token. python src/main.py
Tool | Description |
---|---|
call_hetzner |
Execute any Hetzner SDK call as a string, e.g. client.servers.get_all() |
hetzner_help |
List all SDK resources, methods, signatures, and docstrings for full discoverability |
echo |
Echo back any text (for testing) |
mcp_health |
Health check endpoint |
List all servers:
call_hetzner("client.servers.get_all()")
Create a server:
call_hetzner("client.servers.create(name='my-server', server_type='cx11', image='ubuntu-20.04')")
Delete a server:
call_hetzner("client.servers.delete(server)")
List all images:
call_hetzner("client.images.get_all()")
Discover all possible actions:
hetzner_help()
Q: Can I run this MCP outside Docker?
A: You can, but it is strongly discouraged. Running outside Docker gives the agent/LLM a wildcard to execute any Python code on your real machine—just like agentic Copilot or Cursor. The main difference is that the MCP provides explicit instructions and helpers for the Hetzner SDK, making it easier for the LLM to automate cloud operations. For safety, always use Docker or another isolated environment.
Q: What is the value of the MCP tools?
A: The MCP tools (like call_hetzner
and hetzner_help
) provide structured, discoverable interfaces and documentation for the Hetzner SDK. This abstracts the SDK logic from the user and makes it much easier for LLMs and agents to use the full power of Hetzner Cloud without manual setup or research.
This project is licensed under the MIT License. See LICENSE for details.
For questions, feedback, or support, contact: oaba.dev@gmail.com
Made with ❤️ for Hetzner Cloud automation.
Ready for the future of cloud operations.
The best part: This MCP always uses the latest version of the Hetzner Python SDK.
Every new feature released by Hetzner is instantly available here—no manual updates required!