
Ghidra BizHawk MCP
io.github.getanirao由 GitHub 账号 getanirao 发布v1.1.0更新于 Oct 30, 2026
Unified Ghidra + BizHawk MCP server for static analysis, P-code emulation, and retro ROM triage.
概览
本地 MCP 服务器,连接 Ghidra 无头静态分析与 BizHawk 模拟器,让助手识别复古 ROM 平台、反编译代码并模拟指令片段。
- 可以做什么
- ROM 识别与加载:按文件头识别 NES、SNES、GBA、NDS、Switch、PSX、Genesis、SMS、Dreamcast 并建立对应 Ghidra 会话
- 会话管理:导入并分析二进制、列出与关闭工作区、生成 Markdown 工作区报告
- 代码阅读与分析:反编译函数(支持分页)、列出数据类型、交叉引用、调用图、批量反编译入口点
- 汇编与字节检查:反汇编指定范围、导出列表十六进制与 ASCII、搜索字节模式、比较两个已加载二进制
- 修改程序数据库:重命名符号、添加注释、创建结构体、改变量类型
- 模拟与指纹:执行 P-code 片段并跟踪污点或寄存器断点,计算函数指纹并保存或恢复签名映射
- 适用场景
- 适合逆向工程与复古游戏或固件分析:判断 ROM 平台、反编译例程、跟踪模拟执行中的寄存器取值,并在不同版本二进制之间沿用函数名。也适合需要同时打开多个 Ghidra 会话进行对比的工作。
- 运行要求
- 以 Python 包形式在本地通过 stdio 运行,需要 Python 3.10 或更高版本。需要安装 Ghidra 11.x 或 12.x 及 JDK 17,并通过必填的 GHIDRA_INSTALL_DIR 变量指定路径;pyghidra 会自动安装。实时模拟需要 BizHawk 的 EmuHawk,可通过 BIZHAWK_EXE_PATH 指定。设置 MOCK_MODE=1 可在没有 Ghidra 或 BizHawk 时用于测试。另提供 Docker 镜像。
安装
在 SourceWeft 中
- 打开 控制台中的 Ghidra BizHawk MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Ghidra BizHawk MCP
A unified MCP (Model Context Protocol) server bridging Ghidra's headless static analysis with BizHawk's live emulation — switch between decompiling a ROM and running it on real hardware in the same session.
GBA ROMs: If analyzing Game Boy Advance ROMs, install pudii/gba-ghidra-loader in your Ghidra installation for proper ROM header parsing, mirrored memory regions, and I/O register maps. The loader repository has pre-built
.gpafiles for Ghidra 11.x.
Prerequisites
Architecture
Security Model
The MCP server communicates with the MCP client exclusively over stdin/stdout — no HTTP or network listener. The only local TCP socket is a loopback-only connection (127.0.0.1:8766) between the server and BizHawk's built-in Lua socket server. This is used solely for live-emulation features and is not exposed to the network.
Hardware & Retro Ecosystem Integration
ghidra-bizhawk-mcp includes native out-of-the-box support for retro-reversing automation pipelines via Ghidra's static analysis, plus live emulation via BizHawk's multi-system emulator. The server bundles:
- Nintendo Entertainment System (NES) via
GhidraNes - Super Nintendo Entertainment System (SNES) via native 65816 memory maps
- Game Boy Advance (GBA) via
gba-ghidra-loader - Nintendo DS (NDS) via
NTRGhidra - Nintendo Switch via
ghidra-switch-loader - PlayStation 1 (PSX) via
ghidra_psx_ldr - Sega Genesis / Mega Drive via native 68000 memory maps
- Sega Master System / Game Gear via
Ghidra-SegaMasterSystem-Loader - Sega Dreamcast via native SuperH4 memory maps
Zero-Input Triage — Worked Example (GBA)
The primary entry point is triage_and_load_retro_rom. Call it with any ROM path and the server handles the rest:
Execution Chaining Flow
Instead of forcing your AI agent to spend cycles manually identifying architecture maps, register layouts, or memory segments, chain the automated ingestion pipeline:
- Invoke
triage_and_load_retro_romwith a target file path. - The server headlessly parses the binary file structure (
NES\x1a,NTR,NSO0,GBA, SNES title vectors,PS-X EXE,SEGA,TMR SEGA,SEGA ENTERPRISES), binds the matching Ghidra language module (6502:LE:16,ARM:LE:32:v4t,AARCH64:LE:64,65816:LE:24,MIPS:LE:32,68000:BE:32,Z80:16,SuperH4:LE:32), loads standard address memory blocks, and links automated signature cache arrays. - Use the integrated
emulate_sliceoremulate_slice_with_tainttools to analyze localized console loops — no physical console hardware or open GDB networking ports needed.
Triage Tool
Quick Start
1. Install
Or from source:
2. Set environment
3. Run
The server listens on stdin/stdout — pipe it to any MCP-compatible client.
Docker
The container bundles JDK 17, Ghidra 11.2, and the server — no host dependencies beyond Docker.
Configuration
Environment Variables
Claude Desktop
Add to your claude_desktop_config.json:
Cursor
Add to your Cursor MCP configuration:
Tools
Session management
Most tools accept an optional session_id parameter — omit it to use the most recently loaded session.
Read / Analysis
Write / Mutation
Assembly-level
Byte-sequence search
Binary diffing
Workspace Sessions
Each analyze_binary call creates a named session. Sessions keep their Ghidra project open independently, so multiple binaries can be loaded concurrently:
Deployment
Docker (multi-user / CI)
The Dockerfile bundles Ghidra 11.2 and JDK 17 in a slim Python 3.11 image. Bind-mount your binaries directory at runtime.
MCP Bundle (MCPB — Claude Desktop / Smithery)
Package as a portable .mcpb bundle for one-click install in Claude Desktop or publishing on Smithery.
Prerequisites: Install the MCPB CLI:
Build the bundle:
Or manually with mcpb:
The output ghidra-bizhawk-mcp.mcpb wraps the server with a manifest.json that prompts for GHIDRA_INSTALL_DIR (required) and optionally BIZHAWK_EXE_PATH at install time — no manual JSON editing.
Publishing to Smithery:
Smithery's publish API requires MCP-style tool schemas (inputSchema) and
object-form prompt arguments, which the MCPB schema forbids in manifest.json.
The build script therefore emits a second bundle whose manifest is patched from
mcpb/tool-schemas.json:
P-code micro-emulation
All run inside the pyhidra process via Ghidra's EmulatorHelper — no GDB/LLDB, no network ports, no debugger stubs. Works on ARM, x86, MIPS, and any Ghidra-supported architecture.
Worked example — breaking on a register condition
Suppose you're reversing a GBA ROM and want to find the first time r0 becomes zero inside a loop at 0x08000100:
This is especially powerful for identifying copy-loop bounds (R3 >= R4), null-pointer paths (R0==0), or switch-table targets (PC==0x).
Function fingerprinting / signature transfer
Persistent signature stash (server-side cache)
Workflow — fully automated persistence:
Try these prompts
After configuring your MCP client (see Configuration), ask your AI agent:
- "Load this GBA ROM and decompile the entry point."
- "What functions call 0x8001234 in this NDS binary?"
- "Triage this PSX EXE and trace r0 through the first 20 instructions."
- "Diff the two sessions I have open and show me changed functions."
Project Structure
How it works
pyhidra.start()boots Ghidra's JVM once at server startup- Each
analyze_binarycall opens a new Ghidra project in its own named session - Read/write tools route to the requested session via
session_id(or the active default) - Write tools apply changes directly to the Ghidra program database
- Sessions persist until explicitly closed — enabling multi-binary workflows and diffing
来源:README.md,提交 8892856
工具
0版本历史
1- v1.1.0最新Oct 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分