qemu-mcp
Controls QEMU virtual machines over QMP and the human monitor, including launching, resetting, and stopping VMs; capturing screen output as OCR text, ASCII, or PNG; sending keyboard and mouse input; creating and managing disk images; reading/building FAT images; running macros; and issuing raw monitor or QMP commands.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
qemu-mcp
MCP server for driving QEMU from a model that cannot see: exact text when the guest is in text mode, OCR when it is graphical, and a screenshot when a vision model or a human has to look.
Quick start
vm_create_disk { path: "vm/disk.qcow2", sizeMb: 512 }
vm_launch { disk: "vm/disk.qcow2", memoryMb: 32, serial: true }
wait_for_text { pattern: "C:\\>", timeoutMs: 60000 }
type_text { text: "dir" }
press { keys: "ret" }
screen_text
vm_quitNode 20 or newer, QEMU, and an OCR engine for graphical screens. Text-mode guests need no OCR.
Related MCP server: mcp-incus-vm
Install
git clone https://gitlab.gotham.local/ob/qemu-mcp.git
cd qemu-mcp
npm install
node scripts/mcp/server.mjsOr link it globally and register it with OpenCode in one step:
npm link
qemu-mcp --version
# then, per project:
opencode mcp add qemu --global -- qemu-mcpInstaller scripts are also included:
# Linux / macOS
scripts/install.sh
scripts/uninstall.sh
# Windows
scripts\install.cmd
scripts\uninstall.cmdThe installers register qemu with OpenCode, Claude Code, Gemini CLI, Codex,
and Cursor when those harnesses are present, asking before each one. Run
scripts/install.sh --all (or scripts\install.cmd -all) to register every
detected harness without prompting. The scripts are safe to rerun. The server
speaks MCP on stdin/stdout and writes diagnostics to stderr only.
What it looks like
wait_for_text caught the MS-DOS startup menu, type_text chose the DOS
prompt, and screen_text read the result without OCR. Every image here is a
real screendump from a Windows for Workgroups 3.11 guest driven by qemu-mcp.

screen_text reads the 80x25 VGA plane directly, so the boot log and the
prompt come back exactly:

fat_build wrote this FAT image; the guest is showing dir g: on the USB
stick:

How it works
vm_launchpicks a free QMP port per launch, so two sessions do not collide.snapshot: trueboots from a temporary overlay and never writes the base disk.screen_textreads VGA text memory on an 80x25 screen. No OCR, no guessing. It falls back to OCR for graphics.wait_for_idlewatches the framebuffer until it stops changing, so an agent can tell that a keypress or command actually repainted the guest.vm_logandvm_eventsexplain a failed boot or an unexpected stop.
Reading the screen
Goal | Tool |
Read a prompt, dialog, or command output |
|
Wait for boot or a prompt |
|
Know the guest repainted |
|
Icons, custom fonts, damaged graphics |
|
screen_text accepts mode: "auto" | "vga" | "ocr" and a crop
(x, y, w, h). A crop uses the OCR path; mode: "vga" with a crop is
rejected because VGA text is read as a character grid. Set savePng: true to
keep a screenshot next to the text for a vision model. screen_ascii is a
luminance fallback, not a text reader.
Tools
VM lifecycle, screen reading, input, serial, FAT images, raw QMP, and macros. The full reference, options, and limits are in docs/tools.md.
Connect
Any local stdio client works; launch qemu-mcp with no arguments. OpenCode:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"qemu": {
"type": "local",
"command": ["qemu-mcp"],
"cwd": "."
}
}
}
}Claude Code, Codex, Cursor, and Gemini CLI use the same command. The server
uses its process working directory for vm/disk.qcow2 and relative paths;
pass absolute paths when the client cannot set a working directory.
Configuration
Variable | Default | Purpose |
|
| QEMU binary |
| next to |
|
|
| default disk |
| unset: a free port per launch | pin the QMP port |
|
| QEMU display backend |
|
| where screenshots are written |
| bundled | macro directory |
|
|
|
|
| Tesseract binary |
|
| Tesseract language |
|
| Tesseract page segmentation |
Linux and macOS need Tesseract for graphical OCR:
sudo apt install tesseract-ocr # Debian / Ubuntu
sudo dnf install tesseract # Fedora
brew install tesseract # macOSLimits
fat_buildwrites FAT16 only, between about 2.2 MiB and 512 MiB. Smaller images would be FAT12 to DOS; FAT12 writing is not implemented.One VM per server process.
OCR quality depends on the engine and the guest font.
screen_textreads 80x25 colour text mode only; 40-column and MDA screens use OCR.click_atneeds a guest driver for the USB tablet.The serial chardev is a TCP socket, so output is buffered from the first
serial_readconnection onward.screen_asciiis for graphics, not for reading text.
Docs
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Linux VMs for AI agents: create VMs, run commands, edit files and open preview URLs.
Linux cloud desktop your AI can use by the hour: run commands, read and write files, see the screen.
Run commands, code and file operations for AI agents in Cloud Hypervisor microVM sandboxes.
Cloud desktops for AI agents: create a Linux computer, see its screen, click, type and run tasks.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that gives AI agents direct control over QEMU virtual machines.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control and automate Incus/QEMU virtual machines via SSH, supporting mouse/keyboard, screenshots, commands, and lifecycle management.MIT
- AlicenseBqualityBmaintenanceNido is a local QEMU VM manager. Install it on your computer from https://github.com/Josepavese/nido and run nido mcp via stdio, or use npx -y nido-mcp@latest mcp with QEMU installed locally. It manages VMs on that same computer; a server hosted by Glama cannot access your local VM inventory.62MIT
- AlicenseBqualityBmaintenanceEnables MCP-capable agents to control a real QEMU virtual machine through nine computer-use tools—screenshot, click, move, type, key, scroll, status, start, and stop—without accessing the host’s pointer, clipboard, or files.97MIT