oVirt MCP Server

MCP Tools

Manage oVirt/RHV virtualization infrastructure via MCP. Provides 186 tools for VMs, hosts, clusters, networks, storage, templates, snapshots, disks, events, RBAC, quotas, and more. Use when the user asks to manage oVirt virtual machines, create/delete/modify VMs, check host status, manage storage domains, handle templates, configure networks, manage user permissions, view events/alerts, or any oVirt/RHV infrastructure operations. Triggers on "oVirt", "RHV", "virtual machine", "VM management", "storage domain", "cluster", "host management".

Install

openclaw skills install ovirt-mcp

oVirt MCP Server

MCP server for oVirt/RHV virtualization management. 186 tools covering the full infrastructure lifecycle.

Version: 0.1.0 | License: MIT | Author: Joey Ma (@imjoey)

Quick Start

Install

pip install ovirt-engine-mcp-server

Or from source:

git clone https://github.com/imjoey/ovirt-engine-mcp-server.git
cd ovirt-engine-mcp-server
pip install -e .

Configure

Environment variables (recommended):

export OVIRT_ENGINE_URL="https://ovirt-engine.example.com"
export OVIRT_ENGINE_USER="admin@internal"
export OVIRT_ENGINE_PASSWORD="your-password"

Or create a config.yaml:

OVIRT_ENGINE_URL: https://ovirt-engine.example.com
OVIRT_ENGINE_USER: admin@internal
# OVIRT_ENGINE_PASSWORD should be set via environment variable

Run

ovirt-engine-mcp

Claude Desktop / OpenClaw Integration

{
  "mcpServers": {
    "ovirt": {
      "command": "ovirt-engine-mcp",
      "env": {
        "OVIRT_ENGINE_URL": "https://ovirt-engine.example.com",
        "OVIRT_ENGINE_USER": "admin@internal",
        "OVIRT_ENGINE_PASSWORD": "your-password"
      }
    }
  }
}

Docker

docker build -t ovirt-engine-mcp-server .
docker run -e OVIRT_ENGINE_URL=... -e OVIRT_ENGINE_USER=... -e OVIRT_ENGINE_PASSWORD=... ovirt-engine-mcp-server

Architecture

MCP Client (Claude / OpenClaw / etc.)
        │  stdio (JSON-RPC)
        ▼
  MCP Server (server.py)
  ┌─────────────────────────────┐
  │  OvirtMCP (ovirt_mcp.py)    │  ← Core SDK wrapper (ovirtsdk4)
  │  186 methods               │
  ├─────────────────────────────┤
  │  Extension Modules:         │
  │  NetworkMCP · ClusterMCP    │
  │  TemplateMCP · DataCenterMCP│
  │  HostExtendedMCP            │
  │  StorageExtendedMCP         │
  │  DiskExtendedMCP            │
  │  EventsMCP · AffinityMCP    │
  │  RbacMCP · VmExtendedMCP    │
  │  TemplateExtendedMCP        │
  │  QuotaMCP · SystemMCP       │
  └─────────────────────────────┘
        │
        ▼
  oVirt Engine REST API

Error Handling

All errors return structured JSON with error code, message, and retry guidance:

CodeRetryableDescription
CONNECTION_ERRORFailed to connect to oVirt Engine
NOT_FOUNDRequested resource not found
PERMISSION_DENIEDInsufficient permissions
VALIDATION_ERRORInvalid input parameters
TIMEOUTOperation timed out
SDK_ERRORoVirt SDK internal error

Retry strategy: Only retry on retryable: true errors. Use exponential backoff (1s → 2s → 4s). NOT_FOUND and PERMISSION_DENIED require user intervention.

Available Tools

186 tools across 27 categories. Each reference file is self-contained with its own index:

FileToolsCovers
vm.md35VM lifecycle, pools, checkpoints, snapshots
host.md19Host management, fencing, iSCSI
cluster.md11Clusters, CPU profiles
datacenter.md5Data centers
instance-types.md2Instance types
storage.md16Storage domains, connections, iSCSI bonds
disk.md13Disk lifecycle, snapshots, move, resize
network.md16Networks, VNIC profiles, QoS, MAC pools
template.md8Template lifecycle, disk/NIC lists
system.md6System info, jobs
events.md11Events, bookmarks, alerts
rbac.md24Users, groups, roles, permissions, tags, filters
quota.md7Data center quotas
affinity.md13Affinity groups and labels

Quick Category Reference

CategoryCountKey Tools
VM Core9vm_list, vm_create, vm_start, vm_stop, vm_delete
VM Extended16vm_migrate, vm_console, vm_cdrom_*, vm_watchdog_*, vm_pin_to_host
VM Pools5vm_pool_list, vm_pool_create, vm_pool_update, vm_pool_delete
VM Checkpoints4vm_checkpoint_list/create/restore/delete
Snapshots4snapshot_list/create/restore/delete
Disks Core3disk_list, disk_create, disk_attach
Disks Extended9disk_get, disk_resize, disk_move, disk_sparsify, disk_export
Networks9network_list/create/update/delete, nic_list/add/remove
VNIC Profiles5vnic_profile_list/create/update/delete/get
Network Filters & QoS3network_filter_list, mac_pool_list, qos_list
Hosts Core3host_list, host_activate, host_deactivate
Hosts Extended16host_add, host_fence, host_iscsi_*, host_install, host_nic_*
Clusters10cluster_list/create/update/delete, cluster_cpu_load, cluster_memory_usage
CPU Profiles2cpu_profile_list, cpu_profile_get
Data Centers5datacenter_list/create/update/delete/get
Storage Core8storage_list/create/delete/attach/detach/stats
Storage Extended10storage_refresh, storage_import_vm, storage_files, iscsi_bond_list
Templates Core2template_list, template_vm_create
Templates Extended6template_get/create/delete/update, template_disk_list, template_nic_list
Instance Types2instance_type_list, instance_type_get
Affinity Groups7affinity_group_list/create/update/delete/add_vm/remove_vm
Affinity Labels6affinity_label_list/create/delete/assign/unassign
Events11event_list, event_search, event_alerts/errors/warnings, event_summary
RBAC24user_*, group_*, role_*, permission_*, tag_*, filter_list
Quotas7quota_list/create/update/delete, quota_*_limit_list
System & Jobs6system_get, job_list, job_cancel, system_statistics

Common Workflows

Create VM from Template

1. template_list → find template ID
2. cluster_list → find cluster ID
3. template_vm_create(name, template, cluster, ...)
4. vm_start(name_or_id)

Migrate VM

1. vm_list(status="up") → find running VM
2. host_list() → find target host
3. vm_migrate(name_or_id, target_host)

Create Snapshot & Restore

1. snapshot_create(name_or_id, description="before-patch")
2. ... perform changes ...
3. snapshot_restore(name_or_id, snapshot_id)  # if needed

Storage Health Check

1. storage_list → list all domains
2. storage_stats(name_or_id) → check each domain
3. event_errors → check for storage-related errors

RBAC Audit

1. permission_list(resource_type="cluster", resource_id="...") → list perms
2. user_list → list users
3. tag_list → list tags

Requirements

  • Python >= 3.10
  • oVirt Engine 4.4+
  • Dependencies: mcp>=1.0.0, ovirtsdk4>=4.6.0, pyyaml>=6.0, requests>=2.31.0, colorlog>=6.8.0

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Lint
ruff check src/ tests/

Related Projects