MCP Connector

Control Virtual Machines with LLMs

libvirt-mcp is an experimental MCP server exposing libvirt virtualization management, demoed with mcp-cli and a local Ollama-hosted granite model.

Works with libvirtollamagithub

82
Spark score
out of 100
Updated Jul 2025
Source checked Sep 15, 2026
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Enable Large Language Models to interact with libvirt for managing virtual machines. Automate the creation, deletion, and listing of VMs using natural language commands.

Outcomes

What it gets done

01

Create virtual machines via libvirt using LLM prompts.

02

Delete virtual machines on demand through LLM interaction.

03

List existing virtual machines on the system via LLM queries.

04

Integrate with ollama and granite models for LLM capabilities.

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Overview

libvirt-mcp MCP Server

An experimental MCP server for libvirt virtualization management, demonstrated with mcp-cli and a locally-hosted Ollama granite model rather than a documented tool list. Reach for it when experimenting with AI-driven libvirt VM control through a local LLM; its README doesn't yet document a specific set of exposed tools.

What it does

libvirt-mcp is an experimental MCP server for libvirt, the open-source virtualization management toolkit used to control KVM/QEMU and other hypervisors. The README demonstrates it driven through mcp-cli with a locally-hosted Ollama model (granite3.2:8b-instruct-q8_0) rather than documenting a specific list of exposed tools - it's presented as an early, working proof of concept for talking to libvirt through an MCP client and a local LLM.

When to use - and when NOT to

Use it if you want to experiment with driving libvirt-managed virtual machines through an MCP client backed by a local, self-hosted model instead of a cloud API. It is explicitly labeled experimental, and this README does not document the server's exposed tools or capabilities beyond the setup and a demo GIF - treat it as a proof of concept to explore, not a documented production interface.

Capabilities

The server is configured via server_config.json (path to the libvirt-mcp server) and started with run.sh, which uses Ollama as the model provider and the granite model by default. For debugging, it can also be run under the mcp CLI's dev mode against setup.py. Building it requires the libvirt-devel and python3-devel system packages for the Python libvirt bindings, plus uv for dependency management.

How to install

git clone https://github.com/chrishayuk/mcp-cli
pip3.11 install -e ".[cli,dev]"

That installs mcp-cli, the client used in the demo. Separately install Ollama (curl -fsSL https://ollama.com/install.sh | sh), start it (ollama serve), and pull the demo model (ollama pull granite3.2:8b-instruct-q8_0). Install uv (pip install uv) and the libvirt Python bindings' system dependencies (dnf install -y libvirt-devel python3-devel), then run uv sync inside the libvirt-mcp directory, edit server_config.json to point at the server, and run run.sh.

Who it's for

Developers experimenting with AI-driven libvirt/VM management through MCP and a local, self-hosted LLM, who are comfortable with an early-stage project whose tool surface isn't yet documented in the README.

Source README

libvirt-mcp

This is an experimental mcp server for libvirt. The
following lines explain how to use it with mcp-cli and ollama.
First, install mcp-cli:

git clone https://github.com/chrishayuk/mcp-cli
pip3.11 install -e ".[cli,dev]"

Then, install ollama:

curl -fsSL https://ollama.com/install.sh | sh
ollama serve >/dev/null 2>&1  &
ollama pull granite3.2:8b-instruct-q8_0

You need also uv:

pip install uv

You need the following python bindings:

dnf install -y libvirt-devel python3-devel

Then, in the libvirt-mcp directory, first install the dependencies by running:

uv sync

Then, edit server_config.json and set up the correct path to the libvirt-mcp
server. Finally, execute run.sh, that uses ollama as provider and granite
as model.

Demo

For debugging, you can install mcp:

dnf install -y npm
pip install mcp

And then, run:

mcp dev setup.py

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.