@solomonneas/proxmox-mcp 0.3.0 → 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 +507 -50
- package/dist/cli.js +5834 -0
- package/dist/index.js +3845 -298
- package/dist/mcp-bin.js +5249 -0
- package/dist/mcp-server.js +4455 -354
- package/openclaw.plugin.json +12 -4
- package/package.json +40 -12
package/README.md
CHANGED
|
@@ -1,8 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/assets/proxmox-mcp-social-preview.jpg" alt="proxmox-mcp banner" width="900">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
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>
|
|
8
|
+
<h1 align="center">proxmox-mcp</h1>
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
<p align="center">
|
|
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>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
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 latest release is <code>0.12.0</code>.
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://lidless.dev/proxmox-mcp"><strong>Website & docs → lidless.dev/proxmox-mcp</strong></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<img src="https://shieldcn.dev/github/ci/lidless-labs/proxmox-mcp.svg?branch=master&workflow=ci.yml" alt="CI status">
|
|
24
|
+
<img src="https://shieldcn.dev/npm/@solomonneas/proxmox-mcp.svg" alt="npm version">
|
|
25
|
+
<img src="https://shieldcn.dev/badge/MCP-server-8A2BE2.svg" alt="MCP server">
|
|
26
|
+
<img src="https://shieldcn.dev/badge/license-MIT-green.svg" alt="MIT license">
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
## What it does
|
|
30
|
+
|
|
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
|
+
|
|
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.
|
|
34
|
+
|
|
35
|
+
## Proof
|
|
36
|
+
|
|
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.
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"proxmox": {
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["-y", "@solomonneas/proxmox-mcp"],
|
|
45
|
+
"env": {
|
|
46
|
+
"PROXMOX_URL": "https://192.0.2.10:8006",
|
|
47
|
+
"PROXMOX_TOKEN_ID": "pve-admin@pam!api-token-1",
|
|
48
|
+
"PROXMOX_TOKEN_SECRET": "REPLACE_WITH_TOKEN_SECRET",
|
|
49
|
+
"PROXMOX_TLS_INSECURE": "false"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Tool list (96 tools, verified against source)
|
|
57
|
+
|
|
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
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
Generated from [`docs/assets/workflows/proxmox-safety.json`](docs/assets/workflows/proxmox-safety.json) with `lidless workflow`.
|
|
6
63
|
|
|
7
64
|
| Tool | Tier | Notes |
|
|
8
65
|
| --- | --- | --- |
|
|
@@ -10,56 +67,344 @@ MCP server exposing Proxmox VE read + safe-write + destructive tools via API tok
|
|
|
10
67
|
| `proxmox_list_containers` | 1 read | LXC inventory across all nodes. |
|
|
11
68
|
| `proxmox_list_vms` | 1 read | QEMU inventory across all nodes. |
|
|
12
69
|
| `proxmox_get_resource` | 1 read | Single container or VM config + status by vmid. |
|
|
70
|
+
| `proxmox_get_vm_config` | 1 read | QEMU VM config by vmid. |
|
|
71
|
+
| `proxmox_get_container_config` | 1 read | LXC container config by vmid. |
|
|
72
|
+
| `proxmox_validate_qemu_smoke_source` | 1 read | Preflight a QEMU VM before live smoke cloning. |
|
|
73
|
+
| `proxmox_audit_permissions` | 1 read | Inspect effective permissions across smoke-relevant paths. |
|
|
13
74
|
| `proxmox_recent_tasks` | 1 read | Recent UPID task list per node. |
|
|
14
75
|
| `proxmox_list_backups` | 1 read | Backup inventory by storage. |
|
|
15
76
|
| `proxmox_resource_usage` | 1 read | CPU/mem/disk RRD metrics. |
|
|
16
77
|
| `proxmox_list_templates` | 1 read | LXC + VM templates available for cloning + container creation. |
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
78
|
+
| `proxmox_list_storage` | 1 read | Storage status on one node or all nodes. |
|
|
79
|
+
| `proxmox_list_snapshots` | 1 read | Snapshot inventory for one LXC or VM. |
|
|
80
|
+
| `proxmox_guest_network` | 1 read | Guest network interfaces and usable IPv4 addresses. |
|
|
81
|
+
| `proxmox_wait_task` | 1 read | Poll a UPID until stopped or timeout. |
|
|
82
|
+
| `proxmox_next_vmid` | 1 read | Get the next available VMID for provisioning. |
|
|
83
|
+
| `proxmox_list_pool_resources` | 1 read | Inspect resources assigned to a Proxmox pool, defaulting to `mcp-smoke`. |
|
|
84
|
+
| `proxmox_get_task_status` | 1 read | Single UPID status lookup. |
|
|
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. |
|
|
109
|
+
| `proxmox_read_file` | 2 gated guest read | Read a file from inside an LXC or QEMU VM (SSH + `cat`). Requires `confirm: true`. |
|
|
110
|
+
| `proxmox_stat_path` | 2 gated guest read | Inspect guest path metadata. Requires `confirm: true`. |
|
|
111
|
+
| `proxmox_list_directory` | 2 gated guest read | List one guest directory. Requires `confirm: true`. |
|
|
112
|
+
| `proxmox_service_status` | 2 gated guest read | Read systemd service state inside a guest. Requires `confirm: true`. |
|
|
113
|
+
| `proxmox_start_resource` | 2 safe-write | Boot container or VM. Requires `confirm: true`. |
|
|
114
|
+
| `proxmox_stop_resource` | 2 safe-write | Graceful shutdown. Requires `confirm: true`. |
|
|
115
|
+
| `proxmox_reboot_resource` | 2 safe-write | Reboot in place. Requires `confirm: true`. |
|
|
116
|
+
| `proxmox_snapshot_resource` | 2 safe-write | Create named snapshot. Requires `confirm: true`. |
|
|
117
|
+
| `proxmox_run_backup` | 2 safe-write | Trigger vzdump for a vmid. Requires `confirm: true`. |
|
|
118
|
+
| `proxmox_create_container` | 2 safe-write | Provision new LXC from template (`POST /nodes/{node}/lxc`). Requires `confirm: true`. |
|
|
119
|
+
| `proxmox_create_vm` | 2 safe-write | Provision new QEMU VM (`POST /nodes/{node}/qemu`). Requires `confirm: true`. |
|
|
120
|
+
| `proxmox_clone_resource` | 2 safe-write | Clone existing container or VM into a fresh vmid. Requires `confirm: true`. |
|
|
121
|
+
| `proxmox_exec` | 2 safe-write | Run a shell command inside an LXC or QEMU VM. Returns stdout/stderr/exit_code. Requires `confirm: true`. |
|
|
122
|
+
| `proxmox_write_file` | 2 safe-write | Write a text file (with parent dirs) inside an LXC or QEMU VM. Requires `confirm: true`. |
|
|
123
|
+
| `proxmox_service_start` | 2 safe-write | Start a systemd service inside a guest. Requires `confirm: true`. |
|
|
124
|
+
| `proxmox_service_stop` | 2 safe-write | Stop a systemd service inside a guest. Requires `confirm: true`. |
|
|
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`. |
|
|
154
|
+
| `proxmox_rollback_snapshot` | 3 destructive | Roll back a resource to a named snapshot. |
|
|
25
155
|
| `proxmox_destroy_resource` | 3 destructive | Permanently delete an LXC or VM (`DELETE /nodes/{node}/{type}/{vmid}`). |
|
|
156
|
+
| `proxmox_cleanup_smoke_resources` | 3 destructive | Dry-run or destroy smoke-prefixed LXC/QEMU guests from a smoke pool. |
|
|
26
157
|
| `proxmox_delete_snapshot` | 3 destructive | Delete a named snapshot. |
|
|
27
158
|
| `proxmox_force_stop_resource` | 3 destructive | Non-graceful hard stop of a running container or VM. |
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
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. |
|
|
162
|
+
|
|
163
|
+
**Reads (43):** open; no flags required.
|
|
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.
|
|
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.
|
|
30
167
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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.
|
|
169
|
+
|
|
170
|
+
## Quickstart
|
|
171
|
+
|
|
172
|
+
Install globally or run on demand with `npx`:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npm install -g @solomonneas/proxmox-mcp
|
|
176
|
+
# or, no install:
|
|
177
|
+
npx -y @solomonneas/proxmox-mcp
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Set the three required credential env vars (scrub real hosts and IPs out of any shared config):
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
export PROXMOX_URL=https://192.0.2.10:8006
|
|
184
|
+
export PROXMOX_TOKEN_ID=pve-admin@pam!api-token-1
|
|
185
|
+
export PROXMOX_TOKEN_SECRET=REPLACE_WITH_TOKEN_SECRET
|
|
186
|
+
|
|
187
|
+
# Optional: skip TLS cert validation for homelab self-signed certs.
|
|
188
|
+
# Accepts true/1/yes (case-insensitive). Defaults to false.
|
|
189
|
+
export PROXMOX_TLS_INSECURE=false
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Wire it into your MCP client (full per-client config in [Setup](#setup)):
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Claude Code
|
|
196
|
+
claude mcp add proxmox -s user -- npx -y @solomonneas/proxmox-mcp
|
|
197
|
+
```
|
|
198
|
+
|
|
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.
|
|
200
|
+
|
|
201
|
+
> Note: the latest published version is `0.12.0`. `npx`/`npm install` pins the published release; this repository may track ahead between releases.
|
|
34
202
|
|
|
35
203
|
## Configuration
|
|
36
204
|
|
|
37
205
|
Set the following env vars. All three credential vars are required.
|
|
38
206
|
|
|
39
207
|
```
|
|
40
|
-
PROXMOX_URL=https://
|
|
208
|
+
PROXMOX_URL=https://192.0.2.10:8006
|
|
41
209
|
PROXMOX_TOKEN_ID=pve-admin@pam!api-token-1
|
|
42
|
-
PROXMOX_TOKEN_SECRET=
|
|
210
|
+
PROXMOX_TOKEN_SECRET=REPLACE_WITH_TOKEN_SECRET
|
|
43
211
|
|
|
44
212
|
# Optional: skip TLS cert validation (homelab self-signed certs).
|
|
45
213
|
# Accepts true/1/yes (case-insensitive). Defaults to false.
|
|
46
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
|
|
47
219
|
```
|
|
48
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
|
+
|
|
49
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.
|
|
50
224
|
|
|
51
|
-
|
|
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
|
+
|
|
244
|
+
### In-container exec env vars
|
|
245
|
+
|
|
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`.
|
|
247
|
+
|
|
248
|
+
| Env var | Default | Purpose |
|
|
249
|
+
| --- | --- | --- |
|
|
250
|
+
| `PROXMOX_SSH_HOST` | hostname from `PROXMOX_URL` | Proxmox host for `pct exec` |
|
|
251
|
+
| `PROXMOX_SSH_PORT` | `22` | SSH port |
|
|
252
|
+
| `PROXMOX_SSH_USER` | `root` | SSH user on Proxmox host |
|
|
253
|
+
| `PROXMOX_SSH_KEY` | `~/.ssh/id_ed25519` | Key path for Proxmox host SSH |
|
|
254
|
+
| `PROXMOX_VM_SSH_USER` | falls through to `PROXMOX_SSH_USER` | Default user for direct VM SSH |
|
|
255
|
+
| `PROXMOX_VM_SSH_KEY` | falls through to `PROXMOX_SSH_KEY` | Default key for direct VM SSH |
|
|
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. |
|
|
52
258
|
|
|
259
|
+
Per-VM overrides (read at execute time, no MCP restart needed):
|
|
260
|
+
|
|
261
|
+
- `PROXMOX_VM_<vmid>_SSH_HOST` - pin a VM's IP (bypasses guest agent)
|
|
262
|
+
- `PROXMOX_VM_<vmid>_SSH_USER` - per-VM user override
|
|
263
|
+
- `PROXMOX_VM_<vmid>_SSH_KEY` - per-VM key override
|
|
264
|
+
|
|
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.
|
|
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
|
+
|
|
273
|
+
## CLI
|
|
274
|
+
|
|
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.
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
npx @solomonneas/proxmox-mcp@latest status
|
|
279
|
+
# or, installed globally:
|
|
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
|
|
53
295
|
```
|
|
54
|
-
|
|
296
|
+
|
|
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).
|
|
298
|
+
|
|
299
|
+
### Starting the MCP server
|
|
300
|
+
|
|
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
|
+
}
|
|
55
368
|
```
|
|
56
369
|
|
|
57
|
-
|
|
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.
|
|
58
378
|
|
|
379
|
+
```toml
|
|
380
|
+
[mcp_servers.proxmox]
|
|
381
|
+
url = "http://localhost:3100/mcp"
|
|
382
|
+
bearer_token_env_var = "PROXMOX_MCP_HTTP_TOKEN"
|
|
59
383
|
```
|
|
60
|
-
|
|
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
|
|
61
401
|
```
|
|
62
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.
|
|
407
|
+
|
|
63
408
|
## Setup
|
|
64
409
|
|
|
65
410
|
### Claude Desktop
|
|
@@ -73,9 +418,9 @@ npx -y @solomonneas/proxmox-mcp
|
|
|
73
418
|
"command": "npx",
|
|
74
419
|
"args": ["-y", "@solomonneas/proxmox-mcp"],
|
|
75
420
|
"env": {
|
|
76
|
-
"PROXMOX_URL": "https://
|
|
421
|
+
"PROXMOX_URL": "https://192.0.2.10:8006",
|
|
77
422
|
"PROXMOX_TOKEN_ID": "pve-admin@pam!api-token-1",
|
|
78
|
-
"PROXMOX_TOKEN_SECRET": "
|
|
423
|
+
"PROXMOX_TOKEN_SECRET": "REPLACE_WITH_TOKEN_SECRET",
|
|
79
424
|
"PROXMOX_TLS_INSECURE": "false"
|
|
80
425
|
}
|
|
81
426
|
}
|
|
@@ -110,22 +455,6 @@ Plugin loads automatically once installed. Config goes in your `~/.openclaw/open
|
|
|
110
455
|
|
|
111
456
|
Env vars from `~/.openclaw/workspace/.env` are inherited by the plugin.
|
|
112
457
|
|
|
113
|
-
### Hermes Agent
|
|
114
|
-
|
|
115
|
-
Add to `~/.config/hermes/agents.yaml`:
|
|
116
|
-
|
|
117
|
-
```yaml
|
|
118
|
-
mcp_servers:
|
|
119
|
-
proxmox:
|
|
120
|
-
command: npx
|
|
121
|
-
args: ["-y", "@solomonneas/proxmox-mcp"]
|
|
122
|
-
env:
|
|
123
|
-
PROXMOX_URL: https://pve.example.local:8006
|
|
124
|
-
PROXMOX_TOKEN_ID: pve-admin@pam!api-token-1
|
|
125
|
-
PROXMOX_TOKEN_SECRET: 00000000-0000-0000-0000-000000000000
|
|
126
|
-
PROXMOX_TLS_INSECURE: "false"
|
|
127
|
-
```
|
|
128
|
-
|
|
129
458
|
### Codex CLI
|
|
130
459
|
|
|
131
460
|
`~/.codex/config.toml`:
|
|
@@ -136,30 +465,158 @@ command = "npx"
|
|
|
136
465
|
args = ["-y", "@solomonneas/proxmox-mcp"]
|
|
137
466
|
|
|
138
467
|
[mcp_servers.proxmox.env]
|
|
139
|
-
PROXMOX_URL = "https://
|
|
468
|
+
PROXMOX_URL = "https://192.0.2.10:8006"
|
|
140
469
|
PROXMOX_TOKEN_ID = "pve-admin@pam!api-token-1"
|
|
141
|
-
PROXMOX_TOKEN_SECRET = "
|
|
470
|
+
PROXMOX_TOKEN_SECRET = "REPLACE_WITH_TOKEN_SECRET"
|
|
142
471
|
PROXMOX_TLS_INSECURE = "false"
|
|
143
472
|
```
|
|
144
473
|
|
|
145
474
|
## Safety
|
|
146
475
|
|
|
147
|
-
This MCP uses
|
|
476
|
+
This MCP uses a three-tier write-gating model. The tier is enforced in code, not just documented.
|
|
148
477
|
|
|
149
|
-
- **Tier 1 (reads):** open. No confirm flag needed. Status, listings, usage, recent tasks, backup inventory, template inventory.
|
|
150
|
-
- **Tier 2 (safe writes):** require an explicit `confirm: true` arg.
|
|
151
|
-
- **Tier 3 (destructive):** require `confirm: true` + `destructive: true` + the env flag `PROXMOX_ENABLE_DESTRUCTIVE=1` on the MCP process. Permanent resource deletion, snapshot deletion,
|
|
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.
|
|
152
481
|
|
|
153
482
|
### Destructive operations env gate
|
|
154
483
|
|
|
155
|
-
Tier 3 destructive tools (`proxmox_destroy_resource`, `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.
|
|
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.
|
|
156
485
|
|
|
157
|
-
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
|
|
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.
|
|
158
487
|
|
|
159
|
-
**API token scope recommendation:** start with a read-only token (PVE Datastore.Audit + VM.Audit + Sys.Audit) and verify the read tools work end
|
|
488
|
+
**API token scope recommendation:** start with a read-only token (PVE `Datastore.Audit` + `VM.Audit` + `Sys.Audit`) and verify the read tools work end to end. Grade up to write privileges (`VM.PowerMgmt`, `VM.Snapshot`, `VM.Backup`) only after you have confirmed the redactor is masking your secret in your transcripts and that the model is honoring the confirm gate. Tokens are tied to a PVE user and can be revoked instantly from Datacenter > Permissions > API Tokens.
|
|
160
489
|
|
|
161
490
|
The `PROXMOX_TLS_INSECURE=true` toggle exists for homelab self-signed certs. Leave it `false` in any environment with a real CA-signed cert.
|
|
162
491
|
|
|
492
|
+
Full security policy, reporting, and in-scope/out-of-scope detail in [SECURITY.md](SECURITY.md).
|
|
493
|
+
|
|
494
|
+
## Live smoke testing
|
|
495
|
+
|
|
496
|
+
Read-only live smoke:
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
PROXMOX_ENABLE_LIVE_SMOKE=1 npm run smoke:live
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
Full scratch CT lifecycle smoke requires a token that can create, start, stop, inspect, and destroy resources in the `mcp-smoke` pool:
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
PROXMOX_ENABLE_LIVE_SMOKE=1 \
|
|
506
|
+
PROXMOX_SMOKE_CREATE=1 \
|
|
507
|
+
PROXMOX_ENABLE_DESTRUCTIVE=1 \
|
|
508
|
+
npm run smoke:live
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
Optional scratch CT backup and snapshot rollback smoke:
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
PROXMOX_ENABLE_LIVE_SMOKE=1 \
|
|
515
|
+
PROXMOX_SMOKE_CREATE=1 \
|
|
516
|
+
PROXMOX_SMOKE_BACKUP=1 \
|
|
517
|
+
PROXMOX_SMOKE_BACKUP_STORAGE=local \
|
|
518
|
+
PROXMOX_SMOKE_SNAPSHOT_ROLLBACK=1 \
|
|
519
|
+
PROXMOX_ENABLE_DESTRUCTIVE=1 \
|
|
520
|
+
npm run smoke:live
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
Create a scoped smoke-test role/user/token on the Proxmox host:
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
PROXMOX_CREATE_SMOKE_TOKEN=1 bash scripts/create-smoke-token.sh
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
The script creates or updates role `McpSmokeRole`, pool `mcp-smoke`, user `mcp-smoke@pve`, token `mcp-smoke@pve!live-smoke`, and ACLs for the smoke pool plus `local` and `local-lvm` storage. Proxmox prints the token secret once; store it in your private environment and do not commit it.
|
|
530
|
+
|
|
531
|
+
Proxmox also checks `/vms/<vmid>` before creating a new CT/VM. For one-off smoke tests, grant the exact next VMID before running the lifecycle smoke:
|
|
532
|
+
|
|
533
|
+
```bash
|
|
534
|
+
PROXMOX_CREATE_SMOKE_TOKEN=1 PROXMOX_SMOKE_VMID_GRANT=102 bash scripts/create-smoke-token.sh
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
`npm run smoke:live` now attempts that exact VMID grant automatically before creating a scratch CT or QEMU clone when `PROXMOX_SSH_HOST`, `PROXMOX_SSH_USER`, and `PROXMOX_SSH_KEY` are available. Set `PROXMOX_SMOKE_SKIP_AUTO_GRANT=1` to disable it.
|
|
538
|
+
|
|
539
|
+
Optional QEMU clone smoke:
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
PROXMOX_ENABLE_LIVE_SMOKE=1 \
|
|
543
|
+
PROXMOX_ENABLE_DESTRUCTIVE=1 \
|
|
544
|
+
PROXMOX_SMOKE_QEMU_SOURCE_VMID=9000 \
|
|
545
|
+
npm run smoke:live
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
This validates the source, full-clones it to a scratch VMID, starts it, waits for guest-agent network data, stops it, and destroys it. Use `PROXMOX_SMOKE_QEMU_TARGET_VMID` or `PROXMOX_SMOKE_QEMU_NAME` to override the generated target.
|
|
549
|
+
|
|
550
|
+
The QEMU source should be a small stopped VM or template with `agent: enabled=1`, DHCP networking, no PCI/USB passthrough, no raw `args`, and a modest disk size. Check it first:
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
# tool: proxmox_validate_qemu_smoke_source { "vmid": 9000 }
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
Audit smoke-token permissions:
|
|
557
|
+
|
|
558
|
+
```bash
|
|
559
|
+
# tool: proxmox_audit_permissions {
|
|
560
|
+
# "userid": "mcp-smoke@pve!live-smoke",
|
|
561
|
+
# "source_vmid": 103,
|
|
562
|
+
# "target_vmid": 102
|
|
563
|
+
# }
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
Optional systemd service smoke:
|
|
567
|
+
|
|
568
|
+
```bash
|
|
569
|
+
PROXMOX_ENABLE_LIVE_SMOKE=1 \
|
|
570
|
+
PROXMOX_SMOKE_SYSTEMD_VMID=100 \
|
|
571
|
+
PROXMOX_SMOKE_SERVICE=basic.target \
|
|
572
|
+
npm run smoke:live
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
To run a live service action as well as status, add `PROXMOX_SMOKE_SERVICE_ACTION=start|stop|restart` and `PROXMOX_SMOKE_SERVICE_ACTION_CONFIRM=1`.
|
|
576
|
+
|
|
577
|
+
Audit or clean leftover smoke resources:
|
|
578
|
+
|
|
579
|
+
```bash
|
|
580
|
+
# Read-only pool audit
|
|
581
|
+
# tool: proxmox_list_pool_resources { "pool": "mcp-smoke" }
|
|
582
|
+
|
|
583
|
+
# Dry-run cleanup, only resources named mcp-smoke-* in the pool are targeted
|
|
584
|
+
# tool: proxmox_cleanup_smoke_resources {}
|
|
585
|
+
|
|
586
|
+
# Actual cleanup waits for delete tasks and skips running guests unless force:true
|
|
587
|
+
# tool: proxmox_cleanup_smoke_resources { "dry_run": false, "confirm": true, "destructive": true }
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
## Why not the alternatives?
|
|
591
|
+
|
|
592
|
+
- **The Proxmox web UI** is the canonical control plane and you should keep it. proxmox-mcp is not a replacement; it is the agent-facing read/operate surface so an AI client can inventory, trace, and operate the cluster in the same loop it is already running, without you driving a browser.
|
|
593
|
+
- **Hand-rolling Proxmox API calls in your agent** works, but the agent has to manage token auth, the redactor, retry, task polling, and (critically) safety on its own. proxmox-mcp ships the token redactor, structured MCP error payloads, and the three-tier write gate so a careless or hallucinated call fails closed instead of deleting a guest.
|
|
594
|
+
- **A general "run any HTTP request" MCP tool** gives a model unbounded access to the Proxmox API with no guardrails. proxmox-mcp is the opposite: a fixed, named tool surface where every state change is gated and every destructive op needs an explicit process-level env flag.
|
|
595
|
+
- **Terraform / Ansible / `pct` + `qm`** are the right tools for declarative, reviewed, repeatable infrastructure. proxmox-mcp is for interactive, agent-driven inspection and operation, not for codifying your cluster.
|
|
596
|
+
|
|
597
|
+
## What proxmox-mcp is not
|
|
598
|
+
|
|
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.
|
|
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.
|
|
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).
|
|
602
|
+
- It is **not stable yet.** It is WIP, pre-1.0, and the tool surface can change between minor versions.
|
|
603
|
+
|
|
604
|
+
## Contributing
|
|
605
|
+
|
|
606
|
+
Bug reports and patches are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for what lands easily, local dev, and the safety rules every change must keep. By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
607
|
+
|
|
608
|
+
## Changelog
|
|
609
|
+
|
|
610
|
+
See [CHANGELOG.md](CHANGELOG.md) for the release history.
|
|
611
|
+
|
|
163
612
|
## License
|
|
164
613
|
|
|
165
|
-
MIT
|
|
614
|
+
MIT. See [LICENSE](LICENSE).
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
618
|
+
<p align="center"><a href="https://lidless.dev">Part of <strong>Lidless Labs</strong></a> · 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> · <a href="https://github.com/lidless-labs/immichctrl">immichctrl</a> · <a href="https://github.com/lidless-labs/jellyctrl">jellyctrl</a> · <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> · <a href="https://github.com/lidless-labs">Lidless Labs on GitHub</a></sub></p>
|