Get the FREE Ultimate OpenClaw Setup Guide →

kubevirt

A simple Model Context Protocol server for KubeVirt

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lyarwood-kubevirt-mcp-server ./kubevirt-mcp-server \
  --env KUBECONFIG="path/to/your/kubeconfig"

How to use

This MCP server provides a set of Tools and Resources for managing KubeVirt virtual machines via the Model Context Protocol. It exposes tools such as list_vms, start_vm, stop_vm, restart_vm, pause_vm, unpause_vm, create_vm, delete_vm, patch_vm, list_instancetypes, get_instancetype, get_preference, get_vm_instancetype, get_vm_status, get_vm_conditions, get_vm_phase, and get_vm_disks. Widgets for prompts include describe_vm, troubleshoot_vm, and health_check_vm, enabling rich VM descriptions, diagnostics, and health checks. The Resources endpoints allow querying VMs, VMIs, DataVolumes, and instance types at both namespace and cluster scope. You can use these endpoints to enumerate VMs, fetch complete specifications, status, console access details, and related runtime information. To operate, run the MCP server and use your MCP client (e.g.,Claude CLI) to invoke tools by name with the appropriate URIs and payloads. Authentication and cluster access are managed via your KUBECONFIG and Kubernetes credentials set in your environment.

How to install

Prerequisites:

  • Go toolchain or a prebuilt binary for kubevirt-mcp-server
  • Access to a Kubernetes cluster with KubeVirt deployed
  • Docker or Make installed if building from source

Install steps:

  1. Clone the repository: git clone <your-repo> cd kubevirt-mcp-server

  2. Build the server (recommended via Makefile): make build

    // If the binary is built, note the path, e.g. ./kubevirt-mcp-server

  3. (Optional) Run with the built binary: ./kubevirt-mcp-server

  4. Ensure environment is configured to access your Kubernetes cluster (KUBECONFIG or in-cluster config).

  5. If using Claude CLI integration, point your Claude config to the running binary and provide KUBECONFIG in the environment block.

Additional notes

Tips and common issues:

  • Ensure KUBECONFIG is correctly set so the server can access the cluster resources (VMS, VMIs, DataVolumes, etc.).
  • When creating VMs, the server supports OS name lookup, optional instancetype, and VM preferences; supply the required fields in the payload.
  • Use the resources endpoints to browse available instance types and preferences before creation to avoid invalid configurations.
  • For local development with kubevirtci, use the provided scripts (scripts/kubevirtci.sh and scripts/sync.sh) to bootstrap a test environment and run the MCP server with cluster access.
  • If you encounter URI parsing or tool invocation errors, verify that the MCP tool names match exactly (e.g., list_vms, start_vm, get_vm_status) and that the namespace is correct.

Related MCP Servers

Sponsor this space

Reach thousands of developers