libvirt-mcp

libvirt-mcp

Allows LLM to interact with libvirt thus enabling to create, destroy or list the Virtual Machines in a system.

9
Stars
5
Forks
0
Releases

Overview

libvirt-mcp is an experimental MCP server that enables language models to interact with the libvirt virtualization API, allowing VM lifecycle operations (create, destroy, list) on a host. The repository provides guidance on using the server with mcp-cli and Ollama. Setup involves installing mcp-cli, Ollama, and the uv Python package, along with system bindings libvirt-devel and python3-devel. In the libvirt-mcp directory, dependencies are installed via uv sync, and server_config.json must be edited to point to the correct libvirt-mcp server. The server is run with run.sh, which uses Ollama as the provider and Granite as the model. For debugging, there are steps to install mcp and run mcp dev setup.py. A demonstration GIF is included to illustrate usage. The workflow is developer-oriented and relies on established ML tooling (Ollama, Granite) to interpret natural-language prompts and translate them into libvirt actions, enabling VM management through LLM-driven inputs.

Details

Owner
MatiasVara
Language
Python
License
Updated
2025-12-07

Features

Basic Libvirt MCP Server

Experimental MCP server enabling LLM-driven control of libvirt to manage VMs (create, destroy, list).

LLM to Libvirt integration

Enables language models to issue libvirt operations through the MCP workflow.

Ollama and Granite model integration

Uses Ollama as provider and Granite as the model for responses.

Configurable via server_config.json

Configure server path and settings through server_config.json.

Dependency management with uv sync

Installs required dependencies by running uv sync in the libvirt-mcp directory.

System and Python dependencies

Requires libvirt-devel and python3-devel, plus uv for Python-based tooling.

Run script to launch

Run run.sh to start the MCP server using Ollama provider and Granite model.

Debugging workflow with mcp

Optional debugging by installing mcp and running mcp dev setup.py.

Audience

DevelopersSet up and run MCP server to control libvirt with LLMs.
DevOps engineersUse MCP to automate VM lifecycle operations via LLMs in production.
AI researchersExperiment with natural language prompts to manage libvirt VMs programmatically.

Tags

libvirtmcpllmvm-managementlibvirt-mcpollamagraniteexperimentalprovidermodel