
Ghidralens
io.github.hellosverre由 GitHub 账号 hellosverre 发布v0.1.1更新于 Oct 24, 2026
Interactive Ghidra views in your AI client: decompile, rename, and navigate a binary.
概览
GhidraLens 把 Ghidra 二进制分析以交互视图带入 AI 客户端,让助手反编译、浏览函数、查看调用图并重命名符号。
- 可以做什么
- 在常驻的 Ghidra 会话中打开二进制并读取程序信息,自动分析只做一次,重开或重启后仍可复用。反编译函数,并浏览二进制中的全部函数,可按地址、名称、大小或调用者数量筛选和排序。查看调用图(调用者与被调用者),并查询交叉引用和字符串。重命名符号、添加注释,再保存程序,使修改写入 Ghidra 项目。在对话中渲染反编译视图、函数浏览器和调用图,点击视图即可触发重命名和注释。
- 适用场景
- 适合逆向工程场景:希望助手与自己查看同一个实时程序,让助手反编译指定函数、追踪调用关系,并随手重命名标识符。也适合在客户端重启后保留已分析的二进制,避免重复执行耗时的 Ghidra 自动分析。
- 运行要求
- 以本地 stdio 进程运行(npm 包 ghidralens),另需在目标二进制上启动独立的 PyGhidra 桥接进程。需要 Ghidra 11.3+、JDK 21+、Python 3.9-3.13(不支持 3.14)和 Node 20+。需设置 GHIDRALENS_BRIDGE_URL(默认 GHIDRALENS_TOKEN(桥接启动时打印的令牌)。仅支持桌面客户端。
安装
在 SourceWeft 中
- 打开 控制台中的 Ghidralens,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
GhidraLens
Ghidra, rendered inside your AI client. Click a symbol to rename it. Click a call to follow it.
[CI] [MCP Apps] [Ghidra 11.3+] [Local models] [npm] [MIT]
Every Ghidra MCP server so far returns text. The model can read it; you cannot
navigate it. GhidraLens returns the same analysis as an interactive view —
built on MCP Apps
(io.modelcontextprotocol/ui), the extension that lets a server ship real HTML
into the conversation.
You and the model are looking at the same live program. Rename a variable by clicking it and the model's next decompile sees the new name.
That is a real screenshot: where.exe, decompiled by Ghidra, every identifier
carrying the address it came from.
What you get
Function browser
Call graph
Ten tools total. Three open views; the rest are lookups and writes, including two the model never sees — they exist only so a click in a view can fire them.
How it fits together
The bridge is a separate long-lived process on purpose. Ghidra's auto-analysis is the expensive step, and it happens once. Measured on a 64 KB Windows system utility (198 functions):
Restart the MCP server or the client and the analysed program is still there.
Setup
Prerequisites: Ghidra 11.3+, a JDK 21+, Python 3.9–3.13 (not 3.14 —
JPype has no wheel for it yet), Node 20+. See
bridge/setup.py.md — the Python side is fussy and that file
covers every way it goes wrong. GhidraLens finds a JDK for you if JAVA_HOME is
unset, which covers the usual "installed Java, shell has not restarted" case.
Then start the bridge on the binary you want to look at:
It prints a token. Put that, and the path to the built server, into your MCP client config:
Running from a clone instead? Point command at node and args at
/absolute/path/to/ghidralens/server/dist/index.js.
Then ask your client: "decompile the function that handles license validation".
Also listed in the official MCP Registry as io.github.hellosverre/ghidralens.
Editing the config by hand? Quit the client first — properly, including any system-tray icon. Claude Desktop keeps its own copy of
claude_desktop_config.jsonin memory and writes it back over yours when it exits, so an edit made while it is running silently disappears on the next restart. Editing through Settings → Developer → Edit Config avoids the race entirely.
Tools
add_comment is hidden from the model deliberately. Visibility is how MCP Apps
separates "the agent may do this" from "a click may do this"; keeping write
tools out of the model's list keeps it short and stops the model from renaming
things on its own initiative.
Renames and comments live in memory until save_program writes them into the
Ghidra project — after which they show up in the Ghidra GUI like any other edit.
Developing the views without Ghidra
ui/dev/harness.ts is a real MCP Apps host — it runs the SDK's AppBridge
against the view in an iframe, so the ui/initialize handshake, the opening
ui/notifications/tool-result, and every tools/call a click fires all go over
real postMessage JSON-RPC. There is a message trace down the right-hand side and
a host-theme switch, because the views have to look right in both.
Two data sources, switchable in the toolbar:
- fixtures — no Ghidra needed, nothing to install
- live bridge — proxies to a running bridge, so you develop against a real analysed program
Use live before you trust anything. Fixtures are tidy; real output is a 400-line function with 56 locals and an 87-node call graph, and that is where layout actually breaks.
Running it on a local model
Reverse engineering is exactly the work people would rather not send to a hosted
model, so agent/ollama-agent.mjs is a small MCP host that puts GhidraLens
behind Ollama instead. No API key, nothing leaves the
machine.
It respects _meta.ui.visibility, so the app-only tools stay hidden from the
model — the same separation a graphical client enforces. A ~9B model is enough to
orient itself with find_strings and list_functions; a 14B is noticeably
better at reading decompiled C.
Tests
The first two are what CI can run. test_session.py is the one that matters
after touching bridge/session.py — it is the only thing that proves the Ghidra
API calls are right, and it caught three real bugs the day it was written.
Containerising it
The Dockerfile builds the server and views for clients or registries that want
to start it themselves. One thing to get right:
A stdio MCP server speaks JSON-RPC on stdout, and npm run / pnpm run print
the script banner there first:
Those lines land in the stream ahead of the handshake and the client gives up mid-initialize. The symptom is unhelpful - the container builds, starts, exits cleanly, and the client just reports no tools - so it is worth not stepping on. Invoke node directly.
Real analysis still needs the bridge on the host: 127.0.0.1 inside a container
is the container, so point GHIDRALENS_BRIDGE_URL at host.docker.internal or
a real address.
Security
The bridge binds 127.0.0.1 only, requires a per-run token in
X-GhidraLens-Token, and rejects any request carrying an Origin or Referer
header — so a page open in your browser cannot reach your decompiler. It has no
multi-user model and is not meant to be exposed; --host refuses anything but
loopback.
Analysing a binary does not execute it, but Ghidra will happily open malware. Use the same isolation you would use for any other RE work.
Licence
MIT.
来源:README.md,提交 d8502b0
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分