Skip to content
Back to search

ghidra-mcp-complete

MCP server giving AI assistants full access to Ghidra 12.2 (679 tools)

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 20 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/Alfa16bravo/ghidra-mcp-complete with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/Alfa16bravo/ghidra-mcp-complete'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/alfa16bravo--ghidra-mcp-complete/badge.svg)](/listings/alfa16bravo--ghidra-mcp-complete)

HTML

<a href="/listings/alfa16bravo--ghidra-mcp-complete"><img src="/api/listings/alfa16bravo--ghidra-mcp-complete/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Get the sources

Clone the repository **inside your Ghidra installation folder** (simplest: the scripts then find Ghidra on their own):

cd C:\path\to\ghidra_12.2_PUBLIC
git clone https://github.com/Alfa16bravo/ghidra-mcp-complete.git GhidraMCP

Anywhere else works too: set `GHIDRA_INSTALL_DIR` to your Ghidra folder (the one containing `ghidraRun.bat`), or pass `-GhidraDir` to the scripts.

2. Build and install the extension

Close Ghidra first (it locks the extension jar), then:

powershell -ExecutionPolicy Bypass -File GhidraMCP\build.ps1

This compiles the extension with `javac` (no Gradle needed), installs it into `<ghidra>\Ghidra\Extensions\GhidraMCP` and regenerates `bridge\tools.json`. Options: `-GhidraDir <path>`, `-Zip` (also create an installable `dist\ghidra_12.2_PUBLIC_<date>_GhidraMCP.zip`), `-NoInstall`.

**Alternative - release zip:** download the extension zip from the [Releases page](https://github.com/Alfa16bravo/ghidra-mcp-complete/releases), then in Ghidra use `File > Install Extensions > +`, pick the zip and restart Ghidra. You still need the repository (or at least the `bridge` folder and the `.bat` launchers) for the MCP client side.

3. Register the server in your MCP client

See [Connecting an MCP client](#connecting-an-mcp-client).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 277 lines
  1. # GhidraMCP
  2. A [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI assistants (Claude Code,
  3. Claude Desktop, and any other MCP client) full access to [Ghidra](https://github.com/NationalSecurityAgency/ghidra) **12.2**:
  4. **679 tools** covering the decompiler, listing, functions, symbols, data types, memory, scripting, p-code emulation,
  5. Version Tracking, Function ID, BSim, file systems and executable formats, the debugger and the Ghidra GUI itself.
  6. It runs **inside Ghidra** (a plugin of the CodeBrowser, so the assistant works on what you see and you watch its
  7. changes live) or **headless** (no GUI, started on demand by the assistant itself).
  8. > Every change made through the server is a normal Ghidra transaction: it can be undone with Ctrl+Z (or the `undo`
  9. > tool) and is saved only when you save the program.
  10. ## Contents
  11. - [What it can do](#what-it-can-do)
  12. - [How it works](#how-it-works)
  13. - [Requirements](#requirements)
  14. - [Installation](#installation)
  15. - [Starting Ghidra with the server](#starting-ghidra-with-the-server)
  16. - [Connecting an MCP client](#connecting-an-mcp-client)
  17. - [Using it](#using-it)
  18. - [Tools](#tools)
  19. - [Configuration](#configuration)
  20. - [Security](#security)
  21. - [Development](#development)
  22. - [Status and limitations](#status-and-limitations)
  23. - [License](#license)
  24. ## What it can do
  25. - **Read and understand code**: decompile (with C ↔ address mapping, AST tokens, alternate simplification styles),
  26. disassemble, p-code, control-flow graphs, call graphs, data-flow slices, call-site argument recovery, constant propagation.
  27. - **Annotate**: rename functions, variables, labels and namespaces; set prototypes and calling conventions; create and
  28. edit structs, unions, enums and typedefs (or parse C headers); comments, bookmarks, equates, colors - in bulk with `batch`.
  29. - **Run code without running the program**: stateful p-code emulation sessions - call a decryption or hashing routine
  30. with your own arguments (`emu_call`, even `main(argc, argv)`), breakpoints, hooks, snapshots, traces. Common libc and
  31. Win32 routines (stdio, memory, strings, anti-debug probes, ...) are emulated automatically.
  32. - **Triage malware and unknown binaries**: one-call triage report, capability detection by API usage, IOC extraction,
  33. anti-analysis and packer detection, crypto constants, stack strings, XOR brute force, API-hash resolution, YARA rule
  34. generation.
  35. - **Compare programs**: Version Tracking sessions and correlators, program diff and merge, function similarity, Function ID
  36. databases, BSim databases (local H2 files).
  37. - **Work with files**: probe and extract containers (zip, 7z, tar, ISO, ext4, firmware images, ...), import nested files,
  38. PE / ELF / Mach-O structure details, resources, certificates, patched-binary export.
  39. - **Import / export**: PDB and DWARF, symbol maps, IDA / x64dbg / radare2 scripts, SARIF, XML, C headers, Graphviz /
  40. GraphML / JSON graphs, Markdown reports.
  41. - **Drive Ghidra itself**: projects, version control, analyzers and options, scripts (run any Ghidra script, or arbitrary
  42. Java code with the full API through `run_script_inline`), the debugger (Trace RMI), and the GUI (navigation, selection,
  43. screenshots, any menu action, tables, options).
  44. ## How it works
  45. ```
  46. MCP client ──stdio──► bridge/ghidra_mcp_bridge.py ──HTTP 127.0.0.1:8765──► Ghidra
  47. (Claude Code, ...) (Python, no dependencies) ├─ GUI: GhidraMCPPlugin in the CodeBrowser
  48. └─ headless: ghidramcp.HeadlessMain
  49. ```
  50. - `src/ghidramcp/` - the Ghidra extension (Java): an HTTP server on 127.0.0.1 plus the tools, one `T_*.java` file per domain.
  51. - `bridge/ghidra_mcp_bridge.py` - the stdio MCP server the client launches. It finds running Ghidra instances
  52. (ports 8765-8774), can start a headless Ghidra by itself, and serves the tool list even when Ghidra is not running.
  53. - The extension also speaks MCP directly (Streamable HTTP) on `http://127.0.0.1:8765/mcp` for clients that support it.
  54. ## Requirements
  55. | | Version |
  56. |---|---|
  57. | Ghidra | **12.2** (PUBLIC release). Other versions are not supported: the extension is compiled against the exact Ghidra jars. |
  58. | JDK | 25 or newer (the one Ghidra 12.2 needs), with `javac` and `jar` - only to build. |
  59. | Python | 3.8 or newer for the bridge (standard library only). |
  60. | OS | Windows (the build and launch scripts are PowerShell / batch). |
  61. ## Installation
  62. ### 1. Get the sources
  63. Clone the repository **inside your Ghidra installation folder** (simplest: the scripts then find Ghidra on their own):
  64. ```bat
  65. cd C:\path\to\ghidra_12.2_PUBLIC
  66. git clone https://github.com/Alfa16bravo/ghidra-mcp-complete.git GhidraMCP
  67. ```
  68. Anywhere else works too: set `GHIDRA_INSTALL_DIR` to your Ghidra folder (the one containing `ghidraRun.bat`), or pass
  69. `-GhidraDir` to the scripts.
  70. ### 2. Build and install the extension
  71. Close Ghidra first (it locks the extension jar), then:
  72. ```powershell
  73. powershell -ExecutionPolicy Bypass -File GhidraMCP\build.ps1
  74. ```
  75. This compiles the extension with `javac` (no Gradle needed), installs it into `<ghidra>\Ghidra\Extensions\GhidraMCP`
  76. and regenerates `bridge\tools.json`. Options: `-GhidraDir <path>`, `-Zip` (also create an installable
  77. `dist\ghidra_12.2_PUBLIC_<date>_GhidraMCP.zip`), `-NoInstall`.
  78. **Alternative - release zip:** download the extension zip from the [Releases page](https://github.com/Alfa16bravo/ghidra-mcp-complete/releases), then in Ghidra use
  79. `File > Install Extensions > +`, pick the zip and restart Ghidra. You still need the repository (or at least the
  80. `bridge` folder and the `.bat` launchers) for the MCP client side.
  81. ### 3. Register the server in your MCP client
  82. See [Connecting an MCP client](#connecting-an-mcp-client).
  83. ## Starting Ghidra with the server
  84. ### GUI (recommended: the assistant works on what you see)
  85. Start Ghidra with **`GhidraMCP\ghidra-mcp-gui.bat`** instead of `ghidraRun.bat`. It starts the normal Ghidra and enables
  86. the plugin automatically in every CodeBrowser that opens. Open a program; the status bar shows
  87. `GhidraMCP server listening on 127.0.0.1:8765`.
  88. Manual alternative (once per tool): in the CodeBrowser, `File > Configure`, click `Configure` under *Miscellaneous*, tick
  89. **GhidraMCPPlugin**, then `File > Save Tool`. From then on `ghidraRun.bat` is enough.
  90. Several CodeBrowser windows each get their own port (8765, 8766, ...); the assistant picks one with `ghidra_instances` /
  91. `ghidra_connect`.
  92. ### Headless (no GUI)
  93. Nothing to do: when no Ghidra is running the assistant can call `ghidra_launch_headless` itself. Or start it by hand:
  94. ```bat
  95. GhidraMCP\ghidra-mcp-headless.bat --project-dir D:\re\projects --project-name work --import C:\samples\target.exe
  96. ```
  97. Options: `--project-dir` (default `%USERPROFILE%\ghidra_mcp_projects`), `--project-name` (default `mcp`, created if
  98. missing), `--port`, `--import FILE` (repeatable, imported and auto-analyzed), `--open /project/path` (repeatable).
  99. A project that is open in the Ghidra GUI is locked and cannot be opened headless at the same time.
  100. ## Connecting an MCP client
  101. The client launches the bridge with Python. Replace the path with yours.
  102. **Claude Code**
  103. ```bat
  104. claude mcp add --scope user ghidra -- python "C:\path\to\ghidra_12.2_PUBLIC\GhidraMCP\bridge\ghidra_mcp_bridge.py"
  105. ```
  106. **Claude Desktop** (`claude_desktop_config.json`) and most other clients (Cursor, VS Code, Windsurf, ...):
  107. ```json
  108. {
  109. "mcpServers": {
  110. "ghidra": {
  111. "command": "python",
  112. "args": ["C:\\path\\to\\ghidra_12.2_PUBLIC\\GhidraMCP\\bridge\\ghidra_mcp_bridge.py"]
  113. }
  114. }
  115. }
  116. ```
  117. **Direct HTTP** (clients that support Streamable HTTP, while Ghidra is running): `http://127.0.0.1:8765/mcp`.
  118. The bridge is still recommended: it handles discovery, several instances and headless start-up.
  119. With 679 tools, clients that support deferred / searchable tool loading (such as Claude Code) only load the schemas
  120. they need; inside the server, `search_tools`, `list_tool_groups` and `describe_tool` help find the right tool.
  121. ## Using it
  122. Just ask in natural language, for example:
  123. - *"What does the program open in Ghidra do? Give me a triage report and the most interesting functions."*
  124. - *"Decompile the function under my cursor, rename its variables and give it a proper prototype."*
  125. - *"Find the license check, explain the algorithm and emulate it to recover a valid key."*
  126. - *"List every call to CreateFileW with its decoded path argument."*
  127. - *"Create a struct from how param_1 is used in FUN_00401990 and apply it."*
  128. Conventions shared by the tools:
  129. - Addresses accept hex (`0x401000`, `401000h`), `space:offset`, or a symbol name.
  130. - Functions accept a name (`Class::method`) or any address inside the function.
  131. - Most tools take an optional `program` (name or project path) to target another open program.
  132. - List tools paginate with `offset` / `limit`; filters are case-insensitive substrings or regexes written `/like this/`.
  133. - `batch` runs many calls in one request; `run_script_inline` runs arbitrary Java (full Ghidra API) for anything else.
  134. - Changes are undoable (`undo` / `redo`); `save_program` persists them.
  135. ## Tools
  136. The full catalog with every tool, its description and parameters is in **[TOOLS.md](TOOLS.md)**.
  137. | Domain | Tools |
  138. |---|---:|
  139. | Bridge: instances, connection, headless start-up | 3 |
  140. | Program, project & analysis | 21 |
  141. | Project management, version control & multi-program operations | 45 |
  142. | Memory | 10 |
  143. | Advanced memory & search | 34 |
  144. | Listing & disassembly | 12 |
  145. | Functions | 14 |
  146. | Control flow, overrides, externals & analysis control | 54 |
  147. | Decompiler | 7 |
  148. | Advanced decompiler, data flow & C++ | 34 |
  149. | Symbols, references & strings | 18 |
  150. | Data types | 12 |
  151. | Data & type archives | 47 |
  152. | Comments, bookmarks, equates, registers & crypto constants | 13 |
  153. | P-code emulation (one-shot + sessions) | 26 |
  154. | Debugger (GUI only) | 40 |
  155. | Version Tracking, program diff & function comparison | 30 |
  156. | Function ID & BSim | 27 |
  157. | File systems & executable formats (PE / ELF / Mach-O) | 43 |
  158. | Import / export, PDB / DWARF, YARA & reports | 35 |
  159. | Malware & reverse-engineering triage | 24 |
  160. | Ghidra scripts | 3 |
  161. | GUI basics + GUI control (GUI only) | 45 |
  162. | Utilities, tool discovery & bulk operations | 49 |
  163. | Additional tools | 33 |
  164. | **Total** | **679** |
  165. ## Configuration
  166. | Variable / option | Where | Default | Meaning |
  167. |---|---|---|---|
  168. | `GHIDRA_INSTALL_DIR` | build script, launchers | parent folder of the repo | Ghidra installation folder |
  169. | `GHIDRA_MCP_PORT` | GUI plugin | `8765` | Preferred port (the next free one is used if busy). Also `Edit > Tool Options > GhidraMCP` |
  170. | `GHIDRA_MCP_AUTOENABLE` | `ghidra-mcp-gui.bat` | `1` | `0` starts Ghidra without enabling the plugin automatically |
  171. | `GHIDRA_MCP_MAXMEM` | `ghidra-mcp-headless.bat` | `4G` | Java heap of the headless server |
  172. | `GHIDRA_MCP_URL` | bridge | auto-discovery | Fixed server URL, e.g. `http://127.0.0.1:8766` |
  173. | `GHIDRA_MCP_TIMEOUT` | bridge | `3600` | Per-call timeout in seconds |
  174. | `JAVA_HOME` | build scripts | `PATH` | JDK used to build |
  175. ## Security
  176. - The server listens on **127.0.0.1 only** and rejects requests coming from web pages (foreign `Origin` / `Host` headers).
  177. - There is **no authentication**: any local process can call it, and `run_script_inline` / `run_script` execute arbitrary
  178. code inside Ghidra with your user rights. Do not run it on a shared machine you do not trust; disable the plugin when you
  179. do not need it.
  180. - Tools that write files (exports, extraction, archives) write where they are told to. Review what your assistant does,
  181. as with any tool that has file-system access.
  182. - Emulation never executes the analysed program natively; the debugger tools do run it (on purpose) - use a VM for malware.
  183. ## Development
  184. ```
  185. GhidraMCP/
  186. ├─ src/ghidramcp/ Java sources: Tools.java (registry + helpers), McpServer.java (HTTP / MCP), GhidraMCPPlugin.java,
  187. │ HeadlessMain.java, GuiMain.java and one T_<Domain>.java per tool domain
  188. ├─ bridge/ stdio MCP bridge + tools.json (generated catalog)
  189. ├─ build.ps1 build + install (+ -Zip); ghidra-env.ps1 locates Ghidra and the JDK
  190. └─ ghidra-mcp-gui.bat, ghidra-mcp-headless.bat launchers
  191. ```
  192. **Adding a tool** - in the relevant `T_*.java`:
  193. ```java
  194. T.add("my_tool", R, // N: no program, R: reads a program, W: modifies it (auto transaction)
  195. "What it does, when to use it, what it returns.",
  196. P("function!|s|Function name or address", "limit|i|Max results (default 50)"), // name!|type|description
  197. a -> {
  198. Function f = a.func("function"); // helpers: a.addr(), a.dtype(), a.range(), page(), matcher(), m()
  199. return m("name", f.getName(), "size", f.getBody().getNumAddresses());
  200. });
  201. ```
  202. Return maps / lists of plain values (never raw Ghidra objects), throw `McpError` for user-facing errors, and paginate
  203. long lists. Then rebuild (with Ghidra closed):
  204. ```powershell
  205. powershell -ExecutionPolicy Bypass -File build.ps1
  206. ```
  207. ## Status and limitations
  208. - Tested with Ghidra 12.2 PUBLIC and JDK 25 on Windows 11, headless and through the GUI plugin.
  209. - The **debugger** and **GUI-control** tools need the GUI and have had less real-world use than the rest. Feedback welcome.
  210. - Scripts and launchers are Windows-only for now (the Java extension and the bridge are portable).
  211. - `run_script_inline` with `language: python` requires Ghidra started through PyGhidra.
  212. ## License
  213. MIT - see [LICENSE](LICENSE). Ghidra is a software reverse engineering framework created by the NSA, distributed under the
  214. Apache License 2.0; this project is not affiliated with the NSA or the Ghidra project.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.