
Pyghidra Lite
io.github.johnzfitch由 GitHub 帳號 johnzfitch 發布v0.9.1更新於 Oct 24, 2026
Token-efficient Ghidra RE: decompile, xrefs, Swift/ObjC, ELF/Mach-O, async analysis
概覽
以 Ghidra 為基礎、講求省 token 的逆向工程伺服器,讓助理載入、反編譯、搜尋並交叉參照 ELF、Mach-O 與 PE 二進位檔。
- 可以做什麼
- 載入與管理二進位檔:匯入並分析檔案、列出已載入的二進位檔與工作狀態、移除二進位檔並取消工作
- 檢視二進位檔概況:摘要、格式、區段與熵值,以及函式、匯入、匯出與型別清單
- 讀取程式碼:反編譯、反組譯、p-code 與原始位元組及檔案位移,可選擇顯示控制流程圖
- 追蹤參照:交叉參照、呼叫圖,以及位址與函式之間的值流切片
- 搜尋內容:字串、位元組樣式、符號與還原出的資料型別,可於背景執行
- 標註(需選擇開啟):重新命名函式、加入註解或設定原型,每次變更都需使用者確認
- 適用情境
- 適合讓助理對編譯後的二進位檔做初步分析或逆向:惡意程式初篩、理解不熟悉的程式、比較不同建置版本之間的變化。也適合已安裝 Ghidra、希望取得精簡且低 token 輸出的分析人員。
- 執行需求
- 以 Python 套件在本機透過 stdio 執行(pip install pyghidra-lite);使用 Claude Code 外掛方式需要 PATH 中有 uv。需要 64 位元 JDK 21+ 與 Ghidra 11.x 或 12.x,若未自動偵測到需設定 GHIDRA_INSTALL_DIR。選用設定包括 PYGHIDRA_LITE_PROJECT_DIR、PYGHIDRA_LITE_RESTRICT_PATHS,以及 HTTP 傳輸用的 PYGHIDRA_LITE_AUTH_TOKEN。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pyghidra Lite,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
pyghidra-lite
[PyPI]
[Python]
[Downloads]
[License]
[CI]
[MCP Registry]
[MCP spec]
[Claude Code plugin]
[Ghidra]
[Platforms]
Token-efficient MCP server for Ghidra-based reverse engineering. Analyze ELF, Mach-O, and PE binaries with Swift, Objective-C, and Hermes support — decompile, disassemble, trace calls and value flow, recover data types, and map addresses back to file offsets. Runs on Linux, macOS, and Windows; ships as a Claude Code plugin with a bundled reverse-engineering skill.
Bottom line: a lean, security-first Ghidra MCP. It is read-only by default — analysis tools never mutate your binaries or the server's configuration (which is frozen for the life of the process). The one tool that writes, annotate (rename / comment / prototype), is opt-in (--allow-write) and human-confirmed: every change is approved by you through an MCP elicitation prompt before it's committed, and it fails closed if your client can't ask. You get an analyst-agent that can persist its findings — under supervision — without giving up the read-only safety story.
Quick Start
1. Prerequisites
A 64-bit JDK 21+ and Ghidra 11.x or 12.x are required (tested with Ghidra 12.1.2 and JDK 21).
Ghidra installed via Homebrew (brew install ghidra) or to /opt/ghidra or ~/ghidra is found automatically. Elsewhere — including any Windows install — point GHIDRA_INSTALL_DIR at the extracted ghidra_<version>_PUBLIC folder.
2. Install — pick one
- Claude Code plugin (recommended for Claude Code)
- MCP server + reverse-engineering skill in one step; prompts for your Ghidra directory. Needs uv on
PATH.
- Any MCP client
- Install the package, then add it to your client (Claude Code:
.mcp.jsonin your project or~/.claude.json; other clients: see MCP Configuration).
3. Check the environment
[!TIP] Plugin users without a shell install can run the same check with
uvx pyghidra-lite doctor.
4. Use it
Installation
Claude Code plugin
Installs the MCP server (run with uvx, so uv must be on
PATH) together with the pyghidra-lite:reverse-engineering workflow skill, and asks
for your Ghidra directory, cache directory, optional path restriction and whether to
allow annotate:
- On Claude Code before 2.1.275, run
/plugin marketplace add johnzfitch/pyghidra-litefirst, then/plugin install pyghidra-lite@pyghidra-lite. - The plugin pins an exact package version and runs one server per session. After a
plugin update, run
/reload-plugins(or start a new session) to switch to it. - Change the settings later under
/config.
[!WARNING] If you also have a manual
pyghidra-liteentry in.mcp.jsonor~/.claude.json, remove it — otherwise every tool appears twice.
PyPI (recommended)
Arch Linux (AUR)
From source
MCP Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
uvx auto-installs pyghidra-lite from PyPI on first run. Ghidra is auto-detected; set GHIDRA_INSTALL_DIR in env if needed:
Claude Code
Create .mcp.json in your project (or ~/.claude.json for global):
Direct mode (skip proxy)
For single-session use or debugging, run the server directly:
With explicit Ghidra path
Restrict to specific paths
By default, pyghidra-lite can load binaries from any path (the MCP client handles permissions). Use --restrict-path to lock down access:
Shared HTTP transport (network access)
The HTTP/SSE transports are shared and apply DNS-rebinding protection (Host/Origin
validation). Binding to a non-loopback address additionally requires both
--restrict-path and a bearer token:
Clients then send Authorization: Bearer <token> on every request. Terminate TLS
at a reverse proxy for remote access.
Tools (9)
pyghidra-lite provides 8 read-only analysis tools plus 1 opt-in write tool, all auto-detecting format (ELF/Mach-O/PE) and language (Swift/ObjC/Hermes):
🔒 annotate is the only tool that writes. It is disabled unless the server is
started with --allow-write, and every change requires interactive
confirmation (MCP elicitation) before it is committed — clients that can't
confirm get a preview only. See Writing back.
Examples
Auto-Detection
All tools automatically detect:
- Format: ELF, Mach-O, PE
- Language: Swift, Objective-C, Hermes/React Native
- Runtime: Bun, Node.js, Electron, PyInstaller
Use the type and detail parameters to access format/language-specific features.
Bootstrap Modes
bootstrap_mode="named": transfer only meaningful source names (default).bootstrap_mode="all": also assign stable synthetic labels to sourceFUN_*functions during transfer, which is useful for large version-to-version bootstrap workflows where uniqueness matters more than semantics.
Writing back
By default pyghidra-lite is read-only — no tool mutates your binaries. To let
an agent persist findings (rename a function, attach a comment, fix a prototype),
start the server with --allow-write:
Then the annotate tool becomes usable:
Every call is human-confirmed: the server sends an MCP elicitation prompt
showing the exact old -> new change, and only commits if you accept. If the
server was started without --allow-write, the tool refuses; if your MCP client
doesn't support elicitation, the tool returns a preview with applied: false
and writes nothing (fail closed). Confirmed changes are written in a single
Ghidra transaction and saved to the on-disk project.
Audit journal. Because MCP elicitation ultimately trusts the client (an
autonomous "auto-approve" client can self-confirm), every write is recorded in
annotate_audit.jsonl next to the projects — and every declined or failed
attempt is logged too. Each line records old -> new, so the journal is both an
accountability trail and an undo log; a flood of entries is your signal that an
auto-agent is churning, and the server also nudges (ctx.warning) as write
volume climbs. The journal is fail-closed and hardened: a write is recorded
before it's applied (if it can't be journaled, it isn't committed), the file
is created 0o600 and opened with O_NOFOLLOW (a symlinked journal is
refused), and it rotates by size so it can't grow without bound.
Analysis Profiles
The server defaults to fast to stay within MCP timeout limits. Use load(fresh=True) to run deeper analysis when needed:
Token Efficiency
pyghidra-lite is designed for minimal token usage:
- Compact JSON - results are serialized without indentation, one text block per call (measured: 33% fewer characters than pretty-printed output across all tools on a sample binary)
- No empty fields - false flags, empty tag lists and null context are omitted
- Slices, not dumps -
code("func,var", what="pcode")returns only the ops a value flows into (onws2_32.dllWSAStartup: ~1.9K characters vs ~22K for the full listing) - Compact output by default -
functions(binary, type="all")returns minimal{name, addr}pairs - Opt-in detail - use
info(detail="full"),code(cfg=True), or richertype/whatmodes only when needed - Progress reporting - large imports report progress every 10% or 60s
- Truncated strings - long strings capped at 500 chars
Architecture
By default, pyghidra-lite runs as a lightweight stdio proxy (~10MB) that forwards to a persistent shared HTTP backend (~500MB JVM). Multiple sessions share a single JVM instead of each spawning their own.
The proxy auto-starts the backend on first use, and a file lock plus a port check stop concurrent proxies from spawning duplicates. The backend keeps running until pyghidra-lite stop; binaries idle for 30 minutes are unloaded from memory (the 2 most recent stay loaded) and reload transparently from disk.
[!IMPORTANT] The proxy reuses whatever backend is already listening, whatever its version. After upgrading pyghidra-lite, run
pyghidra-lite stopso the next session starts the new code. (serveand the Claude Code plugin run one server per session and don't have this issue.)
Set PYGHIDRA_LITE_NO_AUTOSTART=1 to disable auto-start (useful with systemd).
Configuration
Every setting is a serve flag or an environment variable (handy in an MCP env block):
Multi-Agent Support
Each binary gets its own Ghidra project, enabling:
- Parallel analysis of different binaries
- Shared results across agents
- Persistent analysis (survives restarts)
- Content-addressed storage (same binary = same analysis)
Projects are stored in ~/pyghidra-lite/projects/ (Windows: %LOCALAPPDATA%\pyghidra-lite\projects\),
or in the pre-0.8 location ~/.local/share/pyghidra-lite/projects/ if that already exists.
Override with --project-dir or PYGHIDRA_LITE_PROJECT_DIR. Ghidra 12+ rejects project paths with a
component starting with ., so a legacy ~/.local directory only works with Ghidra 11.x —
pyghidra-lite doctor flags this.
Links
License
MIT
來源:README.md,提交 b0fc4c4
工具
0版本歷史
2- v0.9.1最新Oct 10, 2026
- v0.7.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分