hcloud-mcp 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +43 -19
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Hcloud MCP server](https://mcprush.com/badge/hcloud-mcp/card.svg)](https://mcprush.com/to/hcloud-mcp?ref=badge)
4
4
 
5
- Standalone **MCP (Model Context Protocol) server** for the [Hetzner Cloud API](https://docs.hetzner.cloud/). Use it with any MCP client: Cursor, Claude Desktop, CLI tools, [smithery.ai](https://smithery.ai), or custom agents.
5
+ Standalone **MCP (Model Context Protocol) server** for the [Hetzner Cloud API](https://docs.hetzner.cloud/): servers, networking, load balancers, volumes, DNS, certificates, snapshots and Storage Boxes. It has 162 tools, and every tool tells the client whether it is read-only or destructive. Use it with any MCP client: Cursor, Claude Desktop, Claude Code, CLI tools, [smithery.ai](https://smithery.ai), or custom agents.
6
6
 
7
7
  - **Repository:** [github.com/Xodus-CO/hcloud-mcp](https://github.com/Xodus-CO/hcloud-mcp)
8
8
  - **Hetzner Cloud:** [Get started](https://hetzner.cloud/?ref=IAYKetqPnlq9) — new signups get €20 credit.
@@ -12,7 +12,9 @@ Standalone **MCP (Model Context Protocol) server** for the [Hetzner Cloud API](h
12
12
  ## Requirements
13
13
 
14
14
  - Node.js 18+
15
- - A Hetzner Cloud API token. [Generate one](https://docs.hetzner.com/cloud/api/getting-started/generating-api-token) in the console (project → Security → API Tokens). Set it as `HCLOUD_TOKEN` in the environment or in your MCP client config.
15
+ - A Hetzner Cloud API token. [Generate one](https://docs.hetzner.com/cloud/api/getting-started/generating-api-token) in the console (project → Security → API Tokens). Set it as `HCLOUD_TOKEN` in the environment or in your MCP client config. A token gives access to the whole project. If the agent only needs to look things up, create a **Read** token instead of Read & Write.
16
+
17
+ The server runs locally over stdio. Your token is only sent to Hetzner: `api.hetzner.cloud` for Cloud and DNS (DNS is part of the Cloud API), and `api.hetzner.com` for Storage Boxes. The legacy DNS Console API at `dns.hetzner.com` is not used.
16
18
 
17
19
  ## Installation
18
20
 
@@ -44,7 +46,7 @@ Add the server to your MCP client config. It uses MCP over **stdio** and require
44
46
  "mcpServers": {
45
47
  "hetzner-cloud": {
46
48
  "command": "npx",
47
- "args": ["hcloud-mcp"],
49
+ "args": ["-y", "hcloud-mcp@latest"],
48
50
  "env": {
49
51
  "HCLOUD_TOKEN": "your_hetzner_cloud_api_token"
50
52
  }
@@ -69,7 +71,7 @@ The server exposes Hetzner Cloud API operations as MCP tools:
69
71
  | Area | Tools |
70
72
  | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
73
  | **Servers** | `list_servers`, `get_server`, `create_server`, `delete_server`, `update_server`, `change_server_type`; power: `power_on_server`, `power_off_server`, `reboot_server`, `shutdown_server`, `reset_server`; `attach_iso`, `detach_iso`; `attach_server_to_network`, `detach_server_from_network`; `rebuild_server`; reverse DNS: `change_dns_ptr` (also Primary/Floating IPs, LBs) |
72
- | **Load Balancers** | `list_load_balancers`, `get_load_balancer`, `create_load_balancer`, `update_load_balancer`, `delete_load_balancer`; `add_load_balancer_target`, `remove_load_balancer_target`; `add_load_balancer_service`, `update_load_balancer_service`, `delete_load_balancer_service`; `list_load_balancer_types` (`http.timeout_idle` on update) |
74
+ | **Load Balancers** | `list_load_balancers`, `get_load_balancer`, `create_load_balancer`, `update_load_balancer`, `delete_load_balancer`; `add_load_balancer_target`, `remove_load_balancer_target`; `add_load_balancer_service`, `update_load_balancer_service`, `delete_load_balancer_service`; `list_load_balancer_types`. `create_load_balancer` can set an existing Primary IP (`public_net`), a private network, services and targets in one call. `update_load_balancer_service` supports `http.timeout_idle` |
73
75
  | **Networks** | `list_networks`, `get_network`, `create_network`, `update_network`, `delete_network`; `add_network_subnet`, `delete_network_subnet`; `list_network_members` |
74
76
  | **Volumes** | `list_volumes`, `get_volume`, `create_volume`, `update_volume`, `delete_volume`; `attach_volume`, `detach_volume` |
75
77
  | **Firewalls** | `list_firewalls`, `get_firewall`, `create_firewall`, `update_firewall`, `delete_firewall`; `apply_firewall_to_resources`, `remove_firewall_from_resources`, `set_firewall_rules` |
@@ -91,7 +93,7 @@ The server exposes Hetzner Cloud API operations as MCP tools:
91
93
 
92
94
  ### Limiting tools (`HCLOUD_TOOLSETS`)
93
95
 
94
- The server exposes about 160 tools. Some MCP clients cap the total number of tools, or slow down with very many. Set `HCLOUD_TOOLSETS` to load only the groups you need. The `core` group is always loaded.
96
+ The server exposes 162 tools. Some MCP clients cap the total number of tools, or slow down with very many. Set `HCLOUD_TOOLSETS` to load only the groups you need. The `core` group is always loaded.
95
97
 
96
98
  | Toolset | Contents |
97
99
  |---|---|
@@ -102,7 +104,19 @@ The server exposes about 160 tools. Some MCP clients cap the total number of too
102
104
  | `certificates` | TLS certificates |
103
105
  | `storage_boxes` | Storage Boxes, subaccounts, snapshots |
104
106
 
105
- Example: `"env": { "HCLOUD_TOKEN": "...", "HCLOUD_TOOLSETS": "dns,images" }`. If you leave it unset, or set it to `all`, everything loads.
107
+ Example: `"env": { "HCLOUD_TOKEN": "...", "HCLOUD_TOOLSETS": "dns,images" }`. If you leave it unset, or set it to `all`, everything loads. `core` alone is 91 tools; `core` plus `dns` is 112.
108
+
109
+ ### Tool annotations
110
+
111
+ Every tool declares MCP [tool annotations](https://modelcontextprotocol.io/specification/2025-06-18/server/tools#tool-annotations), which clients can use to decide when to ask for confirmation:
112
+
113
+ | Annotation | Tools | Examples |
114
+ |---|---|---|
115
+ | `readOnlyHint` | 46 | Every `list_*`, `get_*` and `export_*` tool |
116
+ | `destructiveHint` | 57 | Deletes, `rebuild_server`, `power_off_server`, `import_zonefile`, `rollback_storage_box_snapshot`, `disable_server_backups` |
117
+ | `idempotentHint` | 92 | Changes that are safe to repeat, such as deletes, `power_off_server`, `set_firewall_rules` and `set_rrset_records` |
118
+
119
+ All tools also set `openWorldHint`, because they call an external API. These are hints, not guarantees. Keep confirmation turned on for destructive tools.
106
120
 
107
121
  ### Server instructions and agent skill
108
122
 
@@ -121,20 +135,27 @@ The skill is also included in the npm package.
121
135
 
122
136
  ## API compatibility
123
137
 
124
- Updated in 0.2.0 for Hetzner Cloud API changes through November 2026 ([changelog](https://docs.hetzner.cloud/changelog)):
138
+ The tools follow the Hetzner API as of November 2026 ([Hetzner changelog](https://docs.hetzner.cloud/changelog)):
125
139
 
126
- - `list_datacenters` is **removed**, because the endpoint now returns 410 Gone. Use `list_locations`.
127
- - `create_server` no longer accepts `datacenter`, because the API removed it on 2026-07-01. Use `location`.
128
- - `create_primary_ip` takes `location` instead of `datacenter`.
129
- - `delete_load_balancer` now returns the deletion Action.
130
- - `add_network_subnet` no longer offers the deprecated `server` type. Use `cloud`.
131
- - **0.3.1:** `create_volume` and `attach_volume` send `assignee: {type: "server", id}` instead of the deprecated `server` field, which the API removes on 2027-10-27. Tool inputs are unchanged. Read `assignee` in volume responses.
132
- - List tools now return every page. Previously they silently stopped at the first 25 items.
133
- - Floating IPs and Primary IPs must be unassigned before you delete them.
134
- - `list_actions` requires `id`, because Hetzner removed project-wide action listing. Use `get_action` to poll.
140
+ - **Locations, not datacenters.** `list_datacenters` is gone, because the endpoint returns 410 Gone. `create_server` and `create_primary_ip` take `location`.
141
+ - **Volumes:** `create_volume` and `attach_volume` send `assignee: {type: "server", id}`, because Hetzner removes the old `server` field on 2027-10-27. Read `assignee` in volume responses.
142
+ - **List tools return every page**, not just the first 25 items.
143
+ - **`list_actions` requires `id`**, because Hetzner removed project-wide action listing. Use `get_action` to poll an Action.
144
+ - **Unassign before deleting.** Floating IPs and Primary IPs must be unassigned before you delete them.
145
+ - **Errors** come back as `code (status): message`, for example `not_found (404): server not found`.
135
146
 
136
147
  Hetzner Robot (dedicated servers) is not covered yet; see [#21](https://github.com/Xodus-CO/hcloud-mcp/issues/21).
137
148
 
149
+ ## Changelog
150
+
151
+ See [GitHub Releases](https://github.com/Xodus-CO/hcloud-mcp/releases) for full notes.
152
+
153
+ - **0.4.1:** README update only (no code changes).
154
+ - **0.4.0:** Removed the Hetzner SDK dependency; every tool now calls the API through one small fetch client. Every tool declares MCP annotations. `create_load_balancer` accepts an existing Primary IP, a network, services and targets.
155
+ - **0.3.1:** Volumes use `assignee`. CI added. (Not published to npm separately; included in 0.4.0.)
156
+ - **0.3.0:** Added DNS, Storage Boxes, certificates, snapshots and backups, rescue and console, metrics, and the remaining server, network and load balancer actions. Added `HCLOUD_TOOLSETS`.
157
+ - **0.2.0:** Updated for 2026 Hetzner API changes (above). Added server instructions and the `hetzner-cloud` skill.
158
+
138
159
  ## Usage examples
139
160
 
140
161
  With the MCP client connected, you can ask the agent to run tools using natural language.
@@ -156,18 +177,21 @@ With the MCP client connected, you can ask the agent to run tools using natural
156
177
 
157
178
  - _Create a private network 10.0.0.0/16 in eu-central, add a subnet, then create two servers in that zone (e.g. fsn1 and nbg1) and attach them_
158
179
  - _Create a firewall for SSH and HTTP, attach to my web servers, then create a load balancer and add those servers as targets_
159
- - _Get status of action 12345_
160
180
  - _Create a Primary IP in ash, power off web-01, assign the IP, power back on_
161
181
  - _Create a 20GB volume and a small server in nbg1, attach the volume to the server, and show me the device path_
162
182
  - _Power off server 12345, change its type to cpx31, then power it back on_
163
183
  - _Add server web-02 as a target to my load balancer prod-lb_
184
+ - _Create a Primary IP in fsn1 and a load balancer that uses it, then add web-01 and web-02 as targets on port 80_
185
+ - _Snapshot web-01 before I rebuild it with Debian 12_
186
+ - _Create a Storage Box subaccount for backups with its own password and SSH access only_
164
187
  - _Tear down: detach/delete volumes, delete LB and firewall, unassign/delete floating IPs, delete servers web-01 and web-02_
165
188
 
166
189
  ## Development
167
190
 
168
191
  | File | Purpose |
169
192
  | ----------------------- | ----------------------------------------------------------- |
170
- | `src/index.ts` | Entry point, stdio transport, `HCLOUD_TOKEN` check |
193
+ | `src/index.ts` | Entry point, stdio transport, `HCLOUD_TOKEN` check, `HCLOUD_TOOLSETS` |
194
+ | `src/tool-helpers.ts` | Shared helpers: annotation presets, pagination (`listAll`), error formatting |
171
195
  | `src/register-tools.ts` | Core tools: servers, LBs, networks, volumes, firewalls, IPs, SSH keys, info |
172
196
  | `src/extra-tools.ts` | Newer Cloud API endpoints (reverse DNS, rebuild, network members) |
173
197
  | `src/dns-tools.ts` | DNS zone/RRSet tools |
@@ -186,7 +210,7 @@ With the MCP client connected, you can ask the agent to run tools using natural
186
210
  npm run build # compile
187
211
  npm run start # run (requires HCLOUD_TOKEN)
188
212
  npm run dev # watch and recompile
189
- npm run test:smoke # offline: server starts, tools register, toolsets work (runs in CI)
213
+ npm run test:smoke # offline: server starts, 162 tools register with annotations, toolsets work (runs in CI)
190
214
  npm run test:api # read-only checks of the API client: pagination, error format (requires HCLOUD_TOKEN, run build first)
191
215
  npm run test:mcp # integration test: MCP client calls list_locations (requires HCLOUD_TOKEN)
192
216
  npm run test:live:dns # DNS create→teardown on a throwaway zone (free)
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ if (!process.env.HCLOUD_TOKEN) {
22
22
  console.error("Error: HCLOUD_TOKEN environment variable is required");
23
23
  process.exit(1);
24
24
  }
25
- const server = new McpServer({ name: "hetzner-cloud", version: "0.4.0" }, { capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS });
25
+ const server = new McpServer({ name: "hetzner-cloud", version: "0.4.1" }, { capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS });
26
26
  // Tool groups. HCLOUD_TOOLSETS (comma-separated) limits which load, for clients with
27
27
  // tool-count limits; default is all. "core" is always loaded.
28
28
  const TOOLSETS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Standalone MCP server for Hetzner Cloud API — use with Cursor, Claude Desktop, CLI, or any MCP client",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",