# Set up GhidraMCP with Claude Code

> Source: <https://reversedwithai.com/learn/set-up-ghidramcp-with-claude-code>
> Published: 2026-11-05 00:00:00+00:00

# Set up GhidraMCP with Claude Code

Install Ghidra and LaurieWired's GhidraMCP 2.0, connect it to Claude Code or Claude Desktop, and run a first session on a CrackMe or your own binary.

[GhidraMCP](https://github.com/LaurieWired/GhidraMCP) is a Ghidra plugin plus a small MCP server that lets an AI client such as Claude Code list functions, read decompiled code and rename things in the program you have open in Ghidra. This guide gets you from nothing to a working Claude Code session on a CrackMe or a binary you own. It is free apart from your Claude plan, and it suits anyone who has opened Ghidra before or is willing to learn the basics alongside the AI.

GhidraMCP changed a lot in version 2.0 (released 10 October 2026). Older tutorials, including some videos, use a separate Python bridge script and an older Ghidra version. The [2.0 release notes](https://github.com/LaurieWired/GhidraMCP/releases/tag/2.0) say that bridge is no longer needed. Follow the current README rather than an old video if they disagree.

## [Before you start](#before-you-start)

- **Ghidra 12.1.4.** The GhidraMCP README pins this exact version, and the extension zip is built for it. Ghidra is free from[ghidra-sre.org](https://ghidra-sre.org) or the[NSA GitHub releases](https://github.com/NationalSecurityAgency/ghidra/releases) .
- **A 64-bit JDK 21.** Ghidra 12.1.4's[Getting Started guide](https://github.com/NationalSecurityAgency/ghidra/blob/Ghidra_12.1.4_build/GhidraDocs/GettingStarted.md) lists the Java 21 JDK as a minimum requirement.
- **[uv](https://docs.astral.sh/uv/)** , which runs the MCP server for you. If you would rather use plain Python, the README says Python 3.10+ with`pip install git+https://github.com/LaurieWired/GhidraMCP` works, and you then call`ghidra-mcp` directly in the commands below.
- **Claude Code** (or Claude Desktop) and a Claude plan or API key.
- **A target you are allowed to analyse** : a CrackMe from a CTF or training site, or a program you wrote yourself. Compile a tiny C program with a password check if you have nothing else.

## [1. Install Ghidra](#1-install-ghidra)

Download `ghidra_12.1.4_PUBLIC_20260921.zip`, extract it, and start it with `ghidraRun` (Linux and macOS) or `ghidraRun.bat` (Windows). If Ghidra cannot find Java, follow the JDK steps in its Getting Started guide and add the JDK's `bin` directory to your `PATH`.

Create a project (`File` > `New Project`), import your target (` File` > `Import File`), open it in the CodeBrowser and let auto-analysis finish. GhidraMCP answers questions about the program open in this window, so the AI sees nothing until this step is done.

## [2. Install the GhidraMCP extension](#2-install-the-ghidramcp-extension)

Download the latest release from the [releases page](https://github.com/LaurieWired/GhidraMCP/releases). For 2.0 the download is `GhidraMCP-release-2-0.zip`; inside it is the Ghidra extension zip. The README's steps are:

1. Run Ghidra.
2. Select `File` >`Install Extensions` .
3. Click the `+` button.
4. Select the `ghidra_12.1.4_PUBLIC_<date>_GhidraMCP.zip` from the downloaded release.
5. Restart Ghidra.
6. Make sure `GhidraMCPPlugin` is enabled in`File` >`Configure` >`Developer` .
7. Optional: change the port under `Edit` >`Tool Options` >`GhidraMCP HTTP Server` .

The plugin runs a small HTTP server inside Ghidra. By default the MCP server expects it at `http://127.0.0.1:8080/`.

## [3. Connect Claude Code](#3-connect-claude-code)

The README gives this command:

```
claude mcp add ghidra -- uvx --from git+https://github.com/LaurieWired/GhidraMCP ghidra-mcp --ghidra-server http://127.0.0.1:8080/
```

Per the [Claude Code MCP docs](https://code.claude.com/docs/en/mcp), everything after `--` is the command that starts the server, and the server is added at local scope by default: it only loads in the folder where you ran the command. Run it from the folder you will work in, or add `--scope user` before the name to make it available everywhere:

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

If you changed the port in Ghidra, change `--ghidra-server` to match.

### Claude Desktop instead

Claude Desktop reads the same JSON shape the README shows for generic clients. Open `Settings` > `Developer` > `Edit Config` (the file is `claude_desktop_config.json`, per the [MCP docs](https://modelcontextprotocol.io/docs/develop/connect-local-servers)) and add:

```
{
  "mcpServers": {
    "ghidra": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/LaurieWired/GhidraMCP",
        "ghidra-mcp",
        "--ghidra-server",
        "http://127.0.0.1:8080/"
      ]
    }
  }
}
```

Quit Claude Desktop fully and reopen it.

### Headless option

GhidraMCP 2.0 can also import and analyse a binary itself through PyGhidra, with no Ghidra window. The README says this needs Python 3.10 to 3.13, the extension installed, and `GHIDRA_INSTALL_DIR` pointing at your Ghidra 12.1.4 folder:

```
uvx --python 3.13 --from "ghidra-mcp[headless] @ git+https://github.com/LaurieWired/GhidraMCP" ghidra-mcp --headless --binary /path/to/target
```

Add `--project DIR` to keep the Ghidra project and your renames between runs. Use the GUI first; headless is easier once you know what a good session looks like.

## [Check it works](#check-it-works)

1. Make sure Ghidra is running with your target open in the CodeBrowser.
2. In a terminal, run `claude mcp list` . The`ghidra` entry should show`✔ Connected` . If it says`✘ Failed to connect` , run`claude mcp get ghidra` to see the error.
3. Start `claude` and type`/mcp` to see the server and its tool count.
4. Ask something small and checkable:

```
Using the ghidra tools, list the functions in the open program and decompile the entry point.
Do not guess: only report what the tools return.
```

Compare the answer with what you see in Ghidra. If the function names and addresses match, the connection works.

## [Troubleshoot the connection in layers](#troubleshoot-the-connection-in-layers)

This is a documentation-based checklist, not a tested compatibility matrix. Check the [current GhidraMCP installation instructions](https://github.com/LaurieWired/GhidraMCP) before changing versions.

| Symptom | Check first | Next decision | 
|---|---|---|
| Extension missing | Match the extension release to Ghidra, restart, and enable the plugin in the CodeBrowser tool configuration. | An absent extension is a Ghidra setup problem; changing the model will not install it. | 
| Connection refused | Compare the plugin's HTTP port with `--ghidra-server` . | The MCP bridge and the Ghidra HTTP server are separate processes. | 
| URL-based client cannot connect | The documented example uses port 8081 and `/mcp` for the MCP endpoint; port 8080 serves Ghidra. | Do not give the client the Ghidra server URL as its MCP endpoint. | 
| Tools connect but no useful program appears | Open and analyse the intended program in CodeBrowser. | Inspect the tool result before asking the model to explain functions. | 

For Claude Code, inspect `claude mcp list`, `claude mcp get ghidra`, and `/mcp`. Check configuration scope if the server appears in one folder but not another. Project configuration can also require approval. See [Claude Code's server management and troubleshooting documentation](https://code.claude.com/docs/en/mcp).

Before filing an issue, record the OS, Ghidra version, extension release, MCP command, client version, transport and exact error. Redact credentials and private binary contents. Change one layer at a time and note the result; a useful report explains both what failed and what still connects.

## [Your first session on a CrackMe](#your-first-session-on-a-crackme)

Give Claude a narrow goal and a way to check its answer. A prompt along these lines works well:

```
This is a CrackMe I downloaded for practice. Find the function that checks the input,
explain the check in plain English, and rename the functions and variables you
understand. Show me the decompiled code you based each conclusion on.
Derive the answer from the code; do not brute force it.
```

Then run the CrackMe with the answer Claude gives you. A correct password or key is the test that matters; a confident explanation is not. Look at Ghidra while Claude works: renamed functions appear in the CodeBrowser, so you can follow its reasoning and undo bad names.

Jackson Mittag's [Claude and Ghidra MCP CrackMe tutorial](https://reversedwithai.com/p/claude-ghidra-crackme-tutorial) walks through this same kind of session on video. Check which GhidraMCP version it uses before copying its install steps.

## [Where AI goes wrong](#where-ai-goes-wrong)

- **Wrong load address or loader.** In the[River Raid project](https://reversedwithai.com/p/river-raid-unlimited-lives) , Claude noticed the 8 kB Atari ROM was loaded at the wrong address but could not rebase it through the MCP tools, so the author did that by hand. GhidraMCP exposes analysis, not every Ghidra setting. Get the import right yourself: processor, base address and loader.
- **Confident misidentification.** The same project notes that Claude guessed the game was Centipede. Treat the model's claims about what a binary is as guesses until the code confirms them.
- **Patching is still on you.** In River Raid the author applied the final byte patch by hand. Verify patches in an emulator or a test run, not in the chat.
- **Uneven results between models.**[CrackMeBench](https://reversedwithai.com/p/crackmebench) found large differences between models on the same stripped CrackMes, so one failed session does not mean the setup is broken. Try a narrower prompt or another model before rebuilding your install.

## [Projects that use this](#projects-that-use-this)

- [Claude and Ghidra MCP work through a CrackMe](https://reversedwithai.com/p/claude-ghidra-crackme-tutorial) : a step-by-step video of the setup and a full CrackMe session.
- [River Raid unlimited lives](https://reversedwithai.com/p/river-raid-unlimited-lives) : Claude found the lives-decrement code in a 6502 ROM through GhidraMCP; the author rebased and patched by hand.
- [OALabs live VIBE RE](https://reversedwithai.com/p/oalabs-live-vibe-re) : a live stream comparing MCP plugins for IDA and Ghidra on real samples.
- [CrackMeBench](https://reversedwithai.com/p/crackmebench) : a benchmark of agents recovering validation logic from stripped CrackMes.

## [Further reading](#further-reading)

- [GhidraMCP README](https://github.com/LaurieWired/GhidraMCP) and[releases](https://github.com/LaurieWired/GhidraMCP/releases)
- [Ghidra Getting Started guide](https://github.com/NationalSecurityAgency/ghidra/blob/Ghidra_12.1.4_build/GhidraDocs/GettingStarted.md)
- [Claude Code: connect to tools via MCP](https://code.claude.com/docs/en/mcp)
- [Connect local MCP servers to Claude Desktop](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
- Tool pages: [GhidraMCP](https://reversedwithai.com/tools/ghidra-mcp) ,[Ghidra](https://reversedwithai.com/tools/ghidra) ,[Claude Code](https://reversedwithai.com/tools/claude-code)
