Skip to main content
Glama
veighnsche

QEMU Screenshot MCP Server

by veighnsche

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.

Related MCP server: PeepIt MCP

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

Available Tools

1 tool
capture_screenshotA

Captures a screenshot of the first running QEMU instance. Prioritizes QMP (window-independent), falls back to X11 (if available).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses behavioral traits: the prioritization of QMP over X11 and the fallback mechanism. However, it doesn't cover important aspects like error handling (e.g., what happens if no QEMU instance is running), output format, or side effects. This leaves gaps in understanding the tool's behavior beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured: two sentences that efficiently convey the purpose and behavioral context. Every sentence adds value without redundancy, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involves QEMU and multiple capture methods), lack of annotations, and no output schema, the description is incomplete. It explains the capture process but omits details like what the output is (e.g., image format, storage location), error conditions, or dependencies. This leaves the agent with insufficient information for reliable use in varied scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't add parameter semantics, which is acceptable here. A baseline of 4 is appropriate since the schema fully covers the lack of parameters, and the description doesn't need to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Captures a screenshot of the first running QEMU instance.' It specifies the action (captures) and target resource (screenshot of QEMU instance), though it doesn't need to distinguish from siblings since none exist. However, it could be more specific about what 'first running QEMU instance' means in ambiguous scenarios.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage context: 'Prioritizes QMP (window-independent), falls back to X11 (if available).' This suggests when certain methods are preferred, but it doesn't explicitly state when to use this tool versus alternatives (e.g., other screenshot tools) or any prerequisites. Since there are no sibling tools, the lack of explicit alternatives is less critical, but guidance on conditions for successful invocation is limited.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.6/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose of capturing screenshots from QEMU instances.

Naming Consistency5/5

With only one tool, naming consistency is inherently perfect. The tool name 'capture_screenshot' follows a clear verb_noun pattern and sets a consistent standard, though there are no other tools to compare it against.

Tool Count2/5

A single tool is too few for most server purposes, as it severely limits functionality and scope. While it may be appropriate for a minimal utility, it feels thin and incomplete for a server named 'QEMU Screenshot MCP Server', which suggests broader screenshot-related capabilities.

Completeness2/5

The tool surface is severely incomplete for a screenshot server. It only captures screenshots from the first running QEMU instance, with no tools for listing instances, selecting specific ones, managing captures, or handling errors, leading to significant gaps that will cause agent failures.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to capture and analyze screenshots of macOS applications, windows, or the entire screen using local (Ollama) or cloud-based AI vision models, with non-intrusive, fast screen capture via Apple's ScreenCaptureKit.
    3
    15
    2
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    A cross-platform MCP server that allows AI agents to capture screenshots of specific windows, displays, or regions for native application testing. It provides tools to list active windows and monitors, enabling precise visual verification and interaction during automated workflows.
    40
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/veighnsche/qemu-screenshot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server