
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 分