kvm
An MCP server for KVM hypervisors
claude mcp add --transport stdio steveydevey-kvm-mcp python kvm_mcp_server.py
How to use
The KVM MCP Server exposes a single JSON-RPC interface for managing KVM virtual machines. It provides lifecycle controls (create, start, stop, reboot, list), networking via a bridging setup (default bridge brforvms), storage management for VM disks, display access through VNC, and installation workflows for OS images. The server is designed to centralize VM operations, enabling remote orchestration and automation through a consistent API. To get started, run the server with Python and then issue JSON-RPC requests to perform common tasks such as creating a VM, booting it, attaching disks, configuring networking, and retrieving status information. The README indicates there are example scripts (e.g., create_vm.sh) to help craft typical sequences of operations, making it straightforward to script common workflows.
How to install
Prerequisites:
- Python 3.6 or higher
- KVM and libvirt installed on the host
- A configured network bridge (default: brforvms)
- A VM storage directory (default: /vm/)
- Sufficient system resources for your VM workload
Installation steps:
- Clone the repository:
git clone https://github.com/yourusername/kvm-mcp.git cd kvm-mcp - Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate - Install Python dependencies:
pip install -r requirements.txt - Prepare configuration:
- Edit config.json to match your environment (paths, bridge, and defaults)
- Ensure required directories exist and network bridge is correctly configured
- Run the MCP server:
python3 kvm_mcp_server.py - Verify operation by sending JSON-RPC requests to the running server (e.g., via curl or a client script).
Additional notes
Configuration is centralized in config.json. You can override defaults via environment variables as shown in the README (e.g., VM_DISK_PATH, VM_DEFAULT_NETWORK). The server emphasizes performance optimizations such as connection pooling, caching, and asynchronous processing. If you encounter issues with libvirt connections, check that the host user has the necessary permissions and that the libvirt daemon is active. For networking, ensure the brforvms bridge exists and is properly configured. Logs are designed to be structured for diagnostics; enable higher verbosity if troubleshooting connection or VM state recovery issues. When upgrading, review changes to the default VM template parameters (disk_path, default_iso, default_master_image) to avoid overwriting your environment-specific values.
Related MCP Servers
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
mcp-yfinance
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
cloudwatch-logs
MCP server from serkanh/cloudwatch-logs-mcp
servicenow-api
ServiceNow MCP Server and API Wrapper
the -company
TheMCPCompany: Creating General-purpose Agents with Task-specific Tools