@solomonneas/proxmox-mcp 0.12.0 → 0.13.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.
- package/README.md +59 -15
- package/dist/cli.js +1294 -507
- package/dist/index.js +824 -331
- package/dist/mcp-bin.js +986 -327
- package/dist/mcp-server.js +986 -327
- package/openclaw.plugin.json +1 -1
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
15
|
-
Why: your homelab lives in Proxmox, and you want an agent to inventory it, boot a guest, or trace a task without you clicking through the web UI. How it differs: a strict three-tier write gate is built into every tool, so reads are open but anything that changes state needs an explicit confirm flag, and anything destructive needs two more gates on top. <strong>Status: WIP.</strong> The tool surface and the safety model are stable, but the package is still pre-1.0. The
|
|
15
|
+
Why: your homelab lives in Proxmox, and you want an agent to inventory it, boot a guest, or trace a task without you clicking through the web UI. How it differs: a strict three-tier write gate is built into every tool, so reads are open but anything that changes state needs an explicit confirm flag, and anything destructive needs two more gates on top. <strong>Status: WIP.</strong> The tool surface and the safety model are stable, but the package is still pre-1.0. The package version is <code>0.13.1</code>.
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
|
|
31
31
|
proxmox-mcp is an open-source [Model Context Protocol](https://modelcontextprotocol.io) server for [Proxmox VE](https://www.proxmox.com/en/proxmox-virtual-environment/overview), the open-source virtualization platform. It gives an AI client (Claude Desktop, Claude Code, OpenClaw, Codex CLI, or any MCP host) a structured, gated interface to a Proxmox cluster: inventory VMs and LXC containers, inspect node and storage status, read RRD metrics, trace tasks, manage snapshots and backups, run gated reads and shell commands inside guests, and provision, clone, or destroy resources, all over Proxmox API-token auth.
|
|
32
32
|
|
|
33
|
-
It is built for homelab and virtualization operators who want to point an agent at their cluster without handing it a root shell. The differentiator is the write-safety model:
|
|
33
|
+
It is built for homelab and virtualization operators who want to point an agent at their cluster without handing it a root shell. The differentiator is the write-safety model: 102 tools split across four tiers, where reads need nothing, safe writes need `confirm: true`, and destructive operations need `confirm: true` + `destructive: true` + a process-level `PROXMOX_ENABLE_DESTRUCTIVE=1` env flag. A hallucinated or careless tool call fails closed, before any HTTP traffic reaches Proxmox.
|
|
34
34
|
|
|
35
35
|
## Proof
|
|
36
36
|
|
|
37
|
-
A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.json`) and the
|
|
37
|
+
A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.json`) and the 102 tools appear in the client. Reads work immediately; the destructive env gate stays off until you opt in.
|
|
38
38
|
|
|
39
39
|
```json
|
|
40
40
|
{
|
|
@@ -53,7 +53,7 @@ A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.
|
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
### Tool list (
|
|
56
|
+
### Tool list (102 tools: 49 Tier-1 read, 44 Tier-2 including 4 gated guest reads, and 9 Tier-3; verified against source)
|
|
57
57
|
|
|
58
58
|
Tier markers below are authoritative: each tool's gate is enforced in code (`src/gates.ts` + per-tool schema), and `WriteGateError` fires before any HTTP call when a gate is unmet.
|
|
59
59
|
|
|
@@ -89,13 +89,18 @@ Generated from [`docs/assets/workflows/proxmox-safety.json`](docs/assets/workflo
|
|
|
89
89
|
| `proxmox_list_updates` | 1 read | Pending APT updates on a node (needs a Sys.Modify token). |
|
|
90
90
|
| `proxmox_list_firewall_rules` | 1 read | Firewall rules at cluster/node/guest scope. |
|
|
91
91
|
| `proxmox_get_firewall_options` | 1 read | Firewall enable state + default policy at a scope. |
|
|
92
|
+
| `proxmox_firewall_log` | 1 read | Firewall log for a node (requires `Sys.Syslog` on `/nodes/{node}`) or guest (requires `VM.Console` on `/vms/{vmid}`). |
|
|
92
93
|
| `proxmox_list_storage_config` | 1 read | Datacenter storage definitions (id/type/content/nodes). |
|
|
93
94
|
| `proxmox_list_backup_jobs` | 1 read | Scheduled vzdump backup jobs. |
|
|
95
|
+
| `proxmox_list_unprotected_guests` | 1 read | Guests Proxmox reports not covered by any backup job; disabled jobs still count as coverage. Results include only guests the token holds `VM.Audit` on. |
|
|
94
96
|
| `proxmox_list_users` | 1 read | Access users (userid, realm, enabled state). |
|
|
95
97
|
| `proxmox_list_roles` | 1 read | Roles and their privileges. |
|
|
96
98
|
| `proxmox_list_acl` | 1 read | ACL entries: who holds which role on which path. |
|
|
97
99
|
| `proxmox_list_pools` | 1 read | All resource pools. |
|
|
98
100
|
| `proxmox_list_tokens` | 1 read | API tokens for a user. |
|
|
101
|
+
| `proxmox_list_tfa` | 1 read | TFA enrollment metadata, with secret fields omitted. |
|
|
102
|
+
| `proxmox_list_groups` | 1 read | Access groups and their user memberships. |
|
|
103
|
+
| `proxmox_list_auth_domains` | 1 read | Authentication domains and configured TFA provider. |
|
|
99
104
|
| `proxmox_cluster_status` | 1 read | Cluster membership + quorum per node. |
|
|
100
105
|
| `proxmox_ha_status` | 1 read | HA manager status: quorum, fencing, resource states. |
|
|
101
106
|
| `proxmox_list_ha_resources` | 1 read | HA-managed resources. |
|
|
@@ -106,6 +111,7 @@ Generated from [`docs/assets/workflows/proxmox-safety.json`](docs/assets/workflo
|
|
|
106
111
|
| `proxmox_list_metric_servers` | 1 read | External metrics servers (InfluxDB/Graphite). |
|
|
107
112
|
| `proxmox_get_cluster_options` | 1 read | Datacenter options (keyboard, MAC prefix, tags). |
|
|
108
113
|
| `proxmox_cluster_log` | 1 read | Recent cluster-wide log entries. |
|
|
114
|
+
| `proxmox_node_journal` | 1 read | Pre-rendered node journal text with cursor entries removed. Priority, service, and kernel filters require pve-manager 9.2.4 or later. |
|
|
109
115
|
| `proxmox_read_file` | 2 gated guest read | Read a file from inside an LXC or QEMU VM (SSH + `cat`). Requires `confirm: true`. |
|
|
110
116
|
| `proxmox_stat_path` | 2 gated guest read | Inspect guest path metadata. Requires `confirm: true`. |
|
|
111
117
|
| `proxmox_list_directory` | 2 gated guest read | List one guest directory. Requires `confirm: true`. |
|
|
@@ -126,7 +132,6 @@ Generated from [`docs/assets/workflows/proxmox-safety.json`](docs/assets/workflo
|
|
|
126
132
|
| `proxmox_update_vm_config` | 2 safe-write | Edit an existing QEMU VM config (cores/memory/net/etc, `PUT .../qemu/{vmid}/config`). Requires `confirm: true`. |
|
|
127
133
|
| `proxmox_update_container_config` | 2 safe-write | Edit an existing LXC config (cores/memory/hostname/etc, `PUT .../lxc/{vmid}/config`). Requires `confirm: true`. |
|
|
128
134
|
| `proxmox_resize_disk` | 2 safe-write | Grow a VM or container disk (`PUT .../{type}/{vmid}/resize`). Grow-only. Requires `confirm: true`. |
|
|
129
|
-
| `proxmox_restore_backup` | 2 safe-write | Restore a vzdump/PBS archive into a VMID. Overwriting an existing VMID escalates to the destructive gate. Requires `confirm: true`. |
|
|
130
135
|
| `proxmox_migrate_resource` | 2 safe-write | Migrate a VM or container to another node (`POST .../migrate`). Requires `confirm: true`. |
|
|
131
136
|
| `proxmox_suspend_resource` | 2 safe-write | Suspend/pause a running guest (QEMU can hibernate to disk). Requires `confirm: true`. |
|
|
132
137
|
| `proxmox_resume_resource` | 2 safe-write | Resume a suspended guest. Requires `confirm: true`. |
|
|
@@ -159,13 +164,16 @@ Generated from [`docs/assets/workflows/proxmox-safety.json`](docs/assets/workflo
|
|
|
159
164
|
| `proxmox_delete_volume` | 3 destructive | Permanently delete a storage volume (backup, ISO, template, disk image). |
|
|
160
165
|
| `proxmox_node_power` | 3 destructive | Reboot or shut down an entire node, taking down every guest on it. |
|
|
161
166
|
| `proxmox_delete_storage` | 3 destructive | Remove a storage definition from the datacenter config. |
|
|
167
|
+
| `proxmox_restore_backup` | 3 destructive | Restore a vzdump/PBS archive into a VMID. Overwriting an existing VMID wipes its disks and requires the destructive gate. |
|
|
162
168
|
|
|
163
|
-
**Reads (
|
|
169
|
+
**Reads (46):** open; no flags required.
|
|
164
170
|
**Gated guest reads (4):** guest file/path/directory/service inspection tools require `confirm: true` because they expose in-guest state through host-backed SSH.
|
|
165
|
-
**Safe writes (
|
|
166
|
-
**Destructive (
|
|
171
|
+
**Safe writes (40):** require `confirm: true`. The schema documents the gate on every tool. `WriteGateError` fires before any HTTP call.
|
|
172
|
+
**Destructive (9):** require `confirm: true` + `destructive: true` + env `PROXMOX_ENABLE_DESTRUCTIVE=1`. All three gates must be satisfied; if any one is missing the tool throws `WriteGateError` before resolving the resource.
|
|
167
173
|
|
|
168
|
-
|
|
174
|
+
**MCP annotations.** `tools/list` reports `readOnlyHint`, `destructiveHint` and `openWorldHint` on every tool (`true` only for `proxmox_download_url`, which fetches from a host outside the cluster, and `proxmox_exec`, whose shell command can contact any host), plus `idempotentHint` where it applies, so clients that ask a person before running a tool can do so. The annotations follow the tier with these refinements: the four gated guest reads report `readOnlyHint: true`, and the safe-write tools that execute commands, write files, stop or reset workloads, or change credentials, permissions, firewall or storage placement report `destructiveHint: true` even though their gate stays `confirm: true`. The gate arguments a call must carry are unchanged; the hint only changes how a client presents the call. The full list lives in `src/registry.ts`.
|
|
175
|
+
|
|
176
|
+
> Nine tools use the destructive gate and can delete, overwrite guest disks, hard-stop, or power off resources: `proxmox_destroy_resource`, `proxmox_cleanup_smoke_resources`, `proxmox_rollback_snapshot`, `proxmox_delete_snapshot`, `proxmox_force_stop_resource`, `proxmox_delete_volume`, `proxmox_node_power`, `proxmox_delete_storage`, and `proxmox_restore_backup`. Overwriting an existing VMID with `proxmox_restore_backup` wipes its disks. These tools are gated behind the `PROXMOX_ENABLE_DESTRUCTIVE=1` process env flag. See [SECURITY.md](SECURITY.md) and the [Safety](#safety) section.
|
|
169
177
|
|
|
170
178
|
## Quickstart
|
|
171
179
|
|
|
@@ -198,7 +206,7 @@ claude mcp add proxmox -s user -- npx -y @solomonneas/proxmox-mcp
|
|
|
198
206
|
|
|
199
207
|
Then ask your agent to list your cluster's containers. Reads work with nothing but the three credential vars; write and destructive tiers stay gated until you opt in.
|
|
200
208
|
|
|
201
|
-
> Note: the
|
|
209
|
+
> Note: the repository version is `0.13.1`. `npx` and `npm install` select the published release. This repository may track ahead between releases.
|
|
202
210
|
|
|
203
211
|
## Configuration
|
|
204
212
|
|
|
@@ -209,22 +217,28 @@ PROXMOX_URL=https://192.0.2.10:8006
|
|
|
209
217
|
PROXMOX_TOKEN_ID=pve-admin@pam!api-token-1
|
|
210
218
|
PROXMOX_TOKEN_SECRET=REPLACE_WITH_TOKEN_SECRET
|
|
211
219
|
|
|
220
|
+
# Optional: maximum duration for each Proxmox API request, including its response body.
|
|
221
|
+
# Defaults to 30000 ms; accepted range is 1000 to 300000 ms.
|
|
222
|
+
PROXMOX_REQUEST_TIMEOUT_MS=30000
|
|
223
|
+
|
|
212
224
|
# Optional: skip TLS cert validation (homelab self-signed certs).
|
|
213
225
|
# Accepts true/1/yes (case-insensitive). Defaults to false.
|
|
214
226
|
PROXMOX_TLS_INSECURE=false
|
|
215
227
|
|
|
216
|
-
# Optional (experimental): load tools on demand instead of listing all
|
|
228
|
+
# Optional (experimental): load tools on demand instead of listing all 102.
|
|
217
229
|
# Accepts true/1/yes (case-insensitive). Defaults to false. See "Deferred tool loading".
|
|
218
230
|
PROXMOX_DEFERRED_TOOLS=false
|
|
219
231
|
```
|
|
220
232
|
|
|
221
233
|
`PROXMOX_TOKEN_SECRET` is the UUID Proxmox shows exactly once when you create the API token; it cannot be read back afterwards. Every example here uses a literal `REPLACE_WITH_TOKEN_SECRET` placeholder rather than a UUID-shaped dummy, so copying a snippet into your own repo will not trip a secret scanner.
|
|
222
234
|
|
|
235
|
+
Each Proxmox API request is bounded by `PROXMOX_REQUEST_TIMEOUT_MS`, including response-body reads. Timed-out GET requests receive the usual single retry. A timed-out write reports an unknown outcome; check `proxmox_recent_tasks` before retrying it.
|
|
236
|
+
|
|
223
237
|
Trailing slashes on `PROXMOX_URL` are stripped. The token secret is registered with the redactor on startup and masked from all log + error output.
|
|
224
238
|
|
|
225
239
|
### Deferred tool loading (experimental)
|
|
226
240
|
|
|
227
|
-
|
|
241
|
+
102 tool schemas cost roughly 17k tokens of context in every request, whether or not the agent needs a single one of them. Set `PROXMOX_DEFERRED_TOOLS=1` and the server instead starts with one tool, `proxmox_search_tools`. The agent describes its task, gets back matching tool descriptors, and those tools are added to that connection's tool list; the server emits `notifications/tools/list_changed`, the client re-reads the list, and the agent calls the tool it wants with its own real schema. Measured on a live connection, the visible `tools/list` payload drops from 68,495 bytes to 1,400, a 98% reduction.
|
|
228
242
|
|
|
229
243
|
Requirements and caveats:
|
|
230
244
|
|
|
@@ -254,6 +268,7 @@ The `proxmox_exec`, `proxmox_read_file`, and `proxmox_write_file` tools SSH to t
|
|
|
254
268
|
| `PROXMOX_VM_SSH_USER` | falls through to `PROXMOX_SSH_USER` | Default user for direct VM SSH |
|
|
255
269
|
| `PROXMOX_VM_SSH_KEY` | falls through to `PROXMOX_SSH_KEY` | Default key for direct VM SSH |
|
|
256
270
|
| `PROXMOX_SSH_MAX_OUTPUT_BYTES` | `1048576` | Max stdout bytes and max stderr bytes captured per SSH command |
|
|
271
|
+
| `PROXMOX_MAX_RESULT_BYTES` | `100000` | Max size of one tool result returned to the client (minimum `2048`). Larger results are replaced by a JSON envelope with `truncated: true` and a preview. |
|
|
257
272
|
| `PROXMOX_EXEC_BACKEND` | `ssh` | QEMU exec backend: `ssh` (direct SSH to the VM) or `guest-agent` (qemu-guest-agent API, no in-guest SSH key needed). LXC always uses `pct exec` over host SSH. |
|
|
258
273
|
|
|
259
274
|
Per-VM overrides (read at execute time, no MCP restart needed):
|
|
@@ -272,7 +287,7 @@ Provisioning and disk operations (`proxmox_create_container`, `proxmox_create_vm
|
|
|
272
287
|
|
|
273
288
|
## CLI
|
|
274
289
|
|
|
275
|
-
The same package ships a read-only **control CLI**, `proxmoxctl` (alias `proxops`), for shells, cron, and CI. It shares the `ProxmoxClient` core with the MCP server and reads the same env config (`PROXMOX_URL`, `PROXMOX_TOKEN_ID`, `PROXMOX_TOKEN_SECRET`, `PROXMOX_TLS_INSECURE`). It exposes only read/inventory/audit operations; every lifecycle, snapshot, backup, and exec action stays in the MCP/plugin surface behind the safety gates.
|
|
290
|
+
The same package ships a read-only **control CLI**, `proxmoxctl` (alias `proxops`), for shells, cron, and CI. It shares the `ProxmoxClient` core with the MCP server and reads the same env config (`PROXMOX_URL`, `PROXMOX_TOKEN_ID`, `PROXMOX_TOKEN_SECRET`, `PROXMOX_TLS_INSECURE`, `PROXMOX_REQUEST_TIMEOUT_MS`). It exposes only read/inventory/audit operations; every lifecycle, snapshot, backup, and exec action stays in the MCP/plugin surface behind the safety gates.
|
|
276
291
|
|
|
277
292
|
```bash
|
|
278
293
|
npx @solomonneas/proxmox-mcp@latest status
|
|
@@ -291,10 +306,39 @@ proxmoxctl snapshots list 100
|
|
|
291
306
|
proxmoxctl audit-permissions
|
|
292
307
|
proxmoxctl recent-tasks --limit 20
|
|
293
308
|
proxmoxctl task status UPID:pve:...
|
|
309
|
+
proxmoxctl storage config
|
|
310
|
+
proxmoxctl backup-jobs list
|
|
311
|
+
proxmoxctl unprotected-guests
|
|
312
|
+
proxmoxctl users list
|
|
313
|
+
proxmoxctl roles list
|
|
314
|
+
proxmoxctl acl list
|
|
315
|
+
proxmoxctl pools list
|
|
316
|
+
proxmoxctl tokens list operator@pve
|
|
317
|
+
proxmoxctl tfa list operator@pve
|
|
318
|
+
proxmoxctl groups list
|
|
319
|
+
proxmoxctl auth domains
|
|
320
|
+
proxmoxctl cluster status
|
|
321
|
+
proxmoxctl ha status
|
|
322
|
+
proxmoxctl ha resources
|
|
323
|
+
proxmoxctl ha rules
|
|
324
|
+
proxmoxctl replication list
|
|
325
|
+
proxmoxctl sdn zones
|
|
326
|
+
proxmoxctl sdn vnets
|
|
327
|
+
proxmoxctl metrics servers
|
|
328
|
+
proxmoxctl cluster options
|
|
329
|
+
proxmoxctl cluster log --max=50
|
|
330
|
+
proxmoxctl node journal --node pve
|
|
331
|
+
proxmoxctl firewall log --scope node --node pve
|
|
294
332
|
proxmoxctl vms list --json # raw JSON for piping
|
|
295
333
|
```
|
|
296
334
|
|
|
297
|
-
|
|
335
|
+
All 49 Tier-1 reads have a CLI decision: 47 commands, with `proxmox_wait_task` (use task status/log in scripts) and `proxmox_validate_qemu_smoke_source` (smoke-provisioning preflight) explicitly exempt. An inventory parity test enforces coverage and rejects mutating mappings.
|
|
336
|
+
|
|
337
|
+
Run `proxmoxctl help` for the full command list. `--json` emits JSON instead of the concise summary. TFA, group, and authentication-domain output retains the MCP `<untrusted-data>` wrapper and escaped closing tags in both modes; treat the contents as data, never instructions. These access commands use the same allowlists and sanitized upstream errors as MCP. CLI results and errors use the MCP redaction and output limit (100,000 bytes by default). Larger results return a JSON truncation envelope.
|
|
338
|
+
|
|
339
|
+
Use `--` before a positional value that begins with a dash, for example `proxmoxctl tfa list -- --operator@pve`. Cluster log accepts `--max N` and `--max=N`, with an integer from 1 to 1000 and a default of 50.
|
|
340
|
+
|
|
341
|
+
Exit code `0` means success, and `2` means a usage error such as an unknown flag or invalid log limit. Exit code `1` covers runtime errors or missing health evidence. It also covers an offline node for `status` or `cluster status`, lost quorum for `cluster status` or `ha status`, and resource errors for `ha status`.
|
|
298
342
|
|
|
299
343
|
### Starting the MCP server
|
|
300
344
|
|
|
@@ -481,7 +525,7 @@ This MCP uses a three-tier write-gating model. The tier is enforced in code, not
|
|
|
481
525
|
|
|
482
526
|
### Destructive operations env gate
|
|
483
527
|
|
|
484
|
-
Tier 3 destructive tools (`proxmox_destroy_resource`, `proxmox_cleanup_smoke_resources`, `proxmox_rollback_snapshot`, `proxmox_delete_snapshot`, `proxmox_force_stop_resource`, `proxmox_delete_volume`, `proxmox_node_power`, `proxmox_delete_storage`) require an additional safety gate beyond the per-tool `confirm: true` + `destructive: true` args: the env var `PROXMOX_ENABLE_DESTRUCTIVE=1` must be set on the MCP process. Without it, the tools throw `WriteGateError` before any HTTP call is made. `proxmox_cleanup_smoke_resources` defaults to `dry_run: true`, which previews targets without the destructive env gate.
|
|
528
|
+
Tier 3 destructive tools (`proxmox_destroy_resource`, `proxmox_cleanup_smoke_resources`, `proxmox_rollback_snapshot`, `proxmox_delete_snapshot`, `proxmox_force_stop_resource`, `proxmox_delete_volume`, `proxmox_node_power`, `proxmox_delete_storage`, and `proxmox_restore_backup` when it overwrites an existing VMID) require an additional safety gate beyond the per-tool `confirm: true` + `destructive: true` args: the env var `PROXMOX_ENABLE_DESTRUCTIVE=1` must be set on the MCP process. Without it, the tools throw `WriteGateError` before any HTTP call is made. `proxmox_cleanup_smoke_resources` defaults to `dry_run: true`, which previews targets without the destructive env gate.
|
|
485
529
|
|
|
486
530
|
This is intentional: destructive ops are rare. The env flag is a coarse "I am actively doing smoke-test cycles" toggle. Leave it unset day to day; flip it only when actively destroying resources is part of the workflow.
|
|
487
531
|
|