@solomonneas/proxmox-mcp 0.5.1 → 0.12.0

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 CHANGED
@@ -2,14 +2,17 @@
2
2
  <img src="docs/assets/proxmox-mcp-social-preview.jpg" alt="proxmox-mcp banner" width="900">
3
3
  </p>
4
4
 
5
+ <p align="center">
6
+ <a href="https://lidless.dev"><img src="docs/assets/marks/proxmox-mcp-circle.png" width="48" alt="Lidless Labs"></a>
7
+ </p>
5
8
  <h1 align="center">proxmox-mcp</h1>
6
9
 
7
10
  <p align="center">
8
- <strong>A Proxmox VE operator CLI and MCP adapter for reading and safely operating clusters, VMs, containers, and nodes over plain API-token auth.</strong>
11
+ <strong>An MCP server that lets an AI client read and operate a Proxmox VE cluster, VMs, containers, and nodes, over plain API-token auth.</strong>
9
12
  </p>
10
13
 
11
14
  <p align="center">
12
- 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 and the latest published release is <code>0.3.0</code>.
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 latest release is <code>0.12.0</code>.
13
16
  </p>
14
17
 
15
18
  <p align="center">
@@ -25,13 +28,13 @@
25
28
 
26
29
  ## What it does
27
30
 
28
- proxmoxctrl is an open-source operator CLI for [Proxmox VE](https://www.proxmox.com/en/proxmox-virtual-environment/overview), the open-source virtualization platform. The same package ships `proxmox-mcp`, a [Model Context Protocol](https://modelcontextprotocol.io) adapter for AI clients (Claude Desktop, Claude Code, OpenClaw, Codex CLI, or any MCP host). Together they provide 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.
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.
29
32
 
30
- 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: 42 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.
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: 96 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.
31
34
 
32
35
  ## Proof
33
36
 
34
- A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.json`) and the 42 tools appear in the client. Reads work immediately; the destructive env gate stays off until you opt in.
37
+ A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.json`) and the 96 tools appear in the client. Reads work immediately; the destructive env gate stays off until you opt in.
35
38
 
36
39
  ```json
37
40
  {
@@ -42,7 +45,7 @@ A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.
42
45
  "env": {
43
46
  "PROXMOX_URL": "https://192.0.2.10:8006",
44
47
  "PROXMOX_TOKEN_ID": "pve-admin@pam!api-token-1",
45
- "PROXMOX_TOKEN_SECRET": "00000000-0000-0000-0000-000000000000",
48
+ "PROXMOX_TOKEN_SECRET": "REPLACE_WITH_TOKEN_SECRET",
46
49
  "PROXMOX_TLS_INSECURE": "false"
47
50
  }
48
51
  }
@@ -50,10 +53,14 @@ A real MCP client config. Drop this into Claude Desktop (`claude_desktop_config.
50
53
  }
51
54
  ```
52
55
 
53
- ### Tool list (42 tools, verified against source)
56
+ ### Tool list (96 tools, verified against source)
54
57
 
55
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.
56
59
 
60
+ ![proxmox-mcp safety workflow: read tools inventory the cluster and trace tasks, guest reads require confirmation, safe writes stay gated, and destructive tools need the full three-part gate](docs/assets/proxmox-safety-workflow.svg)
61
+
62
+ Generated from [`docs/assets/workflows/proxmox-safety.json`](docs/assets/workflows/proxmox-safety.json) with `lidless workflow`.
63
+
57
64
  | Tool | Tier | Notes |
58
65
  | --- | --- | --- |
59
66
  | `proxmox_status` | 1 read | Cluster + node status. |
@@ -76,6 +83,29 @@ Tier markers below are authoritative: each tool's gate is enforced in code (`src
76
83
  | `proxmox_list_pool_resources` | 1 read | Inspect resources assigned to a Proxmox pool, defaulting to `mcp-smoke`. |
77
84
  | `proxmox_get_task_status` | 1 read | Single UPID status lookup. |
78
85
  | `proxmox_get_task_log` | 1 read | Task log tail for a UPID. |
86
+ | `proxmox_list_storage_content` | 1 read | List volumes on a storage: ISOs, templates, disk images, backups. |
87
+ | `proxmox_list_node_services` | 1 read | Host systemd service states (pveproxy, pvedaemon, corosync). |
88
+ | `proxmox_list_disks` | 1 read | Physical disks with model/size/SMART health/wearout. |
89
+ | `proxmox_list_updates` | 1 read | Pending APT updates on a node (needs a Sys.Modify token). |
90
+ | `proxmox_list_firewall_rules` | 1 read | Firewall rules at cluster/node/guest scope. |
91
+ | `proxmox_get_firewall_options` | 1 read | Firewall enable state + default policy at a scope. |
92
+ | `proxmox_list_storage_config` | 1 read | Datacenter storage definitions (id/type/content/nodes). |
93
+ | `proxmox_list_backup_jobs` | 1 read | Scheduled vzdump backup jobs. |
94
+ | `proxmox_list_users` | 1 read | Access users (userid, realm, enabled state). |
95
+ | `proxmox_list_roles` | 1 read | Roles and their privileges. |
96
+ | `proxmox_list_acl` | 1 read | ACL entries: who holds which role on which path. |
97
+ | `proxmox_list_pools` | 1 read | All resource pools. |
98
+ | `proxmox_list_tokens` | 1 read | API tokens for a user. |
99
+ | `proxmox_cluster_status` | 1 read | Cluster membership + quorum per node. |
100
+ | `proxmox_ha_status` | 1 read | HA manager status: quorum, fencing, resource states. |
101
+ | `proxmox_list_ha_resources` | 1 read | HA-managed resources. |
102
+ | `proxmox_list_ha_rules` | 1 read | HA rules (PVE 9+ replacement for HA groups). |
103
+ | `proxmox_list_replication` | 1 read | Storage replication jobs. |
104
+ | `proxmox_list_sdn_zones` | 1 read | SDN zones. |
105
+ | `proxmox_list_sdn_vnets` | 1 read | SDN virtual networks. |
106
+ | `proxmox_list_metric_servers` | 1 read | External metrics servers (InfluxDB/Graphite). |
107
+ | `proxmox_get_cluster_options` | 1 read | Datacenter options (keyboard, MAC prefix, tags). |
108
+ | `proxmox_cluster_log` | 1 read | Recent cluster-wide log entries. |
79
109
  | `proxmox_read_file` | 2 gated guest read | Read a file from inside an LXC or QEMU VM (SSH + `cat`). Requires `confirm: true`. |
80
110
  | `proxmox_stat_path` | 2 gated guest read | Inspect guest path metadata. Requires `confirm: true`. |
81
111
  | `proxmox_list_directory` | 2 gated guest read | List one guest directory. Requires `confirm: true`. |
@@ -93,18 +123,49 @@ Tier markers below are authoritative: each tool's gate is enforced in code (`src
93
123
  | `proxmox_service_start` | 2 safe-write | Start a systemd service inside a guest. Requires `confirm: true`. |
94
124
  | `proxmox_service_stop` | 2 safe-write | Stop a systemd service inside a guest. Requires `confirm: true`. |
95
125
  | `proxmox_service_restart` | 2 safe-write | Restart a systemd service inside a guest. Requires `confirm: true`. |
126
+ | `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
+ | `proxmox_update_container_config` | 2 safe-write | Edit an existing LXC config (cores/memory/hostname/etc, `PUT .../lxc/{vmid}/config`). Requires `confirm: true`. |
128
+ | `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
+ | `proxmox_migrate_resource` | 2 safe-write | Migrate a VM or container to another node (`POST .../migrate`). Requires `confirm: true`. |
131
+ | `proxmox_suspend_resource` | 2 safe-write | Suspend/pause a running guest (QEMU can hibernate to disk). Requires `confirm: true`. |
132
+ | `proxmox_resume_resource` | 2 safe-write | Resume a suspended guest. Requires `confirm: true`. |
133
+ | `proxmox_reset_resource` | 2 safe-write | Hard-reset a QEMU VM (reset button; no graceful shutdown). Requires `confirm: true`. |
134
+ | `proxmox_convert_to_template` | 2 safe-write | Convert a stopped guest into a clone template (one-way). Requires `confirm: true`. |
135
+ | `proxmox_download_url` | 2 safe-write | Download an ISO or container template from a URL onto a storage. Requires `confirm: true`. |
136
+ | `proxmox_cancel_task` | 2 safe-write | Stop a running task by UPID (abort a stuck migration/backup). Requires `confirm: true`. |
137
+ | `proxmox_add_firewall_rule` | 2 safe-write | Add a firewall rule at cluster/node/guest scope. Requires `confirm: true`. |
138
+ | `proxmox_delete_firewall_rule` | 2 safe-write | Delete a firewall rule by position at a scope. Requires `confirm: true`. |
139
+ | `proxmox_set_firewall_enabled` | 2 safe-write | Enable/disable the firewall at a scope. Requires `confirm: true`. |
140
+ | `proxmox_move_disk` | 2 safe-write | Relocate a VM disk or container volume to another storage. Requires `confirm: true`. |
141
+ | `proxmox_create_storage` | 2 safe-write | Define a new datacenter storage (dir/nfs/lvm/pbs/etc). Requires `confirm: true`. |
142
+ | `proxmox_create_backup_job` | 2 safe-write | Create a scheduled vzdump backup job. Requires `confirm: true`. |
143
+ | `proxmox_delete_backup_job` | 2 safe-write | Delete a scheduled backup job (archives untouched). Requires `confirm: true`. |
144
+ | `proxmox_set_acl` | 2 safe-write | Grant or revoke a role for a user/token/group on a path. Requires `confirm: true`. |
145
+ | `proxmox_create_token` | 2 safe-write | Create an API token; returns the secret once. Requires `confirm: true`. |
146
+ | `proxmox_delete_token` | 2 safe-write | Revoke an API token. Requires `confirm: true`. |
147
+ | `proxmox_create_pool` | 2 safe-write | Create a resource pool. Requires `confirm: true`. |
148
+ | `proxmox_update_pool` | 2 safe-write | Add/remove guests or storage in a pool. Requires `confirm: true`. |
149
+ | `proxmox_delete_pool` | 2 safe-write | Delete an empty resource pool. Requires `confirm: true`. |
150
+ | `proxmox_add_ha_resource` | 2 safe-write | Place a VM/container under HA management. Requires `confirm: true`. |
151
+ | `proxmox_delete_ha_resource` | 2 safe-write | Remove a guest from HA management. Requires `confirm: true`. |
152
+ | `proxmox_create_replication` | 2 safe-write | Create a storage replication job to another node. Requires `confirm: true`. |
153
+ | `proxmox_delete_replication` | 2 safe-write | Delete a replication job. Requires `confirm: true`. |
96
154
  | `proxmox_rollback_snapshot` | 3 destructive | Roll back a resource to a named snapshot. |
97
155
  | `proxmox_destroy_resource` | 3 destructive | Permanently delete an LXC or VM (`DELETE /nodes/{node}/{type}/{vmid}`). |
98
156
  | `proxmox_cleanup_smoke_resources` | 3 destructive | Dry-run or destroy smoke-prefixed LXC/QEMU guests from a smoke pool. |
99
157
  | `proxmox_delete_snapshot` | 3 destructive | Delete a named snapshot. |
100
158
  | `proxmox_force_stop_resource` | 3 destructive | Non-graceful hard stop of a running container or VM. |
159
+ | `proxmox_delete_volume` | 3 destructive | Permanently delete a storage volume (backup, ISO, template, disk image). |
160
+ | `proxmox_node_power` | 3 destructive | Reboot or shut down an entire node, taking down every guest on it. |
161
+ | `proxmox_delete_storage` | 3 destructive | Remove a storage definition from the datacenter config. |
101
162
 
102
- **Reads (20):** open; no flags required.
163
+ **Reads (43):** open; no flags required.
103
164
  **Gated guest reads (4):** guest file/path/directory/service inspection tools require `confirm: true` because they expose in-guest state through host-backed SSH.
104
- **Safe writes (13):** require `confirm: true`. The schema documents the gate on every tool. `WriteGateError` fires before any HTTP call.
105
- **Destructive (5):** 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.
165
+ **Safe writes (41):** require `confirm: true`. The schema documents the gate on every tool. `WriteGateError` fires before any HTTP call.
166
+ **Destructive (8):** 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.
106
167
 
107
- > Five tools are destructive and can delete or hard-stop guests: `proxmox_destroy_resource`, `proxmox_cleanup_smoke_resources`, `proxmox_rollback_snapshot`, `proxmox_delete_snapshot`, and `proxmox_force_stop_resource`. They are gated behind the `PROXMOX_ENABLE_DESTRUCTIVE=1` process env flag and stay inert until you set it. See [SECURITY.md](SECURITY.md) and the [Safety](#safety) section.
168
+ > Eight tools are destructive and can delete, 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`, and `proxmox_delete_storage`. They are gated behind the `PROXMOX_ENABLE_DESTRUCTIVE=1` process env flag and stay inert until you set it. See [SECURITY.md](SECURITY.md) and the [Safety](#safety) section.
108
169
 
109
170
  ## Quickstart
110
171
 
@@ -121,7 +182,7 @@ Set the three required credential env vars (scrub real hosts and IPs out of any
121
182
  ```bash
122
183
  export PROXMOX_URL=https://192.0.2.10:8006
123
184
  export PROXMOX_TOKEN_ID=pve-admin@pam!api-token-1
124
- export PROXMOX_TOKEN_SECRET=00000000-0000-0000-0000-000000000000
185
+ export PROXMOX_TOKEN_SECRET=REPLACE_WITH_TOKEN_SECRET
125
186
 
126
187
  # Optional: skip TLS cert validation for homelab self-signed certs.
127
188
  # Accepts true/1/yes (case-insensitive). Defaults to false.
@@ -137,7 +198,7 @@ claude mcp add proxmox -s user -- npx -y @solomonneas/proxmox-mcp
137
198
 
138
199
  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.
139
200
 
140
- > Note: the latest version published to npm is `0.3.0`. This repository tracks ahead of npm; install pins the published release.
201
+ > Note: the latest published version is `0.12.0`. `npx`/`npm install` pins the published release; this repository may track ahead between releases.
141
202
 
142
203
  ## Configuration
143
204
 
@@ -146,15 +207,40 @@ Set the following env vars. All three credential vars are required.
146
207
  ```
147
208
  PROXMOX_URL=https://192.0.2.10:8006
148
209
  PROXMOX_TOKEN_ID=pve-admin@pam!api-token-1
149
- PROXMOX_TOKEN_SECRET=00000000-0000-0000-0000-000000000000
210
+ PROXMOX_TOKEN_SECRET=REPLACE_WITH_TOKEN_SECRET
150
211
 
151
212
  # Optional: skip TLS cert validation (homelab self-signed certs).
152
213
  # Accepts true/1/yes (case-insensitive). Defaults to false.
153
214
  PROXMOX_TLS_INSECURE=false
215
+
216
+ # Optional (experimental): load tools on demand instead of listing all 96.
217
+ # Accepts true/1/yes (case-insensitive). Defaults to false. See "Deferred tool loading".
218
+ PROXMOX_DEFERRED_TOOLS=false
154
219
  ```
155
220
 
221
+ `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
+
156
223
  Trailing slashes on `PROXMOX_URL` are stripped. The token secret is registered with the redactor on startup and masked from all log + error output.
157
224
 
225
+ ### Deferred tool loading (experimental)
226
+
227
+ 96 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
+
229
+ Requirements and caveats:
230
+
231
+ - **Your client must honor `notifications/tools/list_changed`, and not all of them do.** Measured against a real connection:
232
+
233
+ | Client | Deferred mode | Notes |
234
+ | --- | --- | --- |
235
+ | Claude Code 2.1.219 | **works** | re-fetches `tools/list` 2ms after the notification, then calls the new tool |
236
+ | Cursor (cursor-agent 2026.07.23) | **does not work** | receives the notification, never re-lists; the agent is then told the tool does not exist |
237
+ | Codex CLI 0.145.0 | untested | could not dispatch MCP tool calls headlessly in our harness, so `list_changed` support is unknown |
238
+
239
+ A client that ignores the notification will see the search succeed, be told which tools were loaded, and then be unable to call any of them. Leave the flag unset there. Default (flag unset) is the full static tool list exactly as before, which is why static profiles remain the supported path.
240
+ - On clients that apply their own tool deferral, a newly listed tool may be *visible but not immediately callable* until the client fetches its schema, which costs one extra turn.
241
+ - **Hiding a tool is not a safety mechanism.** Destructive tools are searchable, and the gate chain is unchanged: a tool reached through search still requires `confirm: true`, `destructive: true`, and `PROXMOX_ENABLE_DESTRUCTIVE=1` exactly as it would otherwise. Search results carry each tool's tier and the gate arguments it will demand. The gates in `src/gates.ts` are the boundary; visibility is a token optimization.
242
+ - Calling a tool by name that search has not surfaced still works. Refusing it would create a second, weaker enforcement surface without adding safety.
243
+
158
244
  ### In-container exec env vars
159
245
 
160
246
  The `proxmox_exec`, `proxmox_read_file`, and `proxmox_write_file` tools SSH to the Proxmox host (for LXC, via `pct exec`) or directly to the VM (for QEMU). All are optional; defaults derive from `PROXMOX_URL`.
@@ -168,6 +254,7 @@ The `proxmox_exec`, `proxmox_read_file`, and `proxmox_write_file` tools SSH to t
168
254
  | `PROXMOX_VM_SSH_USER` | falls through to `PROXMOX_SSH_USER` | Default user for direct VM SSH |
169
255
  | `PROXMOX_VM_SSH_KEY` | falls through to `PROXMOX_SSH_KEY` | Default key for direct VM SSH |
170
256
  | `PROXMOX_SSH_MAX_OUTPUT_BYTES` | `1048576` | Max stdout bytes and max stderr bytes captured per SSH command |
257
+ | `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. |
171
258
 
172
259
  Per-VM overrides (read at execute time, no MCP restart needed):
173
260
 
@@ -177,31 +264,146 @@ Per-VM overrides (read at execute time, no MCP restart needed):
177
264
 
178
265
  For QEMU VMs without a per-VM env override, install `qemu-guest-agent` in the VM and enable it with `qm set <vmid> --agent 1` so the IP can be discovered automatically.
179
266
 
267
+ Set `PROXMOX_EXEC_BACKEND=guest-agent` to run QEMU guest commands entirely through the qemu-guest-agent API instead of SSH. This needs no in-guest SSH key and no network path from the MCP host to the VM (traffic goes through the Proxmox API), but the API token needs the `VM.GuestAgent.*` privileges (`Unrestricted` for exec, `FileRead`/`FileWrite` for file ops). LXC guests always use `pct exec` over host SSH regardless of this setting.
268
+
269
+ ### Waiting for long-running tasks
270
+
271
+ Provisioning and disk operations (`proxmox_create_container`, `proxmox_create_vm`, `proxmox_clone_resource`, `proxmox_run_backup`, `proxmox_restore_backup`, `proxmox_migrate_resource`, `proxmox_resize_disk`, `proxmox_download_url`, `proxmox_destroy_resource`) return a task UPID immediately. Pass `wait: true` (with optional `wait_timeout` seconds, default 120) to block until the task finishes; the result then includes a `task` object with `done`, `exitstatus`, and `ok` (true only for an `OK` exit). Without `wait`, use `proxmox_wait_task` to poll the UPID yourself.
272
+
180
273
  ## CLI
181
274
 
182
- The same package ships a read-only **control CLI**, `proxmoxctrl`, for shells, cron, and CI. Compatibility aliases `proxmoxctl` and `proxops` still point at the same binary. It shares the `ProxmoxClient` core with the MCP adapter 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.
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.
183
276
 
184
277
  ```bash
185
278
  npx @solomonneas/proxmox-mcp@latest status
186
279
  # or, installed globally:
187
- proxmoxctrl status # PVE version + per-node status (exit 1 if a node is offline)
188
- proxmoxctrl vms list
189
- proxmoxctrl containers list
190
- proxmoxctrl vm config 100
191
- proxmoxctrl storage list --node pve
192
- proxmoxctrl backups list --vmid 100
193
- proxmoxctrl snapshots list 100
194
- proxmoxctrl audit-permissions
195
- proxmoxctrl recent-tasks --limit 20
196
- proxmoxctrl task status UPID:pve:...
197
- proxmoxctrl vms list --json # raw JSON for piping
280
+ proxmoxctl status # PVE version + per-node status (exit 1 if a node is offline)
281
+ proxmoxctl vms list
282
+ proxmoxctl containers list
283
+ proxmoxctl vm config 100
284
+ proxmoxctl storage list --node pve
285
+ proxmoxctl storage content local --node pve --content backup
286
+ proxmoxctl disks list --node pve # physical disks + SMART health
287
+ proxmoxctl services list --node pve # host systemd services
288
+ proxmoxctl firewall rules --scope cluster
289
+ proxmoxctl backups list --vmid 100
290
+ proxmoxctl snapshots list 100
291
+ proxmoxctl audit-permissions
292
+ proxmoxctl recent-tasks --limit 20
293
+ proxmoxctl task status UPID:pve:...
294
+ proxmoxctl vms list --json # raw JSON for piping
198
295
  ```
199
296
 
200
- Run `proxmoxctrl help` for the full command list. `--json` emits raw JSON instead of the concise summary. Exit codes: `0` success, `1` runtime error (backend unreachable / call failed, and `status` when a node is offline), `2` usage error (unknown command/flag or bad value).
297
+ Run `proxmoxctl help` for the full command list. `--json` emits raw JSON instead of the concise summary. Exit codes: `0` success, `1` runtime error (backend unreachable / call failed, and `status` when a node is offline), `2` usage error (unknown command/flag or bad value).
201
298
 
202
299
  ### Starting the MCP server
203
300
 
204
- `proxmoxctrl mcp` (or the back-compat `proxmox-mcp` bin) starts the stdio MCP server. If a launcher referenced the file path `dist/mcp-server.js` directly, it keeps working; new launchers can point at `dist/mcp-bin.js` (or `dist/cli.js mcp`). Launchers that use the `proxmox-mcp` bin name need no change.
301
+ `proxmoxctl mcp` (or the back-compat `proxmox-mcp` bin) starts the stdio MCP server. If a launcher referenced the file path `dist/mcp-server.js` directly, it keeps working; new launchers can point at `dist/mcp-bin.js` (or `dist/cli.js mcp`). Launchers that use the `proxmox-mcp` bin name need no change.
302
+
303
+ ### Shared HTTP mode
304
+
305
+ Run one persistent process for multiple MCP clients:
306
+
307
+ ```sh
308
+ node dist/cli.js mcp --http
309
+ # Or: proxmoxctl mcp --http
310
+ ```
311
+
312
+ Set the usual `PROXMOX_URL`, `PROXMOX_TOKEN_ID`, and `PROXMOX_TOKEN_SECRET`
313
+ on the server, plus an independent `PROXMOX_MCP_HTTP_TOKEN`. Generate a random
314
+ HTTP token, for example with `openssl rand -hex 32`. Startup refuses a missing or
315
+ blank token, or one equal to the Proxmox token ID, token secret, complete API
316
+ authorization value, or URL credentials. Tokens are compared using SHA-256 and
317
+ constant-time comparison. Keep the token private: every client with it shares
318
+ the server's Proxmox privileges and process-level destructive-operation flag.
319
+
320
+ | Variable | Default | Purpose |
321
+ | --- | --- | --- |
322
+ | `PROXMOX_MCP_HTTP_TOKEN` | Required | Bearer credential, at least 32 characters, separate from upstream credentials |
323
+ | `PROXMOX_MCP_HTTP_HOST` | IPv4 loopback | Listener bind address. Wildcards (`0.0.0.0`, `::`, `[::]`) are refused |
324
+ | `PROXMOX_MCP_HTTP_PORT` | `3100` | TCP port (`0` selects a free port) |
325
+
326
+ The resolved address is printed to stderr on startup. `/mcp` supports Streamable
327
+ HTTP POST, GET, and DELETE with bearer authentication on every request.
328
+ `GET /healthz` requires no token and returns only `{"status":"ok"}`.
329
+ Requests must use the bound host or a loopback alias in `Host`. A supplied
330
+ `Origin` must be an HTTP or HTTPS loopback origin. Request bodies are limited to
331
+ 1 MiB. The listener accepts at most 128 sessions, reaps sessions idle for 30 minutes
332
+ (on a minute timer), and closes transports and the listener on SIGTERM or SIGINT.
333
+ Active tool requests are excluded from idle expiry. An idle SSE channel does not
334
+ keep a session alive. Clients must initialize again after expiry or a restart.
335
+
336
+ Each initialized MCP session gets its own server and deferred-tool visible set.
337
+ Confirmation gates have no pending approvals: `confirm`, `destructive`, and the
338
+ environment gate are checked on every tool invocation. One session's confirmation
339
+ cannot authorize another call. The secret-redaction registry is process-wide and
340
+ only adds masking, never authorization. Session IDs route connection state and
341
+ are not separate user identities. All clients using the shared bearer token are
342
+ in the same trust boundary. HTTP mode preserves the existing stdio defaults.
343
+
344
+ Keep the default loopback binding for local clients. A non-loopback listener
345
+ requires a trusted TLS proxy or tunnel and appropriate network access controls.
346
+ This transport does not provide TLS, OAuth, browser CORS access, or per-client
347
+ Proxmox accounts. Preserve the allowed Host header through a proxy. A wildcard
348
+ bind does not allow arbitrary Host headers. Use a specific bind address or host
349
+ name for remote clients.
350
+
351
+ #### Claude Code
352
+
353
+ Add this entry under `mcpServers` in `~/.claude.json`. Replace the token placeholder
354
+ with the HTTP token. Restrict access to the config file.
355
+
356
+ ```json
357
+ {
358
+ "mcpServers": {
359
+ "proxmox": {
360
+ "type": "http",
361
+ "url": "http://localhost:3100/mcp",
362
+ "headers": {
363
+ "Authorization": "Bearer <HTTP_TOKEN>"
364
+ }
365
+ }
366
+ }
367
+ }
368
+ ```
369
+
370
+ The `type` and header syntax follow the
371
+ [Claude Code MCP configuration](https://code.claude.com/docs/en/mcp).
372
+
373
+ #### Codex
374
+
375
+ Add to `~/.codex/config.toml`, and export `PROXMOX_MCP_HTTP_TOKEN` in the environment
376
+ that launches Codex. Its value must match the server's token, without the
377
+ `Bearer ` prefix. The client needs no upstream Proxmox credentials.
378
+
379
+ ```toml
380
+ [mcp_servers.proxmox]
381
+ url = "http://localhost:3100/mcp"
382
+ bearer_token_env_var = "PROXMOX_MCP_HTTP_TOKEN"
383
+ ```
384
+
385
+ These fields follow the
386
+ [Codex Streamable HTTP configuration](https://developers.openai.com/codex/mcp/).
387
+
388
+ #### systemd user service
389
+
390
+ An example unit is at
391
+ [`docs/systemd/proxmox-mcp-http.service`](docs/systemd/proxmox-mcp-http.service).
392
+ Adjust its generic installation paths, build the project there, and place the
393
+ server environment in `%h/.config/proxmox-mcp/http.env` with mode `0600`:
394
+
395
+ ```sh
396
+ PROXMOX_URL=https://proxmox.example.com:8006
397
+ PROXMOX_TOKEN_ID=operator@pve!mcp
398
+ PROXMOX_TOKEN_SECRET=REPLACE_WITH_UPSTREAM_SECRET
399
+ PROXMOX_MCP_HTTP_TOKEN=REPLACE_WITH_INDEPENDENT_RANDOM_TOKEN
400
+ PROXMOX_MCP_HTTP_PORT=3100
401
+ ```
402
+
403
+ The unit reads this file with `EnvironmentFile`. Add SSH settings there if the
404
+ chosen tools require them. Leave `PROXMOX_ENABLE_DESTRUCTIVE` unset unless the
405
+ service should permit destructive calls. Installing or starting the example is
406
+ an operator action, separate from building the server.
205
407
 
206
408
  ## Setup
207
409
 
@@ -218,7 +420,7 @@ Run `proxmoxctrl help` for the full command list. `--json` emits raw JSON instea
218
420
  "env": {
219
421
  "PROXMOX_URL": "https://192.0.2.10:8006",
220
422
  "PROXMOX_TOKEN_ID": "pve-admin@pam!api-token-1",
221
- "PROXMOX_TOKEN_SECRET": "00000000-0000-0000-0000-000000000000",
423
+ "PROXMOX_TOKEN_SECRET": "REPLACE_WITH_TOKEN_SECRET",
222
424
  "PROXMOX_TLS_INSECURE": "false"
223
425
  }
224
426
  }
@@ -265,7 +467,7 @@ args = ["-y", "@solomonneas/proxmox-mcp"]
265
467
  [mcp_servers.proxmox.env]
266
468
  PROXMOX_URL = "https://192.0.2.10:8006"
267
469
  PROXMOX_TOKEN_ID = "pve-admin@pam!api-token-1"
268
- PROXMOX_TOKEN_SECRET = "00000000-0000-0000-0000-000000000000"
470
+ PROXMOX_TOKEN_SECRET = "REPLACE_WITH_TOKEN_SECRET"
269
471
  PROXMOX_TLS_INSECURE = "false"
270
472
  ```
271
473
 
@@ -273,13 +475,13 @@ PROXMOX_TLS_INSECURE = "false"
273
475
 
274
476
  This MCP uses a three-tier write-gating model. The tier is enforced in code, not just documented.
275
477
 
276
- - **Tier 1 (reads):** open. No confirm flag needed. Status, listings, config inspection, QEMU smoke-source validation, permission audit, usage, recent tasks, backup inventory, template inventory, storage inventory, snapshot inventory, guest network lookup, task wait, next-VMID lookup, task status/log, and pool resource audit live here.
277
- - **Tier 2 (gated guest reads + safe writes):** require an explicit `confirm: true` arg. Guest file/path/directory/service inspection, start, stop, reboot, snapshot create, run backup, create container, create VM, clone, in-container `exec`, in-container `write_file`, and guest service start/stop/restart live here. A tool call without the confirm flag throws `WriteGateError` before any HTTP traffic.
278
- - **Tier 3 (destructive):** require `confirm: true` + `destructive: true` + the env flag `PROXMOX_ENABLE_DESTRUCTIVE=1` on the MCP process. Permanent resource deletion, smoke pool cleanup, snapshot rollback/deletion, and non-graceful force-stop live here.
478
+ - **Tier 1 (reads):** open. No confirm flag needed. Status, listings, config inspection, QEMU smoke-source validation, permission audit, usage, recent tasks, backup inventory, template inventory, storage inventory, snapshot inventory, guest network lookup, task wait, next-VMID lookup, task status/log, pool resource audit, storage content listing, node service/disk/update inventory, and firewall rule/option inspection, storage-config and backup-job listing, and access/role/ACL/pool/token inspection, and cluster/HA/SDN/replication observability live here.
479
+ - **Tier 2 (gated guest reads + safe writes):** require an explicit `confirm: true` arg. Guest file/path/directory/service inspection, start, stop, reboot, snapshot create, run backup, create container, create VM, clone, VM/container config edit, disk resize, backup restore (to a new VMID), node migration, suspend/resume/reset, convert-to-template, ISO/template download, task cancel, firewall rule add/delete and enable-toggle, disk move, storage creation, backup-job create/delete, ACL grant/revoke, API-token create/delete, pool create/update/delete, HA resource add/remove, replication job create/delete, in-container `exec`, in-container `write_file`, and guest service start/stop/restart live here. A tool call without the confirm flag throws `WriteGateError` before any HTTP traffic. Restoring a backup *over an existing VMID* escalates to the Tier-3 gate because it wipes the target's disks.
480
+ - **Tier 3 (destructive):** require `confirm: true` + `destructive: true` + the env flag `PROXMOX_ENABLE_DESTRUCTIVE=1` on the MCP process. Permanent resource deletion, smoke pool cleanup, snapshot rollback/deletion, non-graceful force-stop, storage-volume deletion, storage-definition removal, and node reboot/shutdown live here.
279
481
 
280
482
  ### Destructive operations env gate
281
483
 
282
- Tier 3 destructive tools (`proxmox_destroy_resource`, `proxmox_cleanup_smoke_resources`, `proxmox_rollback_snapshot`, `proxmox_delete_snapshot`, `proxmox_force_stop_resource`) 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.
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.
283
485
 
284
486
  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.
285
487
 
@@ -395,7 +597,7 @@ Audit or clean leftover smoke resources:
395
597
  ## What proxmox-mcp is not
396
598
 
397
599
  - It is **not a tool for blind automation of destructive operations.** The destructive tier exists for deliberate, supervised work (smoke-test cycles, intentional teardown), not for unattended agents. The `PROXMOX_ENABLE_DESTRUCTIVE=1` flag is a coarse "I am actively doing this right now" toggle; leave it unset day to day.
398
- - It is **not a Proxmox cluster manager or orchestrator.** It does not schedule, it does not run in the background, and it holds no state of its own. It translates MCP tool calls into Proxmox API calls and SSH commands, and that is all.
600
+ - It is **not a Proxmox cluster manager or orchestrator.** It does not schedule cluster work. HTTP mode keeps MCP session state in memory. It translates MCP tool calls into Proxmox API calls and SSH commands, and that is all.
399
601
  - It is **not a substitute for least-privilege tokens.** The write gate is a guardrail against a misbehaving model, not a substitute for a properly scoped Proxmox API token. Start read-only and grade up. See [SECURITY.md](SECURITY.md).
400
602
  - It is **not stable yet.** It is WIP, pre-1.0, and the tool surface can change between minor versions.
401
603
 
@@ -410,3 +612,11 @@ See [CHANGELOG.md](CHANGELOG.md) for the release history.
410
612
  ## License
411
613
 
412
614
  MIT. See [LICENSE](LICENSE).
615
+
616
+ ---
617
+
618
+ <p align="center"><a href="https://lidless.dev">Part of <strong>Lidless Labs</strong></a> &middot; the eye does not close</p>
619
+
620
+ <p align="center"><sub><strong>Homelab:</strong> <a href="https://github.com/lidless-labs/adguardctrl">adguardctrl</a> &middot; <a href="https://github.com/lidless-labs/immichctrl">immichctrl</a> &middot; <a href="https://github.com/lidless-labs/jellyctrl">jellyctrl</a> &middot; <a href="https://github.com/lidless-labs/proxguard">proxguard</a></sub></p>
621
+
622
+ <p align="center"><sub><a href="https://lidless.dev">All tools</a> &middot; <a href="https://github.com/lidless-labs">Lidless Labs on GitHub</a></sub></p>