Hetzner 云 MCP 服务器
用于与 Hetzner Cloud API 交互的模型上下文协议 (MCP) 服务器。该服务器允许语言模型通过结构化函数管理 Hetzner Cloud 资源。
特征
- 列出、创建和管理 Hetzner Cloud 服务器
- 创建、附加、分离和调整卷大小
- 管理防火墙规则并将其应用于服务器
- 创建和管理 SSH 密钥以实现安全的服务器访问
- 查看可用的图像、服务器类型和位置
- 打开/关闭和重启服务器
- 用于语言模型交互的简单、结构化的 API
- Claude Code 集成,可直接从 Claude 管理 Hetzner 资源
要求
- Python 3.11+
- Hetzner 云 API 令牌
安装
方法一:直接安装
- 克隆此存储库:
- 安装依赖项:
- 创建一个
.env
文件并添加您的 Hetzner Cloud API 令牌:
方法 2:作为包安装
作为包安装后,使用您的 Hetzner Cloud API 令牌在您的工作目录中创建一个.env
文件。
用法
启动服务器
选项 1:运行已安装的包:
选项 2:作为模块运行:
服务器支持两种传输模式:
stdio
(默认):标准 I/O 传输,通常与 Claude 代码一起使用sse
:服务器发送事件传输,适用于 HTTP 客户端
默认情况下,服务器在localhost:8080
上运行。您可以通过以下方式自定义主机和端口:
- 在
.env
文件中设置MCP_HOST
和MCP_PORT
环境变量 - 使用
--port
命令行参数(覆盖环境变量)
与 Claude 代码一起使用
要与 Claude Code 一起使用,请使用 SSE 传输运行服务器:
测试 API
包含一个测试客户端来验证服务器功能:
示例工作流程
基本服务器管理
卷管理
防火墙管理
SSH 密钥管理
基础设施规划
可用函数
MCP服务器提供以下功能:
服务器管理
list_servers
:列出您的 Hetzner Cloud 帐户中的所有服务器get_server
:获取有关特定服务器的详细信息create_server
:创建一个新服务器delete_server
:删除服务器power_on
:启动服务器power_off
:关闭服务器reboot
:重启服务器
卷管理
list_volumes
:列出您的 Hetzner Cloud 帐户中的所有卷get_volume
:获取有关特定卷的详细信息create_volume
:创建新卷delete_volume
:删除卷attach_volume
:将卷附加到服务器detach_volume
:从服务器分离卷resize_volume
:增加卷的大小
防火墙管理
list_firewalls
:列出您的 Hetzner Cloud 帐户中的所有防火墙get_firewall
:获取有关特定防火墙的详细信息create_firewall
:创建新的防火墙update_firewall
:更新防火墙名称或标签delete_firewall
:删除防火墙set_firewall_rules
:设置或更新防火墙规则apply_firewall_to_resources
:将防火墙应用于服务器或服务器组remove_firewall_from_resources
:从服务器或服务器组中删除防火墙
SSH 密钥管理
list_ssh_keys
:列出 Hetzner Cloud 帐户中的所有 SSH 密钥get_ssh_key
:获取有关特定 SSH 密钥的详细信息create_ssh_key
:创建一个新的 SSH 密钥update_ssh_key
:更新 SSH 密钥名称或标签delete_ssh_key
:删除 SSH 密钥
信息
list_images
:列出可用的操作系统映像list_server_types
:列出可用的服务器类型list_locations
:列出可用的数据中心位置
执照
麻省理工学院
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
模型上下文协议服务器允许语言模型通过结构化功能管理 Hetzner Cloud 资源,包括服务器、卷、防火墙和 SSH 密钥。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.Last updated -121PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that provides file system operations, analysis, and manipulation capabilities through a standardized tool interface.Last updated -4TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables large language models to interact with Linear's issue tracking system, allowing management of issues, projects, teams, and other Linear resources.Last updated -554TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that provides tools for interacting with Docker images, containers, and registries, enabling AI assistants to search, analyze, and manage Docker resources through a standardized interface.Last updated -PythonMIT License