Five steps from install to your first host read.
MCP Libvirt is an MCP tool: you check it is installed, connect it to your agent, and then ask in plain language. This first run only reads, so it is safe on a host you share. Linux, amd64 or arm64. On macOS and Windows, MCP Libvirt runs in the managed Linux environment that AIDC Launch provides.
- Capturedmcp-libvirt 0.11.4$ mcp-libvirt versionmcp-libvirt 0.11.4Step 1 of 5
Check that it arrived
The MAIT image ships
mcp-libvirtand updates it with the image. Check that it runs.An error about a missing
libvirt.so.0means the libvirt client library is not installed. See mait-image.What you getThe version command answers, with the build you are on.
{ "mcpServers": { "libvirt": { "command": "mcp-libvirt", "args": ["serve"], "env": { "LIBVIRT_REQUIRE_EXPLICIT_CONNECTION": "1" } } } }Step 2 of 5Connect it to your agent
Any client that accepts an
mcpServerslaunch entry uses this shape. Place it where your client keeps server configuration and restart the client.The server connects with its own credentials, such as an SSH key for a
qemu+sshaddress, so put them in the environment that launches it and let only people who may use those credentials reach the service. LeaveMAIT_LOG_FORMATunset. If you reach your tools through the registry, addlibvirtonce withmcp_registry_addand the tools carry thelibvirt__prefix (registry guide).What you getA client that starts the service on its own, and an agent that can use its 63 tools.
- Capturedmcp-libvirt 0.11.4YouConnect to our hypervisor so we can look at it.Tool calllibvirt_connection_create { "uri": "<the libvirt address of the host>", "connectionId": "guide-demo" }What happensStatus connected: a connection slot named guide-demo now exists in this session, and later calls name it with connectionId.AgentI am connected to the host as guide-demo.Step 3 of 5
Open a connection to a host
Every request acts on one host, named by a connection you open first. Without
LIBVIRT_REQUIRE_EXPLICIT_CONNECTIONin the entry above, a call that names no connection goes to an implicitdefaultone, fromLIBVIRT_DEFAULT_URIor elseqemu:///system. Give your agent the libvirt address of the host, such asqemu+ssh://operator@hypervisor.example/system.What you getA named connection. It belongs to this session and ends with it.
- Capturedmcp-libvirt 0.11.4YouWhat kind of machine is this host, and what do we already manage on it?Tool callhost_node_info { "connectionId": "guide-demo" }What happensOne socket with 6 cores and 12 threads on an x86_64 processor at 1,099 MHz, about 30 GiB of memory, of which about 5.4 GiB is free.Tool calldomain_list { "connectionId": "guide-demo" }What happensAn empty list: this session has created and adopted no machines yet. Machines the host already runs are not in the list unless includeUnmanaged is set.AgentThe host has 12 threads and about 30 GiB of memory, with about 5.4 GiB free. We have no machines in our working set yet.Step 4 of 5
Read the host
Ask what the host is and what you already manage on it. Both are reads.
The empty list is the working set at work: it holds the machines this session created or adopted, not everything on the host. Pass
includeUnmanagedto a read to look at the rest; changing one still needs adoption first.What you getA picture of the host, and no change to it.
- Capturedmcp-libvirt 0.11.4YouThat is all I needed. Disconnect.Tool calllibvirt_connection_drop { "connectionId": "guide-demo" }What happensStatus dropped.AgentThe connection is closed. Nothing on the host changed.Step 5 of 5
Close the connection
Ask the agent to drop the connection when it is done. Dropping it releases only the session's tracking: machines, disks and networks stay on the host.
What you getA clean end, and the knowledge that ending a session never deletes a machine.
A connection that reads and a host that stayed as it was.
MCP Libvirt is installed, connected to your agent and able to read a host. Everything that creates, starts or deletes something comes next, one at a time, and works on the machines the session owns.