mcp-xcpng
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-xcpng Show me all running VMs on the cluster"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-xcpng
A Model Context Protocol (MCP) server for XCP-ng / Xen Orchestra, providing AI assistants with full access to VM, host, storage, and snapshot management through the Xen Orchestra REST API.
Features
17 tools across four categories:
Virtual Machine Management
Tool | Description |
| List all VMs with name, power state, memory, CPU count, and host placement |
| Get detailed VM information by UUID or XO object ID |
| Start a halted or suspended VM |
| Clean or forced shutdown of a running VM |
| Suspend a VM (saves memory state to disk) |
| Resume a suspended VM |
| Clean or forced reboot of a running VM |
Host Management
Tool | Description |
| List all XCP-ng hypervisor hosts with CPU, memory, and version info |
| Get detailed host information by UUID or XO object ID |
| Get CPU and memory usage statistics with configurable time granularity |
Storage Management
Tool | Description |
| List all Storage Repositories with type, total, used, and free space |
| Get detailed SR info including free/total space and utilization percentage |
| List Virtual Disk Images in a Storage Repository |
Snapshot Management
Tool | Description |
| List VM snapshots, optionally filtered by VM |
| Create a VM snapshot |
| Delete a snapshot (irreversible) |
| Revert a VM to a previous snapshot state |
Related MCP server: oVirt MCP Server
Installation
git clone git@github.com:fredriksknese/mcp-xcpng.git
cd mcp-xcpng
npm install
npm run buildConfiguration
The server is configured via environment variables:
Variable | Required | Default | Description |
| Yes | — | Xen Orchestra server hostname or IP |
| Yes | — | Xen Orchestra username |
| Yes | — | Xen Orchestra password |
| No |
| Accept self-signed SSL certificates |
Usage with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"xcpng": {
"command": "node",
"args": ["/absolute/path/to/mcp-xcpng/dist/index.js"],
"env": {
"XO_HOST": "your-xen-orchestra.example.com",
"XO_USERNAME": "admin@admin.net",
"XO_PASSWORD": "your-password"
}
}
}
}Usage with Claude Code
claude mcp add xcpng -- node /absolute/path/to/mcp-xcpng/dist/index.jsSet the required environment variables before running, or configure them in your MCP settings.
Example Prompts
Once connected, you can ask your AI assistant things like:
"Show me all running VMs on the cluster"
"What is the memory usage on host xcp-01?"
"Create a snapshot of vm-web-01 called 'pre-upgrade'"
"List all storage repositories and their free space"
"Stop the VM named 'test-server' cleanly"
"Show me all snapshots for VM abc-1234"
"What are the CPU stats for host xcp-node-02 over the last week?"
"Delete the snapshot named 'old-backup' from VM prod-db"
"List all VMs that are currently halted"
"How much free space is left on the NFS storage repository?"
API
This server targets the Xen Orchestra REST API (/rest/v0/), which is available in Xen Orchestra Community Edition (XO-CE) and the commercial Xen Orchestra appliance (XOA).
Authentication uses the session cookie mechanism: a POST /rest/v0/session with credentials returns a cookie that is used for all subsequent requests.
Note: The Xen API (XAPI) XML-RPC interface is available directly on XCP-ng hosts at
https://{host}/RPC2and usesSession.login_with_passwordfor authentication. This server targets XO as the management layer instead, which provides a unified API across all hosts in a pool.
Development
npm run dev # Run with tsx (auto-reloads)
npm run build # Compile TypeScript to dist/
npm start # Run compiled outputArchitecture
src/
├── index.ts # Entry point — creates MCP server + STDIO transport
├── xcpng-client.ts # HTTP client wrapping the Xen Orchestra REST API
└── tools/
├── vms.ts # VM lifecycle management (7 tools)
├── hosts.ts # Host info and statistics (3 tools)
├── storage.ts # Storage repositories and VDIs (3 tools)
└── snapshots.ts # Snapshot CRUD and revert (4 tools)Requirements
Node.js 18+
Xen Orchestra (XOA or XO-CE) with REST API enabled
XCP-ng hypervisor hosts managed by Xen Orchestra
License
SEE LICENSE IN LICENSE
Available Tools
17 toolscreate_snapshotC
Create a snapshot of a VM. The snapshot captures the current disk and memory state.
Inputs: name (required), vm_id (required).
delete_snapshotB
Delete a VM snapshot by its UUID or Xen Orchestra object ID. This action is irreversible.
Inputs: snapshot_id (required).
get_hostA
Get detailed information about a specific XCP-ng host by its UUID or XO object ID.
Inputs: id (required).
get_host_statsA
Get CPU and memory usage statistics for an XCP-ng host over a time period. Useful for capacity planning and performance monitoring.
Inputs: id (required), granularity.
get_srA
Get detailed information about a specific Storage Repository including free and total space.
Inputs: id (required).
get_vmB
Get detailed information about a specific VM by its UUID or XO object ID.
Inputs: id (required).
list_hostsB
List all XCP-ng hypervisor hosts managed by Xen Orchestra. Returns hostname, address, CPU info, memory, software version, and enabled state.
Inputs: name_filter, enabled_only.
list_snapshotsB
List VM snapshots. Optionally filter by VM to get snapshots for a specific virtual machine.
Inputs: vm_id, name_filter.
list_srsA
List all Storage Repositories (SRs) managed by Xen Orchestra / XCP-ng. Returns SR name, type, total size, used space, free space, and sharing mode.
Inputs: name_filter, shared_only, type_filter.
list_vdisA
List Virtual Disk Images (VDIs) in a specific Storage Repository. Returns disk name, size, usage, and whether it is a snapshot.
Inputs: sr_id (required), name_filter, snapshots_only.
list_vmsA
List all virtual machines managed by Xen Orchestra / XCP-ng. Returns name, power state, memory, CPU count, and host placement.
Inputs: name_filter, power_state.
reboot_vmA
Reboot a running VM. Use force=true for a hard reboot if the clean reboot fails.
Inputs: id (required), force.
resume_vmA
Resume a suspended VM, restoring it to running state from its saved memory.
Inputs: id (required).
revert_vm_to_snapshotA
Revert a VM to a previous snapshot. WARNING: This will discard all changes made since the snapshot was taken. The VM must be halted first.
Inputs: vm_id (required), snapshot_id (required).
start_vmB
Start a halted or suspended VM. The VM must be in a Halted or Suspended state.
Inputs: id (required).
stop_vmA
Stop (shut down) a running VM. Use force=true for a hard power-off if the clean shutdown fails.
Inputs: id (required), force.
suspend_vmA
Suspend a running VM, saving its memory state to disk. The VM must be in Running state.
Inputs: id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool maps to a clear resource-and-action pair: VM power operations, snapshot operations, host reads, SR reads, and VDI listing are well separated. List-vs-get and stop-vs-suspend-vs-reboot are distinguishable from names and descriptions.
The tool set consistently uses snake_case verb_noun naming such as list_snapshots, create_snapshot, start_vm, and get_host_stats. Even the longer revert_vm_to_snapshot follows the same predictable convention.
Seventeen tools cover VMs, hosts, storage repositories, VDIs, and snapshots without obvious duplicates. The count is slightly above the ideal range but still reasonable for the breadth of the domain.
The surface covers VM power lifecycle and snapshot lifecycle well, plus read access to hosts, SRs, and VDIs. However, it lacks major VM provisioning operations such as create/delete/clone/migrate, and has no network or VDI lifecycle management.
Maintenance
Related MCP Connectors
Manage Vozora VPS servers, SSH keys, firewalls, DNS and usage from an AI agent.
Manage HepCloud (Turkish cloud) servers and managed PostgreSQL from your AI assistant. OAuth 2.1.
Manage Rackspace Spot Kubernetes Cloudspaces, node pools, and VMs from your AI assistant.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables management of Xen Orchestra (XOA) via its REST API, including listing VMs, backup jobs, logs, and repositories.2-
- FlicenseNot gradedqualityDmaintenanceEnables management of oVirt / Red Hat Virtualization environments via AI assistants, supporting VM lifecycle, power operations, snapshots, and infrastructure queries.-
- 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