Until December 31: monthly plans give up to 2.5 times their price in credit. Scale is $200 a month with $400 of usage credit. See plans →

Ghidra MCP

Set up a Ghidra MCP server with Claude Code or OpenCode on Abliterator: compare GhidraMCP, ghidra-mcp, ReVa and GhidrAssistMCP, install one, run a first analysis.

Updated GhidraMCPReverse EngineeringClaude Code

Quick answer

A Ghidra MCP server is a bridge that lets an AI client decompile, list strings and imports, and rename functions in the program open in Ghidra. LaurieWired's GhidraMCP 2.0 exposes 30 tools over stdio: add it to Claude Code or OpenCode, point the client at Abliterator and pick kimi-k3.1-pro-abliterated. This follows GhidraMCP 2.0, commit 1e98025.

What a Ghidra MCP server does

A Ghidra MCP server lets an AI client work inside Ghidra through the Model Context Protocol. The model calls tools that decompile a function, list strings and imports, follow cross-references and rename symbols in the program you have open. The most used one is GhidraMCP by LaurieWired, licensed Apache-2.0. Its release 2.0 of October 10, 2026 pairs a Ghidra extension with a Python MCP server and exposes 30 tools. Several other projects share the name or a close one. These are the main ones, from their repositories (checked 2026-12-02):

Server Stars Transports Tools Ghidra Latest License Maintained
LaurieWired/GhidraMCP 12,133 stdio, streamable HTTP 30 12.1.4 2.0, 2026-10-10 Apache-2.0 Yes; 2.0 came about 16 months after 1.4
bethington/ghidra-mcp 6,416 stdio, streamable HTTP 219 in the README, 220 in the release notes; loaded in groups by default 12.2 v7.1.0, 2026-11-24 Apache-2.0 Yes
ReVa (cyberkaida) 991 streamable HTTP in Ghidra; stdio headless Not stated 12.0 to 12.2 v7.3.2, 2026-11-13 Apache-2.0 Yes
GhidrAssistMCP (jtang613, now symgraph) 823 streamable HTTP, SSE, served from inside Ghidra 103, 96 on by default 12.0 to 12.2 3.1.0, 2026-11-18 MIT Yes
pyghidra-mcp (clearbluejar) 472 streamable HTTP, stdio Not stated Not stated; uses the install in GHIDRA_INSTALL_DIR v0.3.0, 2026-11-02 Apache-2.0 Yes
ghidra-headless-mcp (mrphrazer) 200 stdio, TCP 212 Headless only, through pyghidra No releases; last commit 2026-09-16 GPL-2.0 Yes
pr0cf5/GhidraMCP 2 stdio, SSE 27 11.3.2 Last commit 2025-06-23 Apache-2.0 No: a copy of LaurieWired's 1.4 code

For IDA and Binary Ninja, see IDA Pro MCP and Binary Ninja MCP; AI reverse engineering compares servers for other disassemblers and debuggers.

This guide uses LaurieWired's GhidraMCP 2.0:

  • It is the most starred. It has nearly twice the stars of the next server, and bethington's ghidra-mcp began as a derivative of it in August 2025, per that project's README.
  • Its 30 tools fit any MCP client. Every turn resends the tool definitions, so a short list keeps requests small.
  • It speaks stdio by default. Claude Code and OpenCode start the server themselves; --transport streamable-http is there for clients that connect to a URL.
  • One release holds both parts: the extension built for Ghidra 12.1.4 and the Python server as a wheel.

The trade-off is the Ghidra version. The 2.0 extension loads only in Ghidra 12.1.4, and Ghidra 12.2 came out on October 22, 2026. If you need 12.2, GhidrAssistMCP, ReVa and bethington's ghidra-mcp ship 12.2 builds; the client setup below is the same apart from the server command or URL. For IDA, see IDA Pro MCP.

This guide follows GhidraMCP 2.0 at commit 1e98025, checked 2026-12-02. The configuration was verified against that commit's README, cli.py and server.py, and against the Claude Code and OpenCode docs linked below.

Only for systems you own or have written permission to test. For reverse engineering, also respect the software's license and the law where you are, and analyze samples in an isolated VM.

How the server reaches a model

An MCP server has no model of its own; the MCP client brings one. With GhidraMCP the chain has four parts:

  1. The Ghidra extension serves the open program over HTTP on 127.0.0.1:8080. It binds the loopback interface only (GhidraMCPPlugin.java).
  2. ghidra-mcp, the Python MCP server, turns those HTTP calls into MCP tools.
  3. The MCP client, Claude Code or OpenCode here, starts ghidra-mcp, gives its tools to the model and runs the calls the model asks for.
  4. The model is Abliterator. Claude Code reaches it through the Anthropic Messages API at https://abliterator.ai; OpenCode through the OpenAI-compatible API at https://abliterator.ai/v1. Both send the tools as native tool calls, which both models support (tool calling).

GhidraMCP's README also shows a generic mcpServers JSON block, which it says most clients accept, and a VS Code block. This guide uses Claude Code and OpenCode because both accept a custom model endpoint.

Before you start

  • An isolated VM that holds Ghidra, the MCP client and the binaries. Static analysis does not run the program, but the MCP client can run commands, so keep it away from your workstation and production networks.
  • Ghidra 12.1.4 from its release page. Ghidra 12.1 needs JDK 21 or later. Each Ghidra release unpacks into its own directory, so 12.1.4 can sit next to a 12.2 install.
  • Python 3.10 or later and uv, from GhidraMCP's prerequisites. Headless mode needs Python 3.10 to 3.13.
  • Claude Code or OpenCode, with an Abliterator key from /keys. Create a key for this lab only, with a spend limit (authentication). New accounts get $10 of credit.

Install GhidraMCP 2.0

Download the release in the VM and check its hash. The SHA-256 below is that of the file published for release 2.0, checked 2026-12-02:

curl -fLO https://github.com/LaurieWired/GhidraMCP/releases/download/2.0/GhidraMCP-release-2-0.zip
echo "ebf904fd6782e429e95a60a24fe0724b20c0acb2dedb304135a5281f6b5f2e72  GhidraMCP-release-2-0.zip" | sha256sum -c
unzip GhidraMCP-release-2-0.zip

The archive holds ghidra_12.1.4_PUBLIC_20261010_GhidraMCP.zip, the Ghidra extension, and ghidra_mcp-2.0.0-py3-none-any.whl, the MCP server. Install the extension as the README describes:

  1. Start Ghidra 12.1.4 and choose File > Install Extensions.
  2. Click +, select ghidra_12.1.4_PUBLIC_20261010_GhidraMCP.zip and restart Ghidra.
  3. Open a program in the CodeBrowser. Check that GhidraMCPPlugin is enabled under File > Configure > Developer.
  4. Optional: change the port under Edit > Tool Options > GhidraMCP HTTP Server. The default is 8080.

With a program open, the extension answers on its health route:

curl -s http://127.0.0.1:8080/health

A JSON reply with "status": "ok" means the extension is running. You do not start the Python server yourself: the MCP client runs it with uvx in the next step. The commands below pin it to the 2.0 tag, because the README's unpinned commands run whatever main holds (issue #186). To install from the wheel you downloaded instead, run uv tool install ./GhidraMCP-release-2-0/ghidra_mcp-2.0.0-py3-none-any.whl and use ghidra-mcp as the command.

On a VM without a desktop, ghidra-mcp --headless --binary <file> imports and analyzes the file through PyGhidra with no GUI. It needs the extension installed and GHIDRA_INSTALL_DIR set to your Ghidra 12.1.4 directory.

Route 1: Claude Code

Point Claude Code at Abliterator with the variables from the Claude Code guide:

export ANTHROPIC_BASE_URL="https://abliterator.ai"
export ANTHROPIC_AUTH_TOKEN="$ABL_API_KEY"
unset ANTHROPIC_API_KEY

export ANTHROPIC_MODEL="kimi-k3.1-pro-abliterated"
export ANTHROPIC_DEFAULT_OPUS_MODEL="kimi-k3.1-pro-abliterated"
export ANTHROPIC_DEFAULT_SONNET_MODEL="kimi-k3.1-pro-abliterated"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4.1-flash-abliterated"
export CLAUDE_CODE_SUBAGENT_MODEL="kimi-k3.1-pro-abliterated"

Then add GhidraMCP with the claude mcp add syntax from Claude Code's MCP docs. Everything after -- is the command that starts the server:

claude mcp add --scope user ghidra -- uvx --from "git+https://github.com/LaurieWired/GhidraMCP@2.0" ghidra-mcp --ghidra-server http://127.0.0.1:8080/

--scope user makes the server available in every directory; the default, local, ties it to the current project. Check the connection with claude mcp list, which prints ✔ Connected next to a working server.

Start Claude Code without its shell tool, so the model can read the binary through Ghidra but cannot run it:

mkdir -p ~/re-lab && cd ~/re-lab
claude --disallowedTools "Bash"

Per Claude Code's CLI reference, a bare tool name in --disallowedTools removes that tool from the model's context. Inside the session, /mcp shows ghidra with its tool count. Claude Code asks before each tool call you have not allowed. Approve the read tools as they come, or allow them with /permissions, and leave the rename_* and set_* tools on ask so you see every change to the database.

Behind a custom ANTHROPIC_BASE_URL, Claude Code v2.1.304 and later defer MCP tools and load them through tool search, which adds defer_loading fields to requests (MCP docs). With only 30 tools you can load them up front instead:

export ENABLE_TOOL_SEARCH=false

Route 2: OpenCode

OpenCode reaches Abliterator as an OpenAI-compatible provider (OpenCode guide) and starts local MCP servers over stdio. This opencode.jsonc holds the provider, the GhidraMCP server under mcp.servers in the format of OpenCode's MCP servers docs, and a rule that blocks the shell tool:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "abliterator/kimi-k3.1-pro-abliterated",
  "providers": {
    "abliterator": {
      "name": "abliterator",
      "env": ["ABL_API_KEY"],
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": {
        "baseURL": "https://abliterator.ai/v1",
      },
      "models": {
        "kimi-k3.1-pro-abliterated": {
          "name": "Kimi K3.1 Pro Abliterated",
          "capabilities": { "tools": true, "input": ["text", "image"], "output": ["text"] },
          "limit": { "context": 1048576, "output": 262144 },
          "compatibility": { "reasoningField": "reasoning_content" },
        },
        "deepseek-v4.1-flash-abliterated": {
          "name": "DeepSeek V4.1 Flash Abliterated",
          "capabilities": { "tools": true, "input": ["text", "image"], "output": ["text"] },
          "limit": { "context": 1048576, "output": 393216 },
          "compatibility": { "reasoningField": "reasoning_content" },
        },
      },
    },
  },
  "mcp": {
    "servers": {
      "ghidra": {
        "type": "local",
        "command": [
          "uvx", "--from", "git+https://github.com/LaurieWired/GhidraMCP@2.0",
          "ghidra-mcp", "--ghidra-server", "http://127.0.0.1:8080/",
        ],
        "codemode": false,
      },
    },
  },
  "permissions": [
    { "action": "shell", "resource": "*", "effect": "deny" },
    { "action": "ghidra_*", "resource": "*", "effect": "ask" },
  ],
}
Field Why
mcp.servers.ghidra OpenCode's current config format puts servers under mcp.servers. Its tools appear as ghidra_<tool>, such as ghidra_decompile_function_by_address
command The executable and its arguments as an array
codemode: false Keeps the 30 tools on the model's native tool list instead of OpenCode's default Code Mode grouping
permissions Denies the shell action and asks before every Ghidra tool call. OpenCode's base policy allows every action, so without the ghidra_* rule the model's renames and comments would run without a prompt (permissions)

Run opencode mcp list to check the connection, then start opencode in your lab directory. opencode mcp add ghidra -- uvx ... writes the same server entry without codemode, which you then add by hand.

First task: a program you compiled

The safest first target is a binary you built from source you have read. GhidraMCP's own test program, tests/fixtures/sample.c, is about 50 lines: a few arithmetic helpers, a checksum over an 8-byte constant, and a string compare that prints unlocked. Build it in the VM and strip the symbols, so the model has to work out what the functions do:

cd ~/re-lab
curl -fLO https://raw.githubusercontent.com/LaurieWired/GhidraMCP/1e980252087b2479a21b9ca6d82d5829538651a7/tests/fixtures/sample.c
gcc -O1 -fno-inline -o sample sample.c
strip sample

Import sample into a Ghidra project, open it in the CodeBrowser and let auto-analysis finish. Then work through these prompts in the client. Each names the tools so you can follow what the model calls.

  1. "Call get_program_info, then list_imports and list_strings. What kind of program is this, and which library functions does it use?" get_program_info returns the format, architecture, compiler, image base, entry points and hashes. list_imports returns the external symbols with their libraries, such as strcmp, puts and printf. list_strings returns each defined string with its address, including GhidraMCP-fixture-secret and unlocked.
  2. "Decompile main by address and explain it. List each FUN_ function it calls with a proposed name and a one-line reason. Don't rename anything yet." decompile_function_by_address returns C pseudocode. After stripping, the helpers appear under generated names such as FUN_00101189, and the model proposes names from what each body does.
  3. "Rename those functions with rename_function_by_address and add a decompiler comment at each entry saying what it does." Each call changes the Ghidra database, so the client asks first. The new names appear in the CodeBrowser at once.
  4. "Use get_xrefs_to on the string unlocked and get_function_calls on main. Which condition leads to that message?" The cross-references lead from the string to the compare in main, and the call graph shows strcmp on that path.
  5. "Read the 8-byte constant the checksum function uses with read_memory. Then draft a YARA rule that matches this build from the two strings and that constant, and say what could cause false positives." read_memory returns hex and ASCII for up to 4,096 bytes.

The rule should use only what the binary contains. For this build its shape is:

rule GhidraMCP_Fixture_Sample
{
    meta:
        description = "GhidraMCP test fixture built from tests/fixtures/sample.c"
    strings:
        $secret = "GhidraMCP-fixture-secret" ascii
        $msg = "unlocked" ascii
        $magic = { DE AD BE EF 13 37 CA FE }
    condition:
        uint32(0) == 0x464C457F and all of them
}

Test any generated rule against a set of clean files before you use it. For the analysis side of the work on real samples, such as indicator extraction, report writing and the cost of long sessions, see malware analysis.

Text in a binary comes from whoever wrote it. A sample's strings and symbol names can be written to read like instructions to the model, and GhidraMCP's issue tracker has an open report on exactly this. Keep the write tools on ask, keep the shell tool off, save a copy of the Ghidra project before a session that renames, and confirm the model's conclusions in the listing before they go into a report.

Which model to use

Both models support tool calling (tool calling) and a 1,048,576-token context. They refuse far less than the originals: refusals fell from 94% to 1% on DeepSeek V4.1 Flash and from 94% to 3% on Kimi K3.1 Pro (benchmarks).

Model Use it for Notes
kimi-k3.1-pro-abliterated Long interactive sessions that chain many tool calls across a binary Terminal-Bench 4.0 went from 66.6 to 62.3 after abliteration, a drop that is plausible but not statistically shown (benchmarks), so try it on a binary you know first
deepseek-v4.1-flash-abliterated Cheap, high-volume work: bulk renaming of small functions, string and import triage On security suites it stayed within noise of the original: CyberMetric-2000 94.2 → 93.8, InterCode-CTF 94.2 → 95.5, Cybench 98.3 → 96.6 (benchmarks)

In Claude Code, pin every model variable to deepseek-v4.1-flash-abliterated for a cheaper session. In OpenCode, pick abliterator/deepseek-v4.1-flash-abliterated with /models. Each turn resends the tool definitions and the conversation; Abliterator caches the repeated prefix automatically and bills it at $0.40 per 1M tokens on kimi-k3.1-pro-abliterated and $0.10 on deepseek-v4.1-flash-abliterated (prompt caching).

Why a hosted model sometimes stops

Hosted frontier models run cyber safeguards that judge each request, and decompiled code from a suspicious sample can trip them even when the work is defensive. The providers say so in their own policies:

  • Anthropic. Its Usage Policy, effective November 12, 2026, says it "does not prohibit security research, testing, or tool development conducted on systems you own or operate", and that "encountering a block does not by itself indicate a violation". For work that safeguards block, its Cyber Verification Program lists malware analysis under Defense Access, the only tier individuals can apply for. It is not available on the Free plan, and enrolled users "may experience some model refusals and classifier blocks for allowed security work".
  • OpenAI. Its Usage Policies, effective November 20, 2026, prohibit "circumventing our safeguards". Its Daybreak Trusted Access program lists malware analysis among the Blue tier's use cases, requires approval, and says "Some safeguards can still apply after approval, even with Daybreak Red."

If your team works under one of these programs, use it. Abliterator serves models with the refusal behavior removed from the weights, so the analysis does not depend on a safeguard's judgment of each request. Some uses are always prohibited; see the acceptable use policy. More on each provider: Claude refused and ChatGPT refused.

Troubleshooting

Symptom Cause Fix
Extension version mismatch ... Did not install when you add the extension Ghidra loads an extension only in the exact version it was built for; 2.0 targets 12.1.4 (issue #170 shows the message) Install Ghidra 12.1.4, or use a server with a build for your version
Ghidra logs Could not start the GhidraMCP backend on 127.0.0.1:8080. Is the port in use Another program, or a second CodeBrowser window, holds the port Change Server Port under Edit > Tool Options > GhidraMCP HTTP Server, restart Ghidra and pass the same port in --ghidra-server
Tool calls fail with [BACKEND_UNAVAILABLE] Cannot reach the GhidraMCP backend Ghidra is not running, the plugin is off in the CodeBrowser, or no program is open Enable the plugin, open the program, and check curl -s http://127.0.0.1:8080/health
[BAD_RESPONSE] Backend returned non-JSON ... An older GhidraMCP plugin may be installed A 1.x extension is answering the 2.0 server Remove the old extension and install the 2.0 zip
claude mcp list shows ✘ Failed to connect, or OpenCode lists the server as failed uvx is not on the client's PATH, or Python is older than 3.10 Run the uvx ... command in a terminal to see its error; use the absolute path from which uvx in the config
[BACKEND_TIMEOUT] The GhidraMCP backend did not respond within 90.0s A large function, or auto-analysis still running Wait for analysis to finish; raise the limit with --timeout
400 that names defer_loading or tool_reference, or Extra inputs are not permitted Claude Code sent tool-search fields with the request Set ENABLE_TOOL_SEARCH=false, or CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
404 Model "claude-..." is not available on abliterator A Claude Code model alias is not pinned Set all the model variables in Route 1

Large decompiler output is normal. Claude Code's transcript viewer warns when a tool result passes 10,000 tokens and saves results over 25,000 tokens to a file the model reads from; raise the limit with MAX_MCP_OUTPUT_TOKENS (MCP docs).

Frequently asked questions

What is Ghidra MCP?

Ghidra MCP is the name of several community projects that connect the Ghidra reverse-engineering suite to AI clients through the Model Context Protocol, so a model can decompile functions, read strings and imports, and rename symbols. The most used is LaurieWired's GhidraMCP, with about 12,100 GitHub stars (checked 2026-12-02).

Does Ghidra have built-in AI or an official MCP server?

No. The release notes for Ghidra 12.2, the current release, mention no MCP server or AI assistant. AI support comes from community extensions such as GhidraMCP, GhidrAssistMCP and ReVa, each used with an MCP client and a model you choose.

Which Ghidra MCP server should I use?

GhidraMCP 2.0 if you want a small set of 30 tools and can run Ghidra 12.1.4. On Ghidra 12.2, GhidrAssistMCP 3.1.0 and ReVa 7.3.2 ship builds for it, and bethington's ghidra-mcp 7.1.0 adds about 220 tools, debugger integration and a headless server.

Can Ghidra MCP use a model other than Claude?

Yes. The MCP server has no model of its own; the client supplies it. Claude Code and OpenCode both accept a custom endpoint, so either can drive GhidraMCP with kimi-k3.1-pro-abliterated or deepseek-v4.1-flash-abliterated on Abliterator.

Try it in your browser.

Ask it something your usual model refuses.

Start a chat

No sign-up to try. $10 free when you verify your email.