Ghidralens logo

Ghidralens

Interactive Ghidra views in your AI client: decompile, rename, and navigate a binary.

Install Ghidralens

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ghidralens": {
      "command": "npx",
      "args": [
        "-y",
        "ghidralens"
      ]
    }
  }
}

Settings β†’ Developer β†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passedβ€” started and listed 10 tools correctly ().

Overview

Tools10

What Ghidralens lets your agent do. Expand a tool for its parameters.

Verified live~867 tokens of context

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

17/17 checks healthy over the last 79d

What it can do

From the 10 tools this server returned when we ran it; 10 declare their own safety hints.

Makes network requests Β· 1Read-only tools Β· 10
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age66 days
Maintainers1

Observed 2026-11-03 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 4d ago via OSV.dev Β· ghidralens (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

npm downloads1.8kPackage downloads in the last 30 days.
Last commit3mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed10Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

From the project 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

The decompiler view

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

ViewWhat it does
DecompilerGhidra's C output as a live token stream β€” every identifier carries its address and its kind. Click a local to rename it, click a call to follow it. Callers, callees and variables in a sidebar.
Function browserEvery function in the binary, filterable and sortable by address, name, size or caller count. Click a row to decompile it.
Call graphCallers to the left, callees to the right, the function you asked about in the middle. Click any node to recenter.

Function browser

The function browser

Call graph

The 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

Code
  MCP client  ──stdio──▢  server/  ──HTTP──▢  bridge/  ──JPype──▢  Ghidra (JVM)
  (Claude,                 TypeScript         PyGhidra            program stays
   Cursor, …)              MCP server         session             resident
       β–²
       β”‚  ui:// HTML in a sandboxed iframe
       └──  ui/  three self-contained views

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):

First open, with analysis25 s
Re-open the same binary0.3 s
Decompile one 2 KB function0.4 s
87-node call graph< 0.1 s

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.

bash
git clone https://github.com/hellosverre/ghidralens
cd ghidralens
npm install
npm run build

Then start the bridge on the binary you want to look at:

bash
python bridge/serve.py --binary /path/to/target.exe

It prints a token. Put that, and the path to the built server, into your MCP client config:

config.json
{
  "mcpServers": {
    "ghidralens": {
      "command": "npx",
      "args": ["-y", "ghidralens"],
      "env": {
        "GHIDRALENS_BRIDGE_URL": "http://127.0.0.1:8799",
        "GHIDRALENS_TOKEN": "paste-the-printed-token-here"
      }
    }
  }
}

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.json in 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

ToolVisible toRenders
open_binarymodelβ€”
program_infomodelβ€”
decompilemodel + viewDecompiler
list_functionsmodel + viewFunction browser
call_graphmodel + viewCall graph
find_stringsmodelβ€”
xrefs_tomodel + viewβ€”
rename_symbolmodel + viewβ€”
add_commentview onlyβ€”
save_programmodelβ€”

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

Terminal
npm run dev:ui
# open http://localhost:5173/dev/harness.html

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.

bash
OLLAMA_MODEL=qwen3:14b node agent/ollama-agent.mjs "what does this binary do?"

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

SuiteNeeds GhidraCovers
node server/smoke.mjsnoMCP surface: tools, ui:// resources, tool visibility, graceful failure with no bridge
python bridge/test_serve.pynoBridge auth, CSRF rejection, routing, input validation
python bridge/test_session.pyyesEvery Ghidra call: analysis, caching, decompiler tokens, imports, renames, writes
node server/live.mjsyes (bridge running)The whole chain, and that every payload matches the shape the views index into

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:

dockerfile
CMD ["node", "server/dist/index.js"]     # correct
CMD ["npm", "run", "start"]              # breaks the protocol

A stdio MCP server speaks JSON-RPC on stdout, and npm run / pnpm run print the script banner there first:

Code
> ghidralens@0.1.1 start
> node server/dist/index.js

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.

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about Ghidralens

ghidralens is an MCP server that... brings interactive Ghidra views into an AI client for binary analysis. It provides a live decompiler, filterable function browser, and call graph, with clickable navigation and renaming. The server uses MCP Apps HTML views, while a bridge connects the MCP server to a resident Ghidra program.

ghidralens provides a live decompiler, a filterable and sortable function browser, and an interactive call graph. The decompiler supports clickable identifier renaming and call navigation, the function browser opens functions for decompilation, and call-graph nodes recenter the graph.

Running ghidralens requires Ghidra 11.3 or newer, JDK 21 or newer, Python 3.9 through 3.13, and Node 20 or newer. Python 3.14 is not supported because JPype does not yet have a compatible wheel.

Start the bridge with `python bridge/serve.py --binary /path/to/target.exe`, then configure your MCP client to launch the built ghidralens server and provide the bridge token through its environment configuration. Build the project first with `npm install` and `npm run build`.

The bridge keeps the analyzed program resident, so restarting the MCP server or client does not discard the analyzed program. Reopening the same binary can therefore avoid repeating the initial auto-analysis step.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGhidralens AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ghidralens?style=directory)](https://allmcps.com/mcp/ghidralens)
HTML Embed
<a href="https://allmcps.com/mcp/ghidralens"><img src="https://allmcps.com/api/badge/ghidralens?style=directory" alt="Ghidralens on AllMCPs" /></a>