Nutanix MCP Server
Nutanix MCP 服务器
一个 MCP (Model Context Protocol) 服务器,将 Nutanix Prism Central 和 Prism Element API 作为工具暴露给 GitHub Copilot、Claude 等 AI 助手使用。
功能特性
Prism Central (v4 API) — 虚拟机管理、集群清单、主机管理
Prism Element (v2 API) — 直接访问集群以获取存储、磁盘、告警、保护域信息
竣工报告 (As-Built Reports) — 生成包含 Excalidraw 图表的全面 Markdown 文档,支持环境、集群或虚拟机范围
API 版本路由 — 优先使用 v4,必要时回退至 v3/v2
异步 — 使用 httpx 的非阻塞 HTTP 客户端
Related MCP server: ProxmoxEmCP
可用工具
虚拟机管理 (Prism Central v4)
工具 | 描述 |
| 使用 OData 过滤列出虚拟机 |
| 通过 UUID 获取完整的虚拟机配置 |
| 开启虚拟机 |
| 关闭虚拟机 (ACPI 或强制关闭) |
| 创建新虚拟机 |
集群管理 (Prism Central v4)
工具 | 描述 |
| 列出已注册的集群 |
| 获取集群详情 |
| 列出管理程序主机 |
| 获取主机详情 |
| 列出存储容器 |
网络与镜像 (Prism Central v4)
工具 | 描述 |
| 列出包含 CIDR、VLAN ID 和集群信息的子网/VLAN |
| 获取子网详情,包括 IP 池和 DHCP 配置 |
| 列出镜像库中的磁盘镜像 (ISO, QCOW2) |
| 获取镜像详情 — 大小、类型、来源 |
| 列出用于资源标记的类别键和值 |
| 获取特定类别键的所有值 |
Prism Element (v2 — 直接集群访问)
工具 | 描述 |
| 集群健康状况、版本和容量 |
| 特定 PE 集群上的虚拟机 |
| 包含硬件详情的主机 |
| 包含复制信息的存储容器 |
| 存储池和磁盘组成 |
| 物理磁盘清单和状态 |
| 活动/已解决的告警 |
| 数据保护策略 |
| 每个保护域的快照 |
竣工报告
工具 | 描述 |
| 完整环境报告 — 所有集群、主机、存储、网络、虚拟机及拓扑图 |
| 一个或多个集群的详细报告 — 配置、主机、容器、子网、虚拟机及架构图 |
| 特定虚拟机的详细报告 — 计算、磁盘、网卡、类别、引导配置及布局图 |
报告输出 Markdown 文档和用于视觉拓扑表示的 Excalidraw JSON 图表。
MCP 资源 (基于 URI 的浏览)
服务器通过 nutanix:// URI 暴露资源,允许 LLM 在无需显式调用工具的情况下浏览实体:
URI 模式 | 描述 |
| 浏览所有虚拟机 |
| 获取特定虚拟机 |
| 浏览所有集群 |
| 获取特定集群 |
| 获取特定主机 |
| 获取特定子网 |
| 获取特定镜像 |
MCP 提示词
提示词 | 描述 |
| 交互式凭据配置 (针对不支持环境变量的客户端) |
| 指导性环境概览 — 集群、主机、存储、告警 |
设置
先决条件
Python 3.10+
可访问 Prism Central 实例的网络 (端口 9440)
具有 API 访问权限的 Nutanix 凭据
安装
cd mcp/nutanix-mcp-server
pip install -e .或者安装开发依赖:
pip install -e ".[dev]"配置
将 .env.example 复制为 .env 并填入您的凭据:
cp .env.example .envNUTANIX_HOST=your-prism-central.example.com
NUTANIX_PORT=9440
NUTANIX_USERNAME=your-username
NUTANIX_PASSWORD=your-password
NUTANIX_VERIFY_SSL=true
NUTANIX_TIMEOUT=30运行
nutanix-mcp或者直接运行:
python -m nutanix_mcpMCP 客户端配置
此服务器使用 stdio 传输 — 它通过 stdin/stdout 进行通信。每个客户端配置一个命令来启动服务器进程。
提示: 将凭据存储在环境变量或
.env文件中,切勿存储在提交到源代码控制的配置文件中。
Claude Code (CLI)
使用 claude mcp add 命令将服务器添加到您的项目中:
claude mcp add nutanix -- python -m nutanix_mcp或者手动在项目根目录创建/编辑 .mcp.json:
{
"mcpServers": {
"nutanix": {
"type": "stdio",
"command": "python",
"args": ["-m", "nutanix_mcp"],
"cwd": "/path/to/mcp/nutanix-mcp-server",
"env": {
"NUTANIX_HOST": "your-prism-central.example.com",
"NUTANIX_USERNAME": "your-username",
"NUTANIX_PASSWORD": "your-password",
"NUTANIX_VERIFY_SSL": "true"
}
}
}
}若要实现用户级可用性(所有项目),请改为添加到 ~/.claude.json。
Claude Desktop
编辑以下路径的配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"nutanix": {
"type": "stdio",
"command": "python",
"args": ["-m", "nutanix_mcp"],
"cwd": "/path/to/mcp/nutanix-mcp-server",
"env": {
"NUTANIX_HOST": "your-prism-central.example.com",
"NUTANIX_USERNAME": "your-username",
"NUTANIX_PASSWORD": "your-password",
"NUTANIX_VERIFY_SSL": "true"
}
}
}
}编辑后请完全重启 Claude Desktop。
GitHub Copilot (VS Code)
添加到工作区中的 .vscode/mcp.json:
{
"servers": {
"nutanix": {
"type": "stdio",
"command": "python",
"args": ["-m", "nutanix_mcp"],
"cwd": "${workspaceFolder}/mcp/nutanix-mcp-server",
"env": {
"NUTANIX_HOST": "your-prism-central.example.com",
"NUTANIX_USERNAME": "your-username",
"NUTANIX_PASSWORD": "your-password",
"NUTANIX_VERIFY_SSL": "true"
}
}
}
}OpenCode (sst/opencode)
添加到项目根目录的 opencode.json (或 opencode.jsonc):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"nutanix": {
"type": "local",
"command": ["python", "-m", "nutanix_mcp"],
"environment": {
"NUTANIX_HOST": "your-prism-central.example.com",
"NUTANIX_USERNAME": "your-username",
"NUTANIX_PASSWORD": "your-password",
"NUTANIX_VERIFY_SSL": "true"
},
"enabled": true
}
}
}注意:OpenCode 使用数组形式的 "command" 以及 "environment" 而非 "env"。
Docker MCP 网关
Docker MCP 网关 可以在容器内代理此服务器。有两种方法:
选项 A:通过 Docker 直接运行
构建容器镜像并在您的 MCP 客户端配置中引用它:
FROM python:3.12-slim
WORKDIR /app
COPY mcp/nutanix-mcp-server/ .
RUN pip install --no-cache-dir -e .
CMD ["python", "-m", "nutanix_mcp"]然后在任何 MCP 客户端配置中:
{
"mcpServers": {
"nutanix": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "NUTANIX_HOST=your-prism-central.example.com",
"-e", "NUTANIX_USERNAME=your-username",
"-e", "NUTANIX_PASSWORD=your-password",
"-e", "NUTANIX_VERIFY_SSL=true",
"nutanix-mcp-server"
]
}
}
}选项 B:向 Docker MCP 网关注册
如果您拥有带有 MCP 工具包的 Docker Desktop:
docker mcp gateway run配置网关配置文件以包含 nutanix 服务器。网关随后会将所有已注册的 MCP 服务器暴露为单个统一端点。
在您的 AI 客户端中,指向网关:
{
"mcpServers": {
"MCP_DOCKER": {
"command": "docker",
"args": ["mcp", "gateway", "run"]
}
}
}网关负责处理路由、生命周期管理和凭据隔离。
API 版本策略
版本 | 端点模式 | 使用场景 |
v4 (首选) |
| 虚拟机、集群、主机、网络 |
v3 (回退) |
| 尚未在 v4 中提供的资源 |
v2 (PE 直接) |
| 集群级存储、磁盘、告警 |
发现 Prism Element 主机
使用 list_clusters 查找集群 UUID,然后使用 list_hosts 查找 CVM IP。这些 CVM IP 可在 Prism Element 工具中用作 pe_host。
开发
# Lint
ruff check src/
# Type check
mypy src/
# Test
pytest参考资料
Available Tools
28 toolscreate_vmB
Create a new virtual machine. Requires name, cluster UUID, and basic specs.
Inputs: name (required), cluster_uuid (required), num_vcpus, memory_mb, +1 more.
generate_cluster_reportB
Generate a detailed As-Built report for one or more Nutanix clusters. Covers cluster configuration, hosts, storage containers, VMs, and networking. Returns Markdown with an Excalidraw cluster architecture diagram.
Inputs: cluster_uuids, include_diagram.
generate_environment_reportA
Generate a comprehensive As-Built report for the full Nutanix environment. Covers all clusters, hosts, storage, networking, and VM inventory registered with Prism Central. Returns Markdown with an Excalidraw topology diagram.
Inputs: include_vms, include_diagram.
generate_vm_reportB
Generate a detailed As-Built report for one or more VMs. Covers VM configuration, compute resources, disks, NICs, categories, and host placement. Returns Markdown with an Excalidraw VM layout diagram.
Inputs: vm_uuids (required), include_diagram.
get_categoryB
Get all values for a specific category key. Example: category 'Environment' may have values 'Production', 'Dev', 'Test'.
Inputs: category_uuid (required).
get_clusterA
Get detailed information about a specific cluster by UUID. Returns configuration, network, storage, and health details.
Inputs: cluster_uuid (required).
get_hostA
Get detailed information about a specific host by UUID. Returns hardware specs, hypervisor info, and resource usage.
Inputs: host_uuid (required).
get_imageA
Get detailed information about a specific disk image by UUID. Returns size, type, source, and cluster placement.
Inputs: image_uuid (required).
get_subnetA
Get detailed subnet configuration including IP pools, DHCP config, and virtual switch assignment.
Inputs: subnet_uuid (required).
get_vmA
Get detailed information about a specific VM by its UUID. Returns full configuration including CPU, memory, disks, and NICs.
Inputs: vm_uuid (required).
list_categoriesA
List category keys and their values used for resource tagging. Categories enable policy-based management (Flow, DR, etc.).
Inputs: filter, limit.
list_clustersA
List all Nutanix clusters registered with Prism Central. Returns cluster names, UUIDs, versions, and health status.
Inputs: filter.
list_hostsA
List hypervisor hosts across clusters. Returns host names, IPs, resource capacity, and health. Optionally filter by cluster.
Inputs: cluster_uuid, filter, limit.
list_imagesA
List disk images (ISOs, QCOW2) available in the image library. Returns image names, types, sizes, and source URIs.
Inputs: filter, limit.
list_storage_containersA
List storage containers available across clusters. Returns names, capacity, usage, and associated cluster.
Inputs: cluster_uuid, limit.
list_subnetsB
List subnets/VLANs configured in Prism Central. Returns subnet names, VLAN IDs, CIDRs, IP pools, and associated clusters.
Inputs: filter, limit.
list_vmsA
List virtual machines on Nutanix. Returns VM names, UUIDs, power states, and resource allocation. Supports OData filtering.
Inputs: filter, limit.
pe_get_cluster_infoA
Get cluster info directly from a Prism Element node. Returns AOS version, cluster name, storage capacity, and health.
Inputs: pe_host (required).
pe_list_alertsB
List alerts on a Prism Element cluster. Returns alert titles, severity, timestamps, and affected entities.
Inputs: pe_host (required), resolved, count.
pe_list_containersB
List storage containers on a Prism Element cluster. Returns names, capacity, usage, replication factor, and policies.
Inputs: pe_host (required).
pe_list_disksA
List physical disks on a Prism Element cluster. Returns disk type (SSD/HDD), status, capacity, and location.
Inputs: pe_host (required).
pe_list_hostsA
List hypervisor hosts on a Prism Element cluster. Returns host names, IPs, hardware specs, and CVM info.
Inputs: pe_host (required).
pe_list_protection_domainsC
List protection domains on a Prism Element cluster. Returns PD names, protected entities, schedules, and replication state.
Inputs: pe_host (required).
pe_list_snapshotsA
List snapshots for a protection domain on a Prism Element cluster.
Inputs: pe_host (required), protection_domain (required).
pe_list_storage_poolsA
List storage pools on a Prism Element cluster. Returns pool names, capacity, and disk composition.
Inputs: pe_host (required).
pe_list_vmsA
List VMs on a specific Prism Element cluster. Returns VM names, UUIDs, power states, and resource allocation.
Inputs: pe_host (required), count.
power_off_vmA
Power off a virtual machine. Uses ACPI shutdown by default (guest-initiated).
Inputs: vm_uuid (required), force.
power_on_vmB
Power on a virtual machine.
Inputs: vm_uuid (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 28 tools
Most tools target distinct resources or actions. However, list_vms and pe_list_vms both list VMs but from different scopes (Prism Central vs Prism Element), which could cause confusion if descriptions are not read carefully. Similarly, get_cluster and pe_get_cluster_info overlap, but descriptions clarify the source difference.
The naming convention is mixed: some tools use verb_noun (create_vm, list_vms), some use generate_*_report, and there's a pe_ prefix for Prism Element tools. While each sub-pattern is consistent internally, the overall set lacks a uniform style, with verbs like 'power_on' and 'generate' alongside 'get' and 'list'.
28 tools is somewhat high for an MCP server, but given the complexity of Nutanix infrastructure covering clusters, VMs, storage, networking, and both Prism Central and Element APIs, the number is justifiable. It feels slightly heavy but not excessive.
The tool set covers many core Nutanix operations (CRUD for VMs, listing resources, generating reports) but has notable gaps: no update or delete for VMs, no VM migration, no backup/restore, and limited network configuration beyond listing subnets. This leaves agents with dead ends for common tasks.
Maintenance
Related MCP Connectors
Manage American Cloud VMs, Kubernetes, databases, storage, networks and DNS from your AI assistant.
Enables AI assistants to retrieve event data and execute event management operations in Nunify.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Manage Rackspace Spot Kubernetes Cloudspaces, node pools, and VMs from your AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables querying Nutanix infrastructure (VMs, hosts, storage, alerts, etc.) using natural language through GitHub Copilot. Supports Prism Element, Prism Central, and Nutanix Move with secure credential storage.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Proxmox VE infrastructure, including VMs, containers, storage, and cluster operations via natural language.MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to manage Proxmox VE infrastructure, including VMs, containers, storage, network, high availability, replication, SDN, and node administration.1009 npmMIT
- AlicenseAqualityBmaintenanceGoverned AI-ops MCP server for Nutanix Prism Central v4 REST API, offering 47 read/write tools for clusters, VMs, storage, network, catalog, data protection, alerts, and LCM upgrades with built-in audit, budget, and risk-tier governance.51MIT