by MatiasVara
libvirt-mcp is an experimental MCP (Management Control Plane) server designed to enable Large Language Models (LLMs) to interact with Libvirt, allowing for the creation, destruction, and listing of Virtual Machines (VMs) on a system.
libvirt-mcp is an experimental Management Control Plane (MCP) server that acts as a bridge between Large Language Models (LLMs) and Libvirt. This integration allows LLMs to programmatically manage virtual machines, including operations like creating, destroying, and listing VMs.
To use libvirt-mcp, you need to set up a few components:
mcp-cli
repository and install it using pip3.11 install -e ".[cli,dev]"
.ollama serve
and pull the granite3.2:8b-instruct-q8_0
model.uv
using pip install uv
.libvirt-devel
and python3-devel
using dnf install -y
.libvirt-mcp
directory and run uv sync
.server_config.json
to set the correct path to the libvirt-mcp server, then execute run.sh
.For debugging, you can install mcp
via dnf install -y npm
and pip install mcp
, then run mcp dev setup.py
.
granite3.2:8b-instruct-q8_0
with Ollama.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.
For debugging, you can install mcp:
dnf install -y npm
pip install mcp
And then, run:
mcp dev setup.py
Please log in to share your review and rating for this MCP.