Skip to main content
Glama
jmerelnyc

proxmox-mcp

by jmerelnyc

proxmox-mcp

license status python proxmox mcp openapi

通过 MCP 和 OpenAPI 控制 Proxmox VE 虚拟机

目录

安装

pip install proxmox-mcp

使用

from proxmox_mcp import ProxmoxMCP

# initialize client
client = ProxmoxMCP(
    host="proxmox.example.com",
    user="root@pam",
    password="your_password"
)

# list all vms
vms = client.list_vms()
for vm in vms:
    print(f"{vm.vmid}: {vm.name} - {vm.status}")

# start a vm
client.start_vm(vmid=100)

# get vm status
status = client.get_vm_status(vmid=100)
print(f"VM 100 is {status}")

# create snapshot
client.create_snapshot(vmid=100, snapname="backup-2024")

# clone vm
client.clone_vm(vmid=100, newid=101, name="clone-vm")

API

方法

描述

参数

list_vms()

获取所有节点上的所有虚拟机

get_vm_status(vmid)

获取当前虚拟机状态

vmid: int

start_vm(vmid)

启动虚拟机

vmid: int

stop_vm(vmid)

停止虚拟机

vmid: int

restart_vm(vmid)

重启虚拟机

vmid: int

shutdown_vm(vmid)

优雅关机

vmid: int

create_snapshot(vmid, snapname)

创建虚拟机快照

vmid: int, snapname: str

delete_snapshot(vmid, snapname)

删除虚拟机快照

vmid: int, snapname: str

clone_vm(vmid, newid, name)

克隆虚拟机

vmid: int, newid: int, name: str

get_vm_config(vmid)

获取虚拟机配置

vmid: int

update_vm_config(vmid, config)

更新虚拟机设置

vmid: int, config: dict

MCP 集成

该库通过模型上下文协议 (Model Context Protocol) 公开 Proxmox 操作,允许 AI 助手直接管理虚拟机。

# mcp server mode
from proxmox_mcp.server import run_mcp_server

run_mcp_server(
    host="proxmox.example.com",
    user="root@pam",
    password="your_password",
    port=8080
)

OpenAPI 规范

在服务器模式下运行时,可通过 /openapi.json 获取 OpenAPI 3.0 规范。可将其导入 Postman 等工具或生成其他语言的客户端。

贡献

欢迎提交 PR。重大更改请先开启 issue。

许可证

MIT

A
license - permissive license
-
quality - not tested
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
2Releases (12mo)

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jmerelnyc/proxmox-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server