mcp-qemu-lab
A Model Context Protocol server for conducting Linux binary analysis and guest system forensics within QEMU virtual machines. It enables automated VM lifecycle management, memory dumping, and interactive debugging workflows for analyzing processes and artifacts.
README
mcp-qemu-lab
Local Model Context Protocol (MCP) server for Linux binary analysis in QEMU guests.
This server runs over STDIO, is safe by default, and exposes tools for:
- VM lifecycle (create/start/stop/snapshots)
- Full guest RAM dumps
- In-guest debugger workflows and per-process core dumps
- Artifact indexing/resources (metadata in tool output, file content via MCP resources)
Repository Layout
mcp_qemu_lab/server sourcetests/unit/integration testspyproject.tomlpackage + entrypointuv.lockpinned Python dependency lock file
Not tracked in git:
- runtime workspaces/logs/artifacts (
.mcp-qemu-lab*/) - local virtual envs (
.venv/) - local tool caches (
tools/) - local sample binaries (
test samples/)
Host Requirements
- Python 3.11+
uvpackage manager- QEMU (
qemu-system-x86_64andqemu-img) - OpenSSH client tools (
ssh,scp,ssh-keygen)
Install Host Dependencies
Windows
- Install
uv:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- Install QEMU (includes
qemu-system-x86_64.exeandqemu-img.exe):
winget install --id QEMU.QEMU --exact --accept-package-agreements --accept-source-agreements
- Ensure OpenSSH Client is installed:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
- Verify:
qemu-system-x86_64 --version
qemu-img --version
ssh -V
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install -y qemu-system-x86 qemu-utils openssh-client cloud-image-utils
Linux (Fedora/RHEL family)
sudo dnf install -y qemu-system-x86 qemu-img openssh-clients cloud-utils
Linux (Arch)
sudo pacman -S --needed qemu-base qemu-desktop openssh cloud-utils
Run From GitHub URL (No Local Project Path Needed)
You can launch directly from GitHub with uvx:
uvx --from git+https://github.com/Kevin4562/QEMU-MCP.git mcp-qemu-lab
Recommended pin (branch/tag/commit):
uvx --from git+https://github.com/Kevin4562/QEMU-MCP.git@main mcp-qemu-lab
MCP Client Configuration
VSCode Codex (TOML)
Example config.toml:
Windows:
[mcp_servers.mcp-qemu-lab]
command = "uvx"
args = ["--from", "git+https://github.com/Kevin4562/QEMU-MCP.git@main", "mcp-qemu-lab"]
env = { MCP_QEMU_LAB_WORKSPACE = "C:\\Users\\User\\AppData\\Local\\mcp-qemu-lab" }
Linux:
[mcp_servers.mcp-qemu-lab]
command = "uvx"
args = ["--from", "git+https://github.com/Kevin4562/QEMU-MCP.git@main", "mcp-qemu-lab"]
env = { MCP_QEMU_LAB_WORKSPACE = "/home/user/.local/share/mcp-qemu-lab" }
Cursor (JSON)
Example mcp.json:
{
"mcpServers": {
"mcp-qemu-lab": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/Kevin4562/QEMU-MCP.git@main",
"mcp-qemu-lab"
],
"env": {
"MCP_QEMU_LAB_WORKSPACE": "/absolute/path/to/mcp-qemu-lab-workspace"
}
}
}
}
Windows workspace example:
{
"mcpServers": {
"mcp-qemu-lab": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/Kevin4562/QEMU-MCP.git@main",
"mcp-qemu-lab"
],
"env": {
"MCP_QEMU_LAB_WORKSPACE": "C:\\Users\\User\\AppData\\Local\\mcp-qemu-lab"
}
}
}
}
Safety Defaults
- Guest networking default:
net_mode="none" - No host directory sharing by default
guest_execallowlist unlessunsafe_allow_arbitrary_commands=trueper call- Tool outputs return JSON metadata only (no raw memory bytes)
- Artifacts are stored on disk and exposed via MCP resources
- Every tool call writes audit JSONL entries
Key Tools
ensure_dependenciesvm_create,vm_start,vm_status,vm_stopvm_snapshot_save,vm_snapshot_loadguest_wait_readyguest_exec,guest_copy_in,guest_copy_outprocess_list,process_mapsdebugger_attach,debugger_set_breakpoint,debugger_continue,debugger_read_registers,debugger_detachprocess_dump_coreguest_dump_memoryartifacts_listvm_logs_tail
Resources
artifact://{artifact_id}artifact contentartifact-index://allartifact metadata index
Development Setup (Optional Local Clone Workflow)
If you are developing this repo locally:
uv sync
uv run --extra dev pytest -q
Integration test (real VM boot):
MCP_QEMU_LAB_RUN_INTEGRATION=1 MCP_QEMU_LAB_INTEGRATION_TIMEOUT_SEC=1800 uv run --extra dev pytest -m integration
Windows PowerShell:
$env:MCP_QEMU_LAB_RUN_INTEGRATION = "1"
$env:MCP_QEMU_LAB_INTEGRATION_TIMEOUT_SEC = "1800"
uv run --extra dev pytest -m integration
Troubleshooting
dependency_missing: install QEMU/OpenSSH and verify binaries are onPATH.dependency_privilege_required: rerun install command with elevated permissions.ssh_unavailable: VM must be created withnet_mode="user"for SSH-based tools.gdb/attach failures: runguest_wait_ready(..., require_gdb=true)before debugger/core tools.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。