whatisgithub

What is qmp-mcp?

r0guesch0lar/qmp-mcp — explained in plain English

Analysis updated 2026-05-18

2RustAudience · developerComplexity · 4/5Setup · hard

In one sentence

An MCP server that lets an AI agent safely create, control, and tear down a single QEMU virtual machine through a validated, allowlisted command interface.

Mindmap

mindmap
  root((qmp-mcp))
    What it does
      Controls one QEMU VM
      Validated hardware spec
      Safe command policy
    Tech stack
      Rust
      TypeScript
      QEMU
      MCP protocol
    Use cases
      AI agent sandboxes
      Automated testing
      System admin tasks
    Audience
      AI tool developers
      Backend engineers
    Safety
      Allowlisted commands
      Hard denylist
      Named image store

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Give an AI coding agent a safe, sandboxed virtual machine it can boot, use, and destroy without touching the host system.

USE CASE 2

Automate spinning up test environments with specific CPU, memory, and disk configurations for CI or QA.

USE CASE 3

Let an agent run and observe an operating system boot process for debugging or educational purposes.

USE CASE 4

Build a controlled environment for running untrusted or experimental code inside a disposable VM.

What is it built with?

RustTypeScriptQEMUMCP

How does it compare?

r0guesch0lar/qmp-mcp132ikl/game1lystore/pay-dcp
Stars222
LanguageRustRustRust
Last pushed2020-12-30
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/52/53/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires QEMU installed and, for full speed, KVM access on the host alongside understanding of the MCP tool-calling setup.

So what is it?

qmp-mcp is a server that lets an AI agent control a single QEMU virtual machine through the Model Context Protocol, a standard way for AI tools to expose actions to an agent. Instead of letting the agent run raw commands against your computer, the agent describes the kind of virtual machine it wants, and the server builds, boots, and manages that machine on the agent's behalf, then tears it down when finished. The core idea is that the agent never touches QEMU or your filesystem directly. It sends a structured description called a Hardware Spec, listing things like the machine type, CPU, number of virtual processors, memory, disks, boot media, network, and display. The server checks every field for safety, rejects anything invalid before starting the virtual machine, and only then builds the actual QEMU command from it. There is an optional escape hatch that allows raw QEMU flags, but it is turned off unless you explicitly enable it for trusted setups. The server only ever runs one virtual machine at a time, moving it through stages from starting, to running, to optionally paused, to stopped. If the underlying QEMU process exits on its own, such as from a crash or a guest shutdown, the server notices and resets back to a clean state. While the machine is running, the server talks to it using QEMU's own control protocol over a private connection that is never exposed on the network, offering tools to pause, resume, check status, and capture the screen. For commands that do not have a dedicated tool, there is a generic command option, but it is restricted by a Command Policy: a safe allowlist by default, with genuinely dangerous commands permanently blocked and unable to be re-enabled. Disk images and boot media are referenced by name rather than by file path, and are looked up inside two folders you control, one for writable disk images and one for read only installation media. This project is aimed at developers building AI agents or tools that need to safely spin up and control a real virtual machine, such as for testing, sandboxed code execution, or automated system administration tasks. It ships in two interchangeable versions, one written in TypeScript and one in Rust.

Copy-paste prompts

Prompt 1
Write a Hardware Spec JSON for qmp-mcp that boots a Debian ISO with 2 vCPUs, 2GB RAM, and a VNC display.
Prompt 2
Explain how qmp-mcp's Command Policy allowlist and denylist decide which QMP commands an agent can run.
Prompt 3
Walk me through the Instance lifecycle in qmp-mcp from creation to teardown.
Prompt 4
How does qmp-mcp's Image Store and ISO Store keep the agent from referencing arbitrary host file paths?
Prompt 5
Compare running qmp-mcp with KVM acceleration versus TCG software emulation for a Raspberry Pi board target.

Frequently asked questions

What is qmp-mcp?

An MCP server that lets an AI agent safely create, control, and tear down a single QEMU virtual machine through a validated, allowlisted command interface.

What language is qmp-mcp written in?

Mainly Rust. The stack also includes Rust, TypeScript, QEMU.

How hard is qmp-mcp to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is qmp-mcp for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.