
Ghidra Retro Mcp
io.github.getanirao由 GitHub 账号 getanirao 发布v1.0.0更新于 Oct 24, 2026
Headless Ghidra MCP server with P-code emulation and multi-console ROM triage.
概览
无界面 Ghidra MCP 服务器,用于逆向工程:识别复古主机 ROM、反编译二进制、模拟 P-code 指令片段并对比会话。
- 可以做什么
- 识别并加载 ROM,自动判定 NES、SNES、GBA、NDS、Switch、PSX、Genesis、SMS 或 Dreamcast 并绑定对应 Ghidra 语言
- 管理分析会话:导入并分析二进制、列出与关闭工作区
- 读取与分析代码:反编译函数(支持分页)、数据类型、交叉引用、调用图、入口点、工作区报告
- 修改项目数据库:重命名符号、添加注释、创建结构体、改变量类型
- 检查汇编与字节:反汇编区间、导出清单、搜索字节模式、对比两个二进制
- 模拟 P-code 片段,支持寄存器初值、污点跟踪与断点条件;生成函数指纹并保存或恢复签名映射
- 适用场景
- 适合让助手在没有 Ghidra 图形界面的情况下逆向二进制或复古主机 ROM:识别 ROM、反编译例程、通过模拟指令片段追踪寄存器取值,或用签名映射在固件版本间沿用函数名。
- 运行要求
- 以 PyPI 包形式通过 stdio 在本机运行,需要 Python 3.10 或更高版本。需要 Ghidra 11.x 或 12.x 安装并设置 GHIDRA_INSTALL_DIR,以及 JDK 17(Ghidra 自带)和 pyghidra。可选通过 BIZHAWK_EXE_PATH 指定 BizHawk/EmuHawk 以启用实时模拟;MOCK_MODE=1 可在无 Ghidra 和 BizHawk 时运行。另提供 Docker 镜像。
安装
在 SourceWeft 中
- 打开 控制台中的 Ghidra Retro 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.0.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分