@bldg-7/proxmox-mcp 0.1.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.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1033 -0
  3. package/dist/client/proxmox.d.ts +14 -0
  4. package/dist/client/proxmox.d.ts.map +1 -0
  5. package/dist/client/proxmox.js +82 -0
  6. package/dist/client/proxmox.js.map +1 -0
  7. package/dist/config/index.d.ts +4 -0
  8. package/dist/config/index.d.ts.map +1 -0
  9. package/dist/config/index.js +24 -0
  10. package/dist/config/index.js.map +1 -0
  11. package/dist/config/schema.d.ts +31 -0
  12. package/dist/config/schema.d.ts.map +1 -0
  13. package/dist/config/schema.js +32 -0
  14. package/dist/config/schema.js.map +1 -0
  15. package/dist/formatters/index.d.ts +42 -0
  16. package/dist/formatters/index.d.ts.map +1 -0
  17. package/dist/formatters/index.js +85 -0
  18. package/dist/formatters/index.js.map +1 -0
  19. package/dist/index.d.ts +3 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +40 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/middleware/index.d.ts +41 -0
  24. package/dist/middleware/index.d.ts.map +1 -0
  25. package/dist/middleware/index.js +69 -0
  26. package/dist/middleware/index.js.map +1 -0
  27. package/dist/prompts/index.d.ts +2 -0
  28. package/dist/prompts/index.d.ts.map +1 -0
  29. package/dist/prompts/index.js +2 -0
  30. package/dist/prompts/index.js.map +1 -0
  31. package/dist/resources/index.d.ts +2 -0
  32. package/dist/resources/index.d.ts.map +1 -0
  33. package/dist/resources/index.js +2 -0
  34. package/dist/resources/index.js.map +1 -0
  35. package/dist/schemas/backup.d.ts +101 -0
  36. package/dist/schemas/backup.d.ts.map +1 -0
  37. package/dist/schemas/backup.js +43 -0
  38. package/dist/schemas/backup.js.map +1 -0
  39. package/dist/schemas/disk.d.ts +144 -0
  40. package/dist/schemas/disk.d.ts.map +1 -0
  41. package/dist/schemas/disk.js +60 -0
  42. package/dist/schemas/disk.js.map +1 -0
  43. package/dist/schemas/index.d.ts +7 -0
  44. package/dist/schemas/index.d.ts.map +1 -0
  45. package/dist/schemas/index.js +7 -0
  46. package/dist/schemas/index.js.map +1 -0
  47. package/dist/schemas/network.d.ts +140 -0
  48. package/dist/schemas/network.d.ts.map +1 -0
  49. package/dist/schemas/network.js +56 -0
  50. package/dist/schemas/network.js.map +1 -0
  51. package/dist/schemas/node.d.ts +16 -0
  52. package/dist/schemas/node.d.ts.map +1 -0
  53. package/dist/schemas/node.js +12 -0
  54. package/dist/schemas/node.js.map +1 -0
  55. package/dist/schemas/snapshot.d.ts +116 -0
  56. package/dist/schemas/snapshot.d.ts.map +1 -0
  57. package/dist/schemas/snapshot.js +34 -0
  58. package/dist/schemas/snapshot.js.map +1 -0
  59. package/dist/schemas/vm.d.ts +330 -0
  60. package/dist/schemas/vm.d.ts.map +1 -0
  61. package/dist/schemas/vm.js +111 -0
  62. package/dist/schemas/vm.js.map +1 -0
  63. package/dist/server.d.ts +5 -0
  64. package/dist/server.d.ts.map +1 -0
  65. package/dist/server.js +142 -0
  66. package/dist/server.js.map +1 -0
  67. package/dist/tools/backup.d.ts +35 -0
  68. package/dist/tools/backup.d.ts.map +1 -0
  69. package/dist/tools/backup.js +210 -0
  70. package/dist/tools/backup.js.map +1 -0
  71. package/dist/tools/cluster.d.ts +15 -0
  72. package/dist/tools/cluster.d.ts.map +1 -0
  73. package/dist/tools/cluster.js +82 -0
  74. package/dist/tools/cluster.js.map +1 -0
  75. package/dist/tools/command.d.ts +6 -0
  76. package/dist/tools/command.d.ts.map +1 -0
  77. package/dist/tools/command.js +26 -0
  78. package/dist/tools/command.js.map +1 -0
  79. package/dist/tools/disk.d.ts +45 -0
  80. package/dist/tools/disk.d.ts.map +1 -0
  81. package/dist/tools/disk.js +243 -0
  82. package/dist/tools/disk.js.map +1 -0
  83. package/dist/tools/index.d.ts +12 -0
  84. package/dist/tools/index.d.ts.map +1 -0
  85. package/dist/tools/index.js +20 -0
  86. package/dist/tools/index.js.map +1 -0
  87. package/dist/tools/network.d.ts +35 -0
  88. package/dist/tools/network.d.ts.map +1 -0
  89. package/dist/tools/network.js +270 -0
  90. package/dist/tools/network.js.map +1 -0
  91. package/dist/tools/node.d.ts +15 -0
  92. package/dist/tools/node.d.ts.map +1 -0
  93. package/dist/tools/node.js +73 -0
  94. package/dist/tools/node.js.map +1 -0
  95. package/dist/tools/registry.d.ts +12 -0
  96. package/dist/tools/registry.d.ts.map +1 -0
  97. package/dist/tools/registry.js +87 -0
  98. package/dist/tools/registry.js.map +1 -0
  99. package/dist/tools/snapshot.d.ts +45 -0
  100. package/dist/tools/snapshot.d.ts.map +1 -0
  101. package/dist/tools/snapshot.js +249 -0
  102. package/dist/tools/snapshot.js.map +1 -0
  103. package/dist/tools/vm-create.d.ts +8 -0
  104. package/dist/tools/vm-create.d.ts.map +1 -0
  105. package/dist/tools/vm-create.js +129 -0
  106. package/dist/tools/vm-create.js.map +1 -0
  107. package/dist/tools/vm-lifecycle.d.ts +67 -0
  108. package/dist/tools/vm-lifecycle.d.ts.map +1 -0
  109. package/dist/tools/vm-lifecycle.js +319 -0
  110. package/dist/tools/vm-lifecycle.js.map +1 -0
  111. package/dist/tools/vm-modify.d.ts +25 -0
  112. package/dist/tools/vm-modify.d.ts.map +1 -0
  113. package/dist/tools/vm-modify.js +155 -0
  114. package/dist/tools/vm-modify.js.map +1 -0
  115. package/dist/tools/vm-query.d.ts +20 -0
  116. package/dist/tools/vm-query.d.ts.map +1 -0
  117. package/dist/tools/vm-query.js +166 -0
  118. package/dist/tools/vm-query.js.map +1 -0
  119. package/dist/types/index.d.ts +5 -0
  120. package/dist/types/index.d.ts.map +1 -0
  121. package/dist/types/index.js +2 -0
  122. package/dist/types/index.js.map +1 -0
  123. package/dist/types/proxmox.d.ts +166 -0
  124. package/dist/types/proxmox.d.ts.map +1 -0
  125. package/dist/types/proxmox.js +2 -0
  126. package/dist/types/proxmox.js.map +1 -0
  127. package/dist/types/tools.d.ts +12 -0
  128. package/dist/types/tools.d.ts.map +1 -0
  129. package/dist/types/tools.js +64 -0
  130. package/dist/types/tools.js.map +1 -0
  131. package/dist/utils/index.d.ts +3 -0
  132. package/dist/utils/index.d.ts.map +1 -0
  133. package/dist/utils/index.js +8 -0
  134. package/dist/utils/index.js.map +1 -0
  135. package/dist/validators/index.d.ts +75 -0
  136. package/dist/validators/index.d.ts.map +1 -0
  137. package/dist/validators/index.js +185 -0
  138. package/dist/validators/index.js.map +1 -0
  139. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,1033 @@
1
+ # Proxmox MCP Server
2
+
3
+ > Model Context Protocol (MCP) server for Proxmox Virtual Environment
4
+
5
+ **English** | [ķ•œźµ­ģ–“](README_ko.md)
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.6-blue.svg)](https://www.typescriptlang.org/)
9
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
10
+
11
+ A comprehensive MCP server providing 55 tools for managing Proxmox Virtual Environment, including QEMU VMs and LXC containers.
12
+
13
+ ## Credits & Background
14
+
15
+ This project is a TypeScript rewrite of [mcp-proxmox-server](https://github.com/canvrno/ProxmoxMCP), which itself was a Node.js port of the original Python implementation by [canvrno/ProxmoxMCP](https://github.com/canvrno/ProxmoxMCP).
16
+
17
+ ### What Changed
18
+
19
+ **Architecture**:
20
+ - 3,147-line single-file monolith → modular TypeScript across 30+ source files
21
+ - No type safety → strict TypeScript with `noUncheckedIndexedAccess`
22
+ - Hand-written JSON Schema → Zod schemas with automatic JSON Schema generation
23
+ - Giant switch statement (55 cases) → tool registry with handler/schema pairs
24
+
25
+ **Quality**:
26
+ - 0 tests → 373 tests (351 unit + 22 integration)
27
+ - No input validation → Zod runtime validation on every tool call
28
+ - Implicit error handling → structured MCP error responses with context
29
+ - No permission checks → two-tier permission model (basic / elevated)
30
+
31
+ **Developer Experience**:
32
+ - `npx @bldg-7/proxmox-mcp` just works
33
+ - All 55 tool descriptions exposed via MCP `ListTools`
34
+ - Rate limiter middleware included
35
+ - Pino structured logging instead of `console.log`
36
+
37
+ ## Features
38
+
39
+ - **55 comprehensive tools** for Proxmox management
40
+ - **Full TypeScript implementation** with strict type safety
41
+ - **Support for both QEMU VMs and LXC containers**
42
+ - **Secure authentication** (password + API token)
43
+ - **Flexible SSL modes** (strict, verify, insecure)
44
+ - **Permission-based access control** (basic vs elevated operations)
45
+ - **Comprehensive error handling** with structured responses
46
+ - **Built on MCP SDK 1.25.3**
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ npm install @bldg-7/proxmox-mcp
52
+ # or
53
+ pnpm add @bldg-7/proxmox-mcp
54
+ # or
55
+ yarn add @bldg-7/proxmox-mcp
56
+ ```
57
+
58
+ ## Configuration
59
+
60
+ ### Environment Variables
61
+
62
+ Set the following environment variables before starting the server:
63
+
64
+ | Variable | Required | Description | Default |
65
+ |----------|----------|-------------|---------|
66
+ | `PROXMOX_HOST` | **Yes** | Proxmox server hostname or IP address | - |
67
+ | `PROXMOX_USER` | **Yes** | Username with realm (e.g., `root@pam`) | - |
68
+ | `PROXMOX_PASSWORD` | **Yes** | User password | - |
69
+ | `PROXMOX_TOKEN_NAME` | **Yes** | API token name | - |
70
+ | `PROXMOX_TOKEN_VALUE` | **Yes** | API token value | - |
71
+ | `PROXMOX_SSL_MODE` | No | SSL verification mode | `strict` |
72
+ | `PROXMOX_ALLOW_ELEVATED` | No | Allow elevated operations | `false` |
73
+ | `PROXMOX_PORT` | No | Proxmox API port | `8006` |
74
+
75
+ ### SSL Modes
76
+
77
+ - **`strict`**: Full SSL certificate verification (recommended for production)
78
+ - **`verify`**: Verify SSL but allow self-signed certificates
79
+ - **`insecure`**: No SSL verification (development only, not recommended)
80
+
81
+ ### Permission Model
82
+
83
+ The server implements a two-tier permission model:
84
+
85
+ - **Basic operations**: Read-only operations (list, get, status) - always allowed
86
+ - **Elevated operations**: Create, modify, delete operations - require `PROXMOX_ALLOW_ELEVATED=true`
87
+
88
+ This prevents accidental destructive operations and provides an additional safety layer.
89
+
90
+ ## Usage
91
+
92
+ ### Starting the Server
93
+
94
+ ```bash
95
+ # With environment variables
96
+ export PROXMOX_HOST=pve.example.com
97
+ export PROXMOX_USER=root@pam
98
+ export PROXMOX_PASSWORD=your-password
99
+ export PROXMOX_TOKEN_NAME=mytoken
100
+ export PROXMOX_TOKEN_VALUE=abc123-def456-ghi789
101
+ export PROXMOX_SSL_MODE=verify
102
+ export PROXMOX_ALLOW_ELEVATED=true
103
+
104
+ npx @bldg-7/proxmox-mcp
105
+ ```
106
+
107
+ ### Using with Claude Desktop
108
+
109
+ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
110
+
111
+ ```json
112
+ {
113
+ "mcpServers": {
114
+ "proxmox": {
115
+ "command": "npx",
116
+ "args": ["-y", "@bldg-7/proxmox-mcp"],
117
+ "env": {
118
+ "PROXMOX_HOST": "pve.example.com",
119
+ "PROXMOX_USER": "root@pam",
120
+ "PROXMOX_PASSWORD": "your-password",
121
+ "PROXMOX_TOKEN_NAME": "mytoken",
122
+ "PROXMOX_TOKEN_VALUE": "abc123-def456-ghi789",
123
+ "PROXMOX_SSL_MODE": "verify",
124
+ "PROXMOX_ALLOW_ELEVATED": "true"
125
+ }
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ ## Available Tools
132
+
133
+ ### Node & Cluster Management (4 tools)
134
+
135
+ #### `proxmox_get_nodes`
136
+ List all Proxmox cluster nodes with their status and resources.
137
+
138
+ **Parameters**: None
139
+
140
+ **Example**:
141
+ ```json
142
+ {}
143
+ ```
144
+
145
+ #### `proxmox_get_node_status` šŸ”’
146
+ Get detailed status information for a specific Proxmox node.
147
+
148
+ **Parameters**:
149
+ - `node` (string): Node name
150
+
151
+ **Example**:
152
+ ```json
153
+ {
154
+ "node": "pve1"
155
+ }
156
+ ```
157
+
158
+ #### `proxmox_get_cluster_status`
159
+ Get overall cluster status including nodes and resource usage.
160
+
161
+ **Parameters**: None
162
+
163
+ **Example**:
164
+ ```json
165
+ {}
166
+ ```
167
+
168
+ #### `proxmox_get_next_vmid`
169
+ Get the next available VM/Container ID number.
170
+
171
+ **Parameters**: None
172
+
173
+ **Example**:
174
+ ```json
175
+ {}
176
+ ```
177
+
178
+ ---
179
+
180
+ ### VM Query (3 tools)
181
+
182
+ #### `proxmox_get_vms`
183
+ List all virtual machines across the cluster with their status.
184
+
185
+ **Parameters**:
186
+ - `node` (string, optional): Filter by specific node
187
+ - `type` (string, optional): Filter by type (`qemu` or `lxc`)
188
+
189
+ **Example**:
190
+ ```json
191
+ {
192
+ "node": "pve1",
193
+ "type": "qemu"
194
+ }
195
+ ```
196
+
197
+ #### `proxmox_get_vm_status`
198
+ Get detailed status information for a specific VM.
199
+
200
+ **Parameters**:
201
+ - `node` (string): Node name
202
+ - `vmid` (number): VM/Container ID
203
+ - `type` (string): VM type (`qemu` or `lxc`)
204
+
205
+ **Example**:
206
+ ```json
207
+ {
208
+ "node": "pve1",
209
+ "vmid": 100,
210
+ "type": "qemu"
211
+ }
212
+ ```
213
+
214
+ #### `proxmox_get_storage`
215
+ List all storage pools and their usage across the cluster.
216
+
217
+ **Parameters**:
218
+ - `node` (string, optional): Filter by specific node
219
+
220
+ **Example**:
221
+ ```json
222
+ {
223
+ "node": "pve1"
224
+ }
225
+ ```
226
+
227
+ ---
228
+
229
+ ### VM Lifecycle (12 tools) šŸ”’
230
+
231
+ All lifecycle operations require elevated permissions.
232
+
233
+ #### `proxmox_start_lxc` šŸ”’
234
+ Start an LXC container.
235
+
236
+ **Parameters**:
237
+ - `node` (string): Node name
238
+ - `vmid` (number): Container ID
239
+
240
+ **Example**:
241
+ ```json
242
+ {
243
+ "node": "pve1",
244
+ "vmid": 100
245
+ }
246
+ ```
247
+
248
+ #### `proxmox_start_vm` šŸ”’
249
+ Start a QEMU virtual machine.
250
+
251
+ **Parameters**:
252
+ - `node` (string): Node name
253
+ - `vmid` (number): VM ID
254
+
255
+ **Example**:
256
+ ```json
257
+ {
258
+ "node": "pve1",
259
+ "vmid": 101
260
+ }
261
+ ```
262
+
263
+ #### `proxmox_stop_lxc` šŸ”’
264
+ Stop an LXC container (forceful).
265
+
266
+ **Parameters**:
267
+ - `node` (string): Node name
268
+ - `vmid` (number): Container ID
269
+
270
+ #### `proxmox_stop_vm` šŸ”’
271
+ Stop a QEMU virtual machine (forceful).
272
+
273
+ **Parameters**:
274
+ - `node` (string): Node name
275
+ - `vmid` (number): VM ID
276
+
277
+ #### `proxmox_shutdown_lxc` šŸ”’
278
+ Gracefully shutdown an LXC container.
279
+
280
+ **Parameters**:
281
+ - `node` (string): Node name
282
+ - `vmid` (number): Container ID
283
+
284
+ #### `proxmox_shutdown_vm` šŸ”’
285
+ Gracefully shutdown a QEMU virtual machine.
286
+
287
+ **Parameters**:
288
+ - `node` (string): Node name
289
+ - `vmid` (number): VM ID
290
+
291
+ #### `proxmox_reboot_lxc` šŸ”’
292
+ Reboot an LXC container.
293
+
294
+ **Parameters**:
295
+ - `node` (string): Node name
296
+ - `vmid` (number): Container ID
297
+
298
+ #### `proxmox_reboot_vm` šŸ”’
299
+ Reboot a QEMU virtual machine.
300
+
301
+ **Parameters**:
302
+ - `node` (string): Node name
303
+ - `vmid` (number): VM ID
304
+
305
+ #### `proxmox_pause_vm` šŸ”’
306
+ Pause a QEMU virtual machine (suspend to RAM).
307
+
308
+ **Parameters**:
309
+ - `node` (string): Node name
310
+ - `vmid` (number): VM ID
311
+
312
+ #### `proxmox_resume_vm` šŸ”’
313
+ Resume a paused QEMU virtual machine.
314
+
315
+ **Parameters**:
316
+ - `node` (string): Node name
317
+ - `vmid` (number): VM ID
318
+
319
+ #### `proxmox_delete_lxc` šŸ”’
320
+ Delete an LXC container permanently.
321
+
322
+ **Parameters**:
323
+ - `node` (string): Node name
324
+ - `vmid` (number): Container ID
325
+
326
+ #### `proxmox_delete_vm` šŸ”’
327
+ Delete a QEMU virtual machine permanently.
328
+
329
+ **Parameters**:
330
+ - `node` (string): Node name
331
+ - `vmid` (number): VM ID
332
+
333
+ ---
334
+
335
+ ### VM Modify (4 tools) šŸ”’
336
+
337
+ #### `proxmox_clone_lxc` šŸ”’
338
+ Clone an LXC container.
339
+
340
+ **Parameters**:
341
+ - `node` (string): Node name
342
+ - `vmid` (number): Source container ID
343
+ - `newid` (number): New container ID
344
+ - `hostname` (string, optional): New hostname
345
+
346
+ **Example**:
347
+ ```json
348
+ {
349
+ "node": "pve1",
350
+ "vmid": 100,
351
+ "newid": 200,
352
+ "hostname": "cloned-container"
353
+ }
354
+ ```
355
+
356
+ #### `proxmox_clone_vm` šŸ”’
357
+ Clone a QEMU virtual machine.
358
+
359
+ **Parameters**:
360
+ - `node` (string): Node name
361
+ - `vmid` (number): Source VM ID
362
+ - `newid` (number): New VM ID
363
+ - `name` (string, optional): New VM name
364
+
365
+ **Example**:
366
+ ```json
367
+ {
368
+ "node": "pve1",
369
+ "vmid": 101,
370
+ "newid": 201,
371
+ "name": "cloned-vm"
372
+ }
373
+ ```
374
+
375
+ #### `proxmox_resize_lxc` šŸ”’
376
+ Resize an LXC container CPU/memory.
377
+
378
+ **Parameters**:
379
+ - `node` (string): Node name
380
+ - `vmid` (number): Container ID
381
+ - `memory` (number, optional): Memory in MB
382
+ - `cores` (number, optional): Number of CPU cores
383
+
384
+ **Example**:
385
+ ```json
386
+ {
387
+ "node": "pve1",
388
+ "vmid": 100,
389
+ "memory": 2048,
390
+ "cores": 2
391
+ }
392
+ ```
393
+
394
+ #### `proxmox_resize_vm` šŸ”’
395
+ Resize a QEMU VM CPU/memory.
396
+
397
+ **Parameters**:
398
+ - `node` (string): Node name
399
+ - `vmid` (number): VM ID
400
+ - `memory` (number, optional): Memory in MB
401
+ - `cores` (number, optional): Number of CPU cores
402
+
403
+ ---
404
+
405
+ ### Snapshots (8 tools)
406
+
407
+ #### `proxmox_create_snapshot_lxc` šŸ”’
408
+ Create a snapshot of an LXC container.
409
+
410
+ **Parameters**:
411
+ - `node` (string): Node name
412
+ - `vmid` (number): Container ID
413
+ - `snapname` (string): Snapshot name
414
+ - `description` (string, optional): Snapshot description
415
+
416
+ **Example**:
417
+ ```json
418
+ {
419
+ "node": "pve1",
420
+ "vmid": 100,
421
+ "snapname": "before-update",
422
+ "description": "Snapshot before system update"
423
+ }
424
+ ```
425
+
426
+ #### `proxmox_create_snapshot_vm` šŸ”’
427
+ Create a snapshot of a QEMU virtual machine.
428
+
429
+ **Parameters**:
430
+ - `node` (string): Node name
431
+ - `vmid` (number): VM ID
432
+ - `snapname` (string): Snapshot name
433
+ - `description` (string, optional): Snapshot description
434
+
435
+ #### `proxmox_list_snapshots_lxc`
436
+ List all snapshots of an LXC container.
437
+
438
+ **Parameters**:
439
+ - `node` (string): Node name
440
+ - `vmid` (number): Container ID
441
+
442
+ **Example**:
443
+ ```json
444
+ {
445
+ "node": "pve1",
446
+ "vmid": 100
447
+ }
448
+ ```
449
+
450
+ #### `proxmox_list_snapshots_vm`
451
+ List all snapshots of a QEMU virtual machine.
452
+
453
+ **Parameters**:
454
+ - `node` (string): Node name
455
+ - `vmid` (number): VM ID
456
+
457
+ #### `proxmox_rollback_snapshot_lxc` šŸ”’
458
+ Rollback an LXC container to a snapshot.
459
+
460
+ **Parameters**:
461
+ - `node` (string): Node name
462
+ - `vmid` (number): Container ID
463
+ - `snapname` (string): Snapshot name
464
+
465
+ **Example**:
466
+ ```json
467
+ {
468
+ "node": "pve1",
469
+ "vmid": 100,
470
+ "snapname": "before-update"
471
+ }
472
+ ```
473
+
474
+ #### `proxmox_rollback_snapshot_vm` šŸ”’
475
+ Rollback a QEMU virtual machine to a snapshot.
476
+
477
+ **Parameters**:
478
+ - `node` (string): Node name
479
+ - `vmid` (number): VM ID
480
+ - `snapname` (string): Snapshot name
481
+
482
+ #### `proxmox_delete_snapshot_lxc` šŸ”’
483
+ Delete a snapshot of an LXC container.
484
+
485
+ **Parameters**:
486
+ - `node` (string): Node name
487
+ - `vmid` (number): Container ID
488
+ - `snapname` (string): Snapshot name
489
+
490
+ #### `proxmox_delete_snapshot_vm` šŸ”’
491
+ Delete a snapshot of a QEMU virtual machine.
492
+
493
+ **Parameters**:
494
+ - `node` (string): Node name
495
+ - `vmid` (number): VM ID
496
+ - `snapname` (string): Snapshot name
497
+
498
+ ---
499
+
500
+ ### Backups (6 tools) šŸ”’
501
+
502
+ All backup operations require elevated permissions.
503
+
504
+ #### `proxmox_create_backup_lxc` šŸ”’
505
+ Create a backup of an LXC container.
506
+
507
+ **Parameters**:
508
+ - `node` (string): Node name
509
+ - `vmid` (number): Container ID
510
+ - `storage` (string, optional): Storage name (default: `local`)
511
+ - `mode` (string, optional): Backup mode: `snapshot`, `suspend`, `stop` (default: `snapshot`)
512
+ - `compress` (string, optional): Compression: `none`, `lzo`, `gzip`, `zstd` (default: `zstd`)
513
+
514
+ **Example**:
515
+ ```json
516
+ {
517
+ "node": "pve1",
518
+ "vmid": 100,
519
+ "storage": "backup-storage",
520
+ "mode": "snapshot",
521
+ "compress": "zstd"
522
+ }
523
+ ```
524
+
525
+ #### `proxmox_create_backup_vm` šŸ”’
526
+ Create a backup of a QEMU virtual machine.
527
+
528
+ **Parameters**: Same as `proxmox_create_backup_lxc`
529
+
530
+ #### `proxmox_list_backups` šŸ”’
531
+ List all backups on a storage.
532
+
533
+ **Parameters**:
534
+ - `node` (string): Node name
535
+ - `storage` (string): Storage name
536
+
537
+ **Example**:
538
+ ```json
539
+ {
540
+ "node": "pve1",
541
+ "storage": "backup-storage"
542
+ }
543
+ ```
544
+
545
+ #### `proxmox_restore_backup_lxc` šŸ”’
546
+ Restore an LXC container from backup.
547
+
548
+ **Parameters**:
549
+ - `node` (string): Node name
550
+ - `vmid` (number): New container ID
551
+ - `archive` (string): Backup archive path (e.g., `local:backup/vzdump-lxc-100-...`)
552
+ - `storage` (string, optional): Target storage for restored container
553
+
554
+ **Example**:
555
+ ```json
556
+ {
557
+ "node": "pve1",
558
+ "vmid": 300,
559
+ "archive": "local:backup/vzdump-lxc-100-2024_01_01-12_00_00.tar.zst",
560
+ "storage": "local-lvm"
561
+ }
562
+ ```
563
+
564
+ #### `proxmox_restore_backup_vm` šŸ”’
565
+ Restore a QEMU virtual machine from backup.
566
+
567
+ **Parameters**: Same as `proxmox_restore_backup_lxc`
568
+
569
+ #### `proxmox_delete_backup` šŸ”’
570
+ Delete a backup file from storage.
571
+
572
+ **Parameters**:
573
+ - `node` (string): Node name
574
+ - `storage` (string): Storage name
575
+ - `volume` (string): Volume ID (e.g., `local:backup/vzdump-lxc-100-...`)
576
+
577
+ **Example**:
578
+ ```json
579
+ {
580
+ "node": "pve1",
581
+ "storage": "local",
582
+ "volume": "local:backup/vzdump-lxc-100-2024_01_01-12_00_00.tar.zst"
583
+ }
584
+ ```
585
+
586
+ ---
587
+
588
+ ### Disks (8 tools) šŸ”’
589
+
590
+ All disk operations require elevated permissions.
591
+
592
+ #### `proxmox_add_disk_vm` šŸ”’
593
+ Add a new disk to a QEMU virtual machine.
594
+
595
+ **Parameters**:
596
+ - `node` (string): Node name
597
+ - `vmid` (number): VM ID
598
+ - `disk` (string): Disk ID (e.g., `scsi0`, `virtio0`, `sata0`, `ide0`)
599
+ - `storage` (string): Storage name
600
+ - `size` (string): Disk size (e.g., `10` for 10GB)
601
+
602
+ **Example**:
603
+ ```json
604
+ {
605
+ "node": "pve1",
606
+ "vmid": 101,
607
+ "disk": "scsi1",
608
+ "storage": "local-lvm",
609
+ "size": "50"
610
+ }
611
+ ```
612
+
613
+ #### `proxmox_add_mountpoint_lxc` šŸ”’
614
+ Add a mount point to an LXC container.
615
+
616
+ **Parameters**:
617
+ - `node` (string): Node name
618
+ - `vmid` (number): Container ID
619
+ - `mp` (string): Mount point ID (e.g., `mp0`, `mp1`)
620
+ - `storage` (string): Storage name
621
+ - `size` (string): Size (e.g., `10` for 10GB)
622
+
623
+ **Example**:
624
+ ```json
625
+ {
626
+ "node": "pve1",
627
+ "vmid": 100,
628
+ "mp": "mp0",
629
+ "storage": "local-lvm",
630
+ "size": "20"
631
+ }
632
+ ```
633
+
634
+ #### `proxmox_resize_disk_vm` šŸ”’
635
+ Resize a QEMU VM disk (expansion only).
636
+
637
+ **Parameters**:
638
+ - `node` (string): Node name
639
+ - `vmid` (number): VM ID
640
+ - `disk` (string): Disk ID
641
+ - `size` (string): New size (e.g., `+10G` to add 10GB, or `50G` for absolute size)
642
+
643
+ **Example**:
644
+ ```json
645
+ {
646
+ "node": "pve1",
647
+ "vmid": 101,
648
+ "disk": "scsi0",
649
+ "size": "+20G"
650
+ }
651
+ ```
652
+
653
+ #### `proxmox_resize_disk_lxc` šŸ”’
654
+ Resize an LXC container disk or mount point (expansion only).
655
+
656
+ **Parameters**: Same as `proxmox_resize_disk_vm`
657
+
658
+ #### `proxmox_remove_disk_vm` šŸ”’
659
+ Remove a disk from a QEMU virtual machine.
660
+
661
+ **Parameters**:
662
+ - `node` (string): Node name
663
+ - `vmid` (number): VM ID
664
+ - `disk` (string): Disk ID
665
+
666
+ **Example**:
667
+ ```json
668
+ {
669
+ "node": "pve1",
670
+ "vmid": 101,
671
+ "disk": "scsi1"
672
+ }
673
+ ```
674
+
675
+ #### `proxmox_remove_mountpoint_lxc` šŸ”’
676
+ Remove a mount point from an LXC container.
677
+
678
+ **Parameters**:
679
+ - `node` (string): Node name
680
+ - `vmid` (number): Container ID
681
+ - `mp` (string): Mount point ID
682
+
683
+ #### `proxmox_move_disk_vm` šŸ”’
684
+ Move a QEMU VM disk to different storage.
685
+
686
+ **Parameters**:
687
+ - `node` (string): Node name
688
+ - `vmid` (number): VM ID
689
+ - `disk` (string): Disk ID
690
+ - `storage` (string): Target storage name
691
+ - `delete` (boolean, optional): Delete source after move (default: `true`)
692
+
693
+ **Example**:
694
+ ```json
695
+ {
696
+ "node": "pve1",
697
+ "vmid": 101,
698
+ "disk": "scsi0",
699
+ "storage": "fast-ssd",
700
+ "delete": true
701
+ }
702
+ ```
703
+
704
+ #### `proxmox_move_disk_lxc` šŸ”’
705
+ Move an LXC container disk to different storage.
706
+
707
+ **Parameters**: Same as `proxmox_move_disk_vm`
708
+
709
+ ---
710
+
711
+ ### Network (6 tools) šŸ”’
712
+
713
+ All network operations require elevated permissions.
714
+
715
+ #### `proxmox_add_network_vm` šŸ”’
716
+ Add network interface to QEMU VM.
717
+
718
+ **Parameters**:
719
+ - `node` (string): Node name
720
+ - `vmid` (number): VM ID
721
+ - `net` (string): Network interface ID (e.g., `net0`, `net1`)
722
+ - `bridge` (string): Bridge name (e.g., `vmbr0`)
723
+ - `model` (string, optional): Network model: `virtio`, `e1000`, `rtl8139`, `vmxnet3`
724
+ - `macaddr` (string, optional): MAC address
725
+ - `tag` (number, optional): VLAN tag
726
+ - `firewall` (boolean, optional): Enable firewall
727
+
728
+ **Example**:
729
+ ```json
730
+ {
731
+ "node": "pve1",
732
+ "vmid": 101,
733
+ "net": "net1",
734
+ "bridge": "vmbr0",
735
+ "model": "virtio",
736
+ "tag": 100,
737
+ "firewall": true
738
+ }
739
+ ```
740
+
741
+ #### `proxmox_add_network_lxc` šŸ”’
742
+ Add network interface to LXC container.
743
+
744
+ **Parameters**:
745
+ - `node` (string): Node name
746
+ - `vmid` (number): Container ID
747
+ - `net` (string): Network interface ID (e.g., `net0`, `net1`)
748
+ - `bridge` (string): Bridge name
749
+ - `ip` (string, optional): IP address with CIDR (e.g., `192.168.1.100/24`) or `dhcp`
750
+ - `gw` (string, optional): Gateway IP
751
+ - `firewall` (boolean, optional): Enable firewall
752
+
753
+ **Example**:
754
+ ```json
755
+ {
756
+ "node": "pve1",
757
+ "vmid": 100,
758
+ "net": "net1",
759
+ "bridge": "vmbr0",
760
+ "ip": "192.168.1.100/24",
761
+ "gw": "192.168.1.1",
762
+ "firewall": true
763
+ }
764
+ ```
765
+
766
+ #### `proxmox_update_network_vm` šŸ”’
767
+ Update/modify VM network interface configuration.
768
+
769
+ **Parameters**: Same as `proxmox_add_network_vm` (updates existing interface)
770
+
771
+ #### `proxmox_update_network_lxc` šŸ”’
772
+ Update/modify LXC network interface configuration.
773
+
774
+ **Parameters**: Same as `proxmox_add_network_lxc` (updates existing interface)
775
+
776
+ #### `proxmox_remove_network_vm` šŸ”’
777
+ Remove network interface from QEMU VM.
778
+
779
+ **Parameters**:
780
+ - `node` (string): Node name
781
+ - `vmid` (number): VM ID
782
+ - `net` (string): Network interface ID
783
+
784
+ **Example**:
785
+ ```json
786
+ {
787
+ "node": "pve1",
788
+ "vmid": 101,
789
+ "net": "net1"
790
+ }
791
+ ```
792
+
793
+ #### `proxmox_remove_network_lxc` šŸ”’
794
+ Remove network interface from LXC container.
795
+
796
+ **Parameters**: Same as `proxmox_remove_network_vm`
797
+
798
+ ---
799
+
800
+ ### Command Execution (1 tool) šŸ”’
801
+
802
+ #### `proxmox_execute_vm_command` šŸ”’
803
+ Execute a shell command on a virtual machine via Proxmox API.
804
+
805
+ **Parameters**:
806
+ - `node` (string): Node name
807
+ - `vmid` (number): VM/Container ID
808
+ - `type` (string): VM type (`qemu` or `lxc`)
809
+ - `command` (string): Shell command to execute
810
+
811
+ **Example**:
812
+ ```json
813
+ {
814
+ "node": "pve1",
815
+ "vmid": 101,
816
+ "type": "qemu",
817
+ "command": "uptime"
818
+ }
819
+ ```
820
+
821
+ **Note**: Command validation blocks potentially dangerous characters for security.
822
+
823
+ ---
824
+
825
+ ### VM Creation (3 tools)
826
+
827
+ #### `proxmox_list_templates`
828
+ List available LXC container templates on a storage.
829
+
830
+ **Parameters**:
831
+ - `node` (string): Node name
832
+ - `storage` (string): Storage name
833
+
834
+ **Example**:
835
+ ```json
836
+ {
837
+ "node": "pve1",
838
+ "storage": "local"
839
+ }
840
+ ```
841
+
842
+ #### `proxmox_create_lxc` šŸ”’
843
+ Create a new LXC container.
844
+
845
+ **Parameters**:
846
+ - `node` (string): Node name
847
+ - `vmid` (number): Container ID
848
+ - `ostemplate` (string): Template path (e.g., `local:vztmpl/debian-12-standard_12.2-1_amd64.tar.gz`)
849
+ - `hostname` (string): Container hostname
850
+ - `password` (string, optional): Root password (auto-generated if not provided)
851
+ - `memory` (number, optional): Memory in MB (default: 512)
852
+ - `storage` (string, optional): Storage name (default: `local-lvm`)
853
+ - `rootfs_size` (string, optional): Root filesystem size in GB (default: `8`)
854
+
855
+ **Example**:
856
+ ```json
857
+ {
858
+ "node": "pve1",
859
+ "vmid": 100,
860
+ "ostemplate": "local:vztmpl/debian-12-standard_12.2-1_amd64.tar.gz",
861
+ "hostname": "my-container",
862
+ "password": "SecurePassword123!",
863
+ "memory": 1024,
864
+ "storage": "local-lvm",
865
+ "rootfs_size": "16"
866
+ }
867
+ ```
868
+
869
+ #### `proxmox_create_vm` šŸ”’
870
+ Create a new QEMU virtual machine.
871
+
872
+ **Parameters**:
873
+ - `node` (string): Node name
874
+ - `vmid` (number): VM ID
875
+ - `name` (string): VM name
876
+ - `memory` (number, optional): Memory in MB (default: 512)
877
+ - `cores` (number, optional): CPU cores (default: 1)
878
+ - `sockets` (number, optional): CPU sockets (default: 1)
879
+ - `disk_size` (string, optional): Disk size (e.g., `20G`) (default: `8G`)
880
+ - `storage` (string, optional): Storage name (default: `local-lvm`)
881
+ - `iso` (string, optional): ISO image path (e.g., `local:iso/debian-12.2-amd64-netinst.iso`)
882
+ - `ostype` (string, optional): OS type (default: `l26` for Linux 2.6+)
883
+ - `bridge` (string, optional): Network bridge (default: `vmbr0`)
884
+
885
+ **Example**:
886
+ ```json
887
+ {
888
+ "node": "pve1",
889
+ "vmid": 101,
890
+ "name": "my-vm",
891
+ "memory": 2048,
892
+ "cores": 2,
893
+ "sockets": 1,
894
+ "disk_size": "50G",
895
+ "storage": "local-lvm",
896
+ "iso": "local:iso/debian-12.2-amd64-netinst.iso",
897
+ "ostype": "l26",
898
+ "bridge": "vmbr0"
899
+ }
900
+ ```
901
+
902
+ ---
903
+
904
+ ## Error Handling
905
+
906
+ All tools return structured responses following the MCP protocol:
907
+
908
+ ### Success Response
909
+ ```json
910
+ {
911
+ "content": [
912
+ {
913
+ "type": "text",
914
+ "text": "āœ… Operation completed successfully\n\n• Details here..."
915
+ }
916
+ ],
917
+ "isError": false
918
+ }
919
+ ```
920
+
921
+ ### Error Response
922
+ ```json
923
+ {
924
+ "content": [
925
+ {
926
+ "type": "text",
927
+ "text": "āŒ Error: Operation failed\n\nReason: Detailed error message"
928
+ }
929
+ ],
930
+ "isError": true
931
+ }
932
+ ```
933
+
934
+ ### Permission Denied
935
+ ```json
936
+ {
937
+ "content": [
938
+ {
939
+ "type": "text",
940
+ "text": "🚫 Permission Denied: Operation requires elevated permissions\n\nSet PROXMOX_ALLOW_ELEVATED=true to enable this operation."
941
+ }
942
+ ],
943
+ "isError": true
944
+ }
945
+ ```
946
+
947
+ ## Troubleshooting
948
+
949
+ ### Connection Issues
950
+
951
+ **Problem**: `ECONNREFUSED` or connection timeout
952
+
953
+ **Solutions**:
954
+ - Verify `PROXMOX_HOST` is correct and reachable
955
+ - Check `PROXMOX_PORT` (default: 8006)
956
+ - Ensure firewall allows connections to Proxmox API port
957
+ - Try `PROXMOX_SSL_MODE=insecure` for testing (not recommended for production)
958
+
959
+ ### Authentication Errors
960
+
961
+ **Problem**: `401 Unauthorized` or authentication failed
962
+
963
+ **Solutions**:
964
+ - Verify `PROXMOX_USER` includes realm (e.g., `root@pam`, not just `root`)
965
+ - Check `PROXMOX_PASSWORD` is correct
966
+ - Verify `PROXMOX_TOKEN_NAME` and `PROXMOX_TOKEN_VALUE` are valid
967
+ - Ensure API token has sufficient permissions in Proxmox
968
+
969
+ ### SSL Certificate Errors
970
+
971
+ **Problem**: `UNABLE_TO_VERIFY_LEAF_SIGNATURE` or SSL errors
972
+
973
+ **Solutions**:
974
+ - Use `PROXMOX_SSL_MODE=verify` for self-signed certificates
975
+ - Use `PROXMOX_SSL_MODE=insecure` for development (not recommended for production)
976
+ - Install proper SSL certificates on Proxmox server for production use
977
+
978
+ ### Permission Denied Errors
979
+
980
+ **Problem**: `🚫 Permission Denied` for operations
981
+
982
+ **Solutions**:
983
+ - Set `PROXMOX_ALLOW_ELEVATED=true` to enable elevated operations
984
+ - Review which operations require elevated permissions (marked with šŸ”’)
985
+ - Ensure this is intentional - elevated operations can modify/delete resources
986
+
987
+ ## Development
988
+
989
+ ### Building from Source
990
+
991
+ ```bash
992
+ git clone https://github.com/Bldg-7/proxmox-mcp.git
993
+ cd proxmox-mcp
994
+ pnpm install
995
+ pnpm build
996
+ ```
997
+
998
+ ### Running Tests
999
+
1000
+ ```bash
1001
+ pnpm test # Run tests once
1002
+ pnpm test:watch # Run tests in watch mode
1003
+ pnpm test:coverage # Run tests with coverage report
1004
+ ```
1005
+
1006
+ ### Type Checking
1007
+
1008
+ ```bash
1009
+ pnpm typecheck # Type check without emitting files
1010
+ ```
1011
+
1012
+ ### Linting
1013
+
1014
+ ```bash
1015
+ pnpm lint # Run ESLint
1016
+ ```
1017
+
1018
+ ## Contributing
1019
+
1020
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
1021
+
1022
+ ## License
1023
+
1024
+ MIT License - see [LICENSE](LICENSE) file for details.
1025
+
1026
+ ## Acknowledgments
1027
+
1028
+ - Built with [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk)
1029
+ - Powered by [Proxmox Virtual Environment](https://www.proxmox.com/en/proxmox-virtual-environment)
1030
+
1031
+ ---
1032
+
1033
+ **Legend**: šŸ”’ = Requires elevated permissions (`PROXMOX_ALLOW_ELEVATED=true`)