QEMU Screenshot MCP Server

QEMU Screenshot MCP Server

Enables AI agents to capture high-quality screenshots from running QEMU virtual machines using the QEMU Machine Protocol (QMP), automatically discovering VMs and returning screenshots as PNG images.

Category
Visit Server

README

QEMU Screenshot MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with running QEMU instances. Currently, it allows an agent to capture a high-quality screenshot of the first running QEMU virtual machine.

Features

  • 🔍 Auto-discovery: Automatically finds the first running qemu-system-* process.
  • 🔌 QMP Integration: Uses the QEMU Machine Protocol (QMP) for reliable, window-independent screenshot capture.
  • 📁 Persistent Storage: Saves screenshots to a screenshots/ directory with timestamped filenames for easy access.
  • 🖼️ Auto-Conversion: Automatically converts QEMU's raw PPM output to PNG via Pillow for immediate use in AI interfaces.
  • 🚀 Detailed Response: Returns the absolute file path and filename along with the base64-encoded PNG.

Installation

This server is designed to be used with uv for seamless execution.

Prerequisites

  • Python 3.12+
  • uv installed (pip install uv)
  • A QEMU instance running with a Unix QMP socket.

QEMU Configuration

To use this server, your QEMU instance must expose a Unix QMP socket. Run QEMU with the following argument:

qemu-system-x86_64 ... -qmp unix:/tmp/qmp-socket,server,nowait
# To run from your local directory:
uvx --from /home/vince/Projects/qemu-screenshot-mcp qemu-screenshot

# To run from a GitHub repository (after you push it):
uvx --from git+https://github.com/veighnsche/qemu-screenshot-mcp.git qemu-screenshot

Configuration in Claude Desktop (or other MCP clients)

Add the following to your MCP configuration file (e.g., config.json for Claude Desktop):

{
  "mcpServers": {
    "qemu-screenshot": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/veighnsche/qemu-screenshot-mcp.git",
        "qemu-screenshot"
      ]
    }
  }
}

[!TIP] Once you push your project to GitHub, you can replace the local path in --from with the Git URL to make it accessible from anywhere!

Tools Provided

run_and_screenshot

Atomic operation: Starts a QEMU VM, waits for boot, captures a screenshot, then shuts down cleanly.

This is the recommended tool for AI agents as it provides a single, deterministic step for capturing VM state.

Parameters:

Parameter Type Required Description
arch string Architecture: "x86_64" or "aarch64"
image string Path to ISO or disk image to boot
screenshot_delay_seconds int Seconds to wait before screenshot (boot time)
extra_args string Additional QEMU arguments (e.g., "-m 2G -smp 2")

Example:

{
  "arch": "x86_64",
  "image": "/path/to/archlinux.iso",
  "screenshot_delay_seconds": 10,
  "extra_args": "-m 4G -enable-kvm"
}

Returns: Screenshot image with metadata, or detailed error message.


capture_screenshot

Captures a screenshot of an already running QEMU instance.

  • Returns: A base64-encoded PNG string encased in standard image markers.
  • Error Handling: Provides detailed feedback if no QEMU process is found, if QMP is missing, or if the socket is unreachable.

Development & Testing

A mock server is provided in tests/mock_qmp_server.py to test the MCP server without a real QEMU instance.

  1. Start Mock Server: python3 tests/mock_qmp_server.py
  2. Mock QEMU Process: Rename a long-running process to qemu-system-mock and run it with -qmp unix:/tmp/qmp-test.sock.
  3. Run MCP Client: Test the tool via your preferred MCP client or uv run qemu-screenshot.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured