MCP servers for reverse engineering: GhidraMCP, IDA Pro and radare2 set up
How to install and configure GhidraMCP, ida-pro-mcp and the radare2 MCP server in any MCP client, what each one lets the model do, and how an agent should use them without trusting the decompiler blindly.
· 9 min read

The Model Context Protocol (MCP) is what turns "paste this function into the chat" into "go and look." An MCP server wraps a tool — here, a disassembler — and offers its functions to the model as tools it can call: list the functions, decompile this one, show who calls it, rename it. The model stops guessing from fragments and starts querying the binary the way you would.
There is no single best server. The honest answer is use the one for the disassembler you already work in. The server is a thin bridge; the quality of the analysis comes from the disassembler behind it and the model driving it. This guide sets up the three that matter — GhidraMCP, ida-pro-mcp and the radare2 MCP server — in the common clients, and covers how an agent should use them.
How a reverse-engineering MCP server works
Every one of these has the same shape. Something runs next to the disassembler and exposes its analysis; the MCP client starts a server process (or connects to a URL) and lists its tools to the model. When the model calls decompile_function, the request goes through the bridge to the disassembler, which does the real work, and the result comes back as text.
Two practical consequences:
- Writes are real. A rename or comment made through the server lands in your Ghidra project or IDA database. That's the point — your own session sees the model's work — but keep a backup of the database before a long session, and review renames like you'd review a colleague's.
- Tool calls should need approval. Most agents ask before running an MCP tool, the same as a shell command. Leave that on for write tools until you trust the workflow.
GhidraMCP
GhidraMCP (Apache-2.0) is two pieces: a Ghidra plugin that runs a small HTTP server inside Ghidra, and a Python bridge, bridge_mcp_ghidra.py, that the MCP client starts and that talks to that HTTP server. It exposes decompilation, renaming of methods and data, and listing of methods, classes, imports and exports. Check the README for the Ghidra version the current release is built against; the plugin is tied to it.
Install:
- Download the release zip from the repository's Releases page.
- In Ghidra: File → Install Extensions, add the zip, restart Ghidra.
- Open a program in the CodeBrowser and enable the plugin under File → Configure → Developer (GhidraMCPPlugin).
- Install the bridge's Python dependencies:
pip install -r requirements.txtfrom the release.
The plugin listens on 127.0.0.1:8080 by default. The client config, in the mcpServers shape Claude Desktop, Cursor, caveira and most clients read:
{
"mcpServers": {
"ghidra": {
"command": "python",
"args": [
"/ABSOLUTE/PATH/bridge_mcp_ghidra.py",
"--ghidra-server",
"http://127.0.0.1:8080/"
]
}
}
}
In Claude Code, the same thing from the shell:
claude mcp add ghidra -- python /ABSOLUTE/PATH/bridge_mcp_ghidra.py \
--ghidra-server http://127.0.0.1:8080/
In Codex, in ~/.codex/config.toml:
[mcp_servers.ghidra]
command = "python"
args = ["/ABSOLUTE/PATH/bridge_mcp_ghidra.py", "--ghidra-server", "http://127.0.0.1:8080/"]
What the model gets, at the core: decompile a function, rename methods and data, and list methods, classes, imports and exports. Recent releases add more on top — disassembly, cross-references, comments, prototypes and variable types among them — so read the tool list in the README for the version you install. Ghidra must be running with the program open — the bridge is only as alive as the CodeBrowser behind it.
Where it fits: the best free option with a real decompiler behind it, and the one most people should start with. If you need batch work over many binaries rather than a live session, use Ghidra headless with a script instead (the Ghidra section here has one that dumps every function's pseudo-C).
ida-pro-mcp, and the official Hex-Rays server
ida-pro-mcp (MIT) bridges IDA Pro to MCP clients: decompile, disassemble, cross-references, renames, comments and types. It needs IDA Pro 8.3 or later (9 recommended); IDA Free is not supported. Its README lists the MCP clients it can configure for you, Claude Code, Codex and Cursor among them, and now points to the official server from Hex-Rays as well.
Install with pip, then let it set itself up:
pip install --upgrade git+https://github.com/mrexodia/ida-pro-mcp
ida-pro-mcp --install # installs the IDA plugin and configures the clients it finds
ida-pro-mcp --config # prints the JSON for a client it doesn't know
Use --config rather than writing the JSON by hand: the exact command and arguments depend on where pip put it and which Python IDA uses, and the printed block has them right for your machine. Paste it into the client's mcpServers section. Then open a database in IDA and start the plugin from Edit → Plugins — the server answers only while IDA has a database loaded.
The official Hex-Rays IDA MCP server (MIT) needs IDA 9.4 or later with idalib. If you're on a current IDA, read both READMEs and pick one; the workflow below is the same either way.
What the model gets: the Hex-Rays decompiler's pseudocode, disassembly, cross-references to and from an address, strings, renames, comments, and local types — enough to rename a function, fix its prototype, and watch the decompilation improve as it goes.
Where it fits: if you own IDA Pro, this is the strongest setup of the three, because the Hex-Rays decompiler and IDA's type system are behind it. The cost is the IDA license.
radare2: r2mcp
The radare2 MCP server (r2mcp) is maintained in the radareorg organization. It runs radare2 directly — no GUI, no plugin to enable — which makes it the lightest of the three and the easiest to run in a container or over SSH.
Install it with radare2's package manager:
r2pm -ci r2mcp
And configure the client to start it through r2pm:
{
"mcpServers": {
"radare2": {
"command": "r2pm",
"args": ["-r", "r2mcp"]
}
}
}
What the model gets (the README has the exact tool list): open and analyse a file, list functions, imports and strings, disassemble, follow cross-references, and pseudo-C through radare2's own decompilers (pdc, or r2ghidra / r2dec if you've installed them with r2pm). The decompiler output is rougher than Ghidra's or Hex-Rays', so treat r2 as the fast, scriptable option for narrow questions rather than the place to read big functions.
You often don't need the MCP server at all for radare2: every r2 command prints text, so an agent with a shell can run r2 -q -c 'aaa; afl' ./sample and read the result. The server is worth it when you want a persistent session the model can keep querying without re-analysing the binary each time.
rea, if your client ships it
rea is an MCP server for reverse engineering that covers native binaries, JavaScript and Electron apps, .NET assemblies and websites, so it reaches the targets the three disassembler bridges don't. caveira ships with it already configured; in another client, follow its README. It sits alongside a disassembler bridge rather than replacing one.
Adding a server to caveira
caveira reads MCP servers from ~/.caveira/mcp.json (Claude Code's mcpServers shape, stdio or streamable HTTP), with a project's .caveira/mcp.json laid over it, so the JSON blocks above work as they are. /mcp in the terminal, or Settings → MCP servers in the app, lists them, turns them on and off, and can copy in the servers you already set up in Claude Code, Claude Desktop or Cursor. The tools show up to the model as mcp__ghidra__…, mcp__radare2__…, and every call goes through the same approval as a shell command.
How an agent should use them
Connecting the server is the easy part. What makes the difference is how the model is told to use it. Put rules like these in your project instructions (CAVEIRA.md, CLAUDE.md or AGENTS.md):
- Navigate before reading. List functions, search strings and imports, follow cross-references from the interesting ones, and only then decompile. Decompiling everything first floods the context.
- Cite an address for every claim, and mark it confirmed (seen in the disassembly or at runtime) or inferred (from pseudo-C or names).
- Rename with a reason. Every rename gets a comment with the evidence, so you can audit the model's reasoning in the database afterwards.
- Check types against the assembly. A wrong prototype propagates; fix it at the source, then re-decompile the callers.
A starting prompt:
Using the ghidra MCP tools: list imports and strings, find the code that handles the config file, and decompile only those functions. For each one, give its address, what it does, and whether that's confirmed in the disassembly or inferred. Rename only what you can justify, with a comment saying why.
Which one is best
- You own IDA Pro: ida-pro-mcp or the official Hex-Rays server. The best decompiler, the best types.
- You don't, or you want free and open source: GhidraMCP. A real decompiler, a GUI to check the model's work in, and the widest use.
- Terminal, containers, quick questions: r2mcp, or just radare2 from the shell.
All of them work in any client that speaks MCP. The client and model decide the rest: how much decompiled code fits in context, and whether the model will do the work at all — mainstream assistants refuse some reversing (cracking-adjacent work, DRM, malware internals) even when it's legitimate, which this guide covers. Whatever you pick, reverse binaries you own or are authorized to analyse, and keep the model citing addresses.