Логотип Ghidra MCP Server

Ghidra MCP Server

СпільнотаПопулярне
bethington

Ghidra MCP Server — 200+ MCP tools for AI-powered reverse engineering. GUI plugin + headless server, lazy tool loading, convention enforcement, batch operations, Ghidra Server integration, and Docker deployment.

Видавецьbethington
Репозиторійghidra-mcp
МоваJava
Форки
151
Зірки
3.9K
Доступні інструменти
0
Тип транспортуstdio
Категорії
ЛіцензіяApache-2.0
Посилання
  • Підключайте інструменти до робочих процесів із ШІ

    Ghidra MCP Server надає можливості MCP, які можуть використовувати сумісні клієнтські ШІ-застосунки та агенти.

  • Доступні інструменти: 0

    Перегляньте нижче дії, які можна викликати, з назвами й описами, якщо сервер їх надає.

  • Готова конфігурація для копіювання

    Скористайтеся прикладами конфігурації, щоб налаштувати цей сервер у вибраному клієнті MCP.

  • Показники інтересу до відкритого коду

    Зірки: 3.9K, форки: 151 — у пов’язаному репозиторії.

Ghidra MCP Server

MCP Toplist

Tests Release License GitHub Sponsors

Python Java Ghidra MCP

Stars Last commit Discussions Issues OpenSSF Scorecard

If you find this useful, please ⭐ star the repo — it helps others discover it!

If Ghidra MCP saves you time, consider sponsoring the project. One-time and recurring support both help fund compatibility updates, production hardening, docs, and new tooling.

A production-ready Model Context Protocol (MCP) server that bridges Ghidra's powerful reverse engineering capabilities with modern AI tools and automation frameworks. 253 MCP tools, battle-tested AI workflows, and the most comprehensive Ghidra-MCP integration available — now including P-code emulation, live debugger integration, and PCode-graph data flow analysis.

Why Ghidra MCP?

Most Ghidra MCP implementations give you a handful of read-only tools and call it a day. This project is different — it was built by a reverse engineer who uses it daily on real binaries, not as a demo.

  • 253 MCP tools — 3x more than any competing implementation. Not just read operations — full write access for renaming, typing, commenting, structure creation, script execution, P-code emulation, and live debugging.
  • Battle-tested AI workflows — Proven documentation workflows (V5) refined across hundreds of functions. Includes step-by-step prompts, Hungarian notation reference, batch processing guides, and orphaned code discovery.
  • Production-grade reliability — Atomic transactions, batch operations (93% API call reduction), configurable timeouts, and graceful error handling. No silent failures.
  • Cross-binary documentation transfer — SHA-256 function hash matching propagates documentation across binary versions automatically. Document once, apply everywhere.
  • Full Ghidra Server integration — Connect to shared Ghidra servers, manage repositories, version control, checkout/checkin workflows, and multi-user collaboration.
  • Headless and GUI modes — Run with or without the Ghidra GUI. Docker-ready for CI/CD pipelines and automated analysis at scale.
  • Opinionated by design — v5.0 moves naming conventions, type safety, and documentation standards into the tool layer. AI agents and human engineers produce consistent output without style guides in every prompt.

Convention Enforcement

You've been there: six months into a project you find ProcessItem, process_items, handleItem, and ItemProc in the same codebase — four functions doing the same thing, named by four different sessions or engineers with no shared contract. Fixing it takes longer than it should, and the problem will happen again.

v5.0 moves conventions from "things to remember" into the tool layer, where they can actually be enforced.

TierBehaviorExample
Auto-fixApplied silentlycount field on a uint32 → auto-prefixed dwCount on save
WarnChange goes through, warning returnedprocessData → "name should be PascalCase with a verb: ProcessData"
RejectChange blocked with explanationundefined → undefined type change → "no-op rejected, type unchanged"

For AI agents, this means consistent output across every session, every model, every run — without pasting a style guide into every prompt. The tool knows the rules; the model just needs to make the call.

For teams, it eliminates the entire class of review comment that says "that's not our naming convention." Convention arbitration stays in the tool, not in code review.

For solo work at scale, analyze_function_completeness gives you a 0–100% score that measures honestly: structural deductions (unfixable compiler artifacts) are forgiven in your effective score, log-scaling prevents one bad category from burying everything else, and tiered plate comment quality means you know exactly what's missing and why.

🌟 Features

Core MCP Integration

  • Full MCP Compatibility — Complete implementation of Model Context Protocol
  • 253 MCP tools — Comprehensive API surface covering every aspect of binary analysis
  • Production-Ready Reliability — Atomic transactions, batch operations, configurable timeouts
  • Real-time Analysis — Live integration with Ghidra's analysis engine

Compatibility note: MCP tool names are normalized for GitHub Copilot CLI and CAPI validation. Exposed tool names use lowercase letters, digits, underscores, and hyphens only; nested HTTP paths such as /debugger/status are advertised as names like debugger_status_2 when needed to avoid collisions with static bridge tools.

Binary Analysis Capabilities

  • Function Analysis — Decompilation, call graphs, cross-references, completeness scoring
  • Data Flow Analysis — PCode-graph value propagation (forward / backward) from any variable or register
  • Data Structure Discovery — Struct/union/enum creation with field analysis and naming suggestions
  • String Extraction — Regex search, quality filtering, and string-anchored function discovery
  • Import/Export Analysis — Symbol tables, external locations, ordinal import resolution
  • Memory & Data Inspection — Raw memory reads, byte pattern search, array boundary detection
  • Cross-Binary Documentation — Function hash matching and documentation propagation across versions

Dynamic Analysis (v5.4.0)

  • P-code Emulation — Run any function in isolation via Ghidra's EmulatorHelper; brute-force API hash resolution in milliseconds
  • Live Debugger Integration — 17 Java endpoints + 22 Python bridge tools over Ghidra's TraceRmi framework (dbgeng on Windows PE, gdb/lldb otherwise): attach, step, breakpoints, registers, memory reads, non-breaking function tracing, ASLR-aware static↔dynamic address translation

AI-Powered Reverse Engineering Workflows

  • Function Documentation Workflow V5 — 7-step process for complete function documentation with Hungarian notation, type auditing, and automated verification scoring
  • Batch Documentation — Parallel subagent dispatch for documenting multiple functions simultaneously
  • Orphaned Code Discovery — Automated scanner finds undiscovered functions in gaps between known code
  • Data Type Investigation — Systematic workflows for structure discovery and field analysis
  • Cross-Version Matching — Hash-based function matching across different binary versions

Development & Automation

  • Ghidra Script Management — Create, run, update, and delete Ghidra scripts entirely via MCP
  • Multi-Program Support — Switch between and compare multiple open programs
  • Batch Operations — Bulk renaming, commenting, typing, and label management (93% fewer API calls)
  • Headless Server — Full analysis without Ghidra GUI — Docker and CI/CD ready
  • Project & Version Control — Create projects, manage files, Ghidra Server integration
  • Analysis Control — List, configure, and trigger Ghidra analyzers programmatically

🚀 Quick Start

Prerequisites

  • Java 21 LTS (OpenJDK recommended)
  • Apache Maven 3.9+
  • Ghidra 12.1.2 (or compatible version)
  • Python 3.10+ with uv (recommended) or pip + venv

Shared Ghidra Server users: Ghidra 12.1.2 clients require a Ghidra Server at 12.1, 12.0.5, or a newer compatible version. Upgrade the server before using this plugin from a 12.1 client.

Ghidra 12.1.2 ships Jython as an optional extension. Java scripts work by default, but .py scripts in ghidra_scripts/ require installing the Jython extension from File > Install Extensions and restarting Ghidra.

Installation

Recommended for all platforms: use python -m tools.setup directly.

ensure-prereqs installs runtime Python requirements plus the Ghidra JARs needed in the local Maven repository. deploy copies the build output, installs the user-profile extension, and patches Ghidra user config.

  1. Clone the repository:

    bash
    git clone https://github.com/bethington/ghidra-mcp.git
    cd ghidra-mcp
  2. Recommended: run environment preflight first:

    text
    python -m tools.setup preflight --ghidra-path "F:\ghidra_12.1.2_PUBLIC"
  3. Build and deploy to Ghidra:

    text
    python -m tools.setup ensure-prereqs --ghidra-path "F:\ghidra_12.1.2_PUBLIC"
    python -m tools.setup build
    python -m tools.setup deploy --ghidra-path "F:\ghidra_12.1.2_PUBLIC"

    deploy saves/closes an already-running matching Ghidra instance when needed, installs the extension, starts Ghidra, waits for MCP health, and runs schema smoke checks.

  4. Optional strict/manual mode (advanced):

    text
    # Skip automatic prerequisite setup
    python -m tools.setup build
    python -m tools.setup deploy --ghidra-path "F:\ghidra_12.1.2_PUBLIC"
  5. Show command help:

    text
    python -m tools.setup --help
  6. Optional build-only mode (advanced/troubleshooting):

    text
    python -m tools.setup build

    Two Java backends are supported. Gradle is the default for local work — it reads Ghidra's jars straight out of the installation, so there is no install-file step and nothing to install beyond a JDK. CI builds and gates with Maven, so Maven is a maintained peer rather than a fallback.

    bash
    # Gradle (default) -- the wrapper is committed, so no Gradle install is needed.
    # -PGHIDRA_INSTALL_DIR or the GHIDRA_INSTALL_DIR env var both work.
    # In Git Bash use forward slashes; a backslash path is mangled before Gradle sees it.
    ./gradlew buildExtension -PGHIDRA_INSTALL_DIR=/path/to/ghidra
    bash
    # Maven (peer backend; what CI uses). Needs Ghidra's jars in the local .m2 first:
    #   python -m tools.setup ensure-prereqs --ghidra-path /path/to/ghidra
    mvn clean package assembly:single -DskipTests

    python -m tools.setup build routes to Maven by default; set TOOLS_SETUP_BACKEND=gradle to route it to Gradle instead.

Installation (Linux — Ubuntu/Debian)

  1. Clone the repository:

    bash
    git clone https://github.com/bethington/ghidra-mcp.git
    cd ghidra-mcp
  2. Install system prerequisites (if not already installed):

    bash
    sudo apt update && sudo apt install -y openjdk-21-jdk maven python3 python3-pip python3-venv curl jq unzip

    Debian/Kali/Ubuntu 23.04+ note (PEP 668): these distros mark the system Python as externally managed, so a bare pip install fails with error: externally-managed-environment. Don't work around it with --break-system-packages — it can corrupt apt-managed tooling. Instead use uv (recommended — it creates and manages a project-local .venv automatically, and is what this repo's commands use):

    bash
    curl -LsSf https://astral.sh/uv/install.sh | sh
    uv run bridge-mcp-ghidra    # resolves deps into .venv and starts the bridge

    or a classic virtual environment:

    bash
    python3 -m venv .venv && source .venv/bin/activate
    pip install -e .
    bridge-mcp-ghidra
  3. Run environment preflight:

    bash
    python -m tools.setup preflight --ghidra-path ~/ghidra_12.1.2_PUBLIC
  4. Build and deploy to Ghidra (single command):

    bash
    python -m tools.setup ensure-prereqs --ghidra-path ~/ghidra_12.1.2_PUBLIC
    python -m tools.setup build
    python -m tools.setup deploy --ghidra-path ~/ghidra_12.1.2_PUBLIC

    This will:

    • Install Ghidra JAR dependencies into your local ~/.m2/repository
    • Build GhidraMCP-<version>.zip with Maven
    • Extract the extension to ~/.config/ghidra/ghidra_<version>_PUBLIC/Extensions/
    • Update preferences with LastExtensionImportDirectory
    • Install Python requirements
  5. Optional: setup only Maven dependencies:

    bash
    python -m tools.setup install-ghidra-deps --ghidra-path ~/ghidra_12.1.2_PUBLIC
  6. Show command help:

    bash
    python -m tools.setup --help

Linux paths: The extension is installed to $HOME/.config/ghidra/ghidra_<version>_PUBLIC/Extensions/GhidraMCP/. Ghidra config files are in $HOME/.config/ghidra/ghidra_<version>_PUBLIC/.

Installation (macOS — Homebrew)

  1. Install prerequisites:

    bash
    brew install openjdk@21 maven python ghidra
  2. Clone the repository:

    bash
    git clone https://github.com/bethington/ghidra-mcp.git
    cd ghidra-mcp
  3. Install Ghidra JARs into local Maven:

    bash
     python -m tools.setup install-ghidra-deps \
        --ghidra-path /opt/homebrew/opt/ghidra/libexec
  4. Build and deploy:

    bash
     python -m tools.setup ensure-prereqs \
        --ghidra-path /opt/homebrew/opt/ghidra/libexec
     python -m tools.setup build
     python -m tools.setup deploy \
        --ghidra-path /opt/homebrew/opt/ghidra/libexec

    The extension is installed to ~/Library/ghidra/ghidra_12.1.2_PUBLIC/Extensions/GhidraMCP/.

    Note: --ghidra-version is required when using the Homebrew path because the path contains no version string.

  5. Start Ghidra and enable the plugin:

    bash
    /opt/homebrew/opt/ghidra/libexec/ghidraRun

    In the main project window: Tools > GhidraMCP > Start MCP Server

  6. Configure Cursor/Claude MCP (~/.cursor/mcp.json) — use the absolute path to uv (which uv), not the bare name; GUI-launched clients do not inherit your shell's PATH (#441):

    json
    {
      "mcpServers": {
        "ghidra": {
          "command": "/opt/homebrew/bin/uv",
          "args": ["run", "--directory", "/path/to/ghidra-mcp", "bridge-mcp-ghidra"]
        }
      }
    }

    macOS is the sharpest case: apps launched from Finder/Dock get launchd's PATH, which never contains ~/.local/bin or /opt/homebrew/bin.

Installation (Arch Linux — AUR)

@Pandoriaantje maintains community AUR packages:

Install with your AUR helper of choice, e.g.:

bash
yay -S ghidra-mcp        # or ghidra-mcp-git

Basic Usage

Option 1: Stdio Transport (Recommended for AI tools)

bash
uv run bridge-mcp-ghidra          # or: python -m bridge_mcp_ghidra

MCP client config (.mcp.json, ~/.cursor/mcp.json, Claude Desktop config, …). Use the absolute path to uv — see the note below for why:

json
{
  "mcpServers": {
    "ghidra-mcp": {
      "command": "/home/<you>/.local/bin/uv",
      "args": ["run", "--directory", "/path/to/ghidra-mcp", "bridge-mcp-ghidra", "--transport", "stdio"],
      "env": { "GHIDRA_MCP_URL": "http://127.0.0.1:8089" }
    }
  }
}

On Windows the same config points at uv.exe, e.g. "command": "C:\\Users\\<you>\\.local\\bin\\uv.exe". Find your own path with which uv (POSIX) or where.exe uv (Windows), or just run python -m tools.setup preflight, which prints the resolved absolute path and a ready-to-paste snippet.

Why absolute? "command": "uv" fails under service and GUI launchers. The MCP client resolves command with its own PATH, not your shell's. A client started from a systemd user service, a .desktop entry, or any other GUI session inherits that launcher's environment, which routinely lacks ~/.local/bin and ~/.cargo/bin — the very directories uv installs into. The failure lands at process-spawn time as spawn uv ENOENT, before any bridge code runs, so there is nothing in any log to read. An absolute path makes the client's PATH irrelevant and works on the first try. The same applies to python, python3, and the bridge-mcp-ghidra console script. (#441)

To add the bridge to Autohand Code from a cloned checkout:

bash
autohand mcp add ghidra /home/<you>/.local/bin/uv run --directory /path/to/ghidra-mcp bridge-mcp-ghidra

Add --scope project before ghidra to save the server in the current project's .autohand configuration instead of your user configuration.

Option 2: Streamable HTTP Transport (Recommended for web/HTTP clients)

bash
uv run bridge-mcp-ghidra --transport streamable-http --mcp-host 127.0.0.1 --mcp-port 8081

MCP client config for the HTTP transport (add to your client's MCP config file):

json
{
  "mcpServers": {
    "ghidra-mcp-http": {
      "url": "http://127.0.0.1:8081/mcp"
    }
  }
}

Browser-based clients (e.g. MCP Inspector) work out of the box: the HTTP transports answer CORS preflight (OPTIONS) requests and expose the mcp-session-id / mcp-protocol-version headers to scripts. Allowed origins mirror the Host-header policy — loopback on any port is always permitted, plus the bind host and any hosts listed in GHIDRA_MCP_ALLOWED_HOSTS.

Option 3: SSE Transport (Deprecated — use streamable-http instead)

bash
uv run bridge-mcp-ghidra --transport sse --mcp-host 127.0.0.1 --mcp-port 8081

Bridge advanced flags

FlagDefaultDescription
--transportstdiostdio (AI tools), streamable-http (web clients), sse (deprecated)
--mcp-host127.0.0.1Bind host for HTTP transports
--mcp-port—Port for HTTP transports
--lazy(default)Load only the default tool groups on connect, and let the model pull in the rest with search_tools/load_tool_group.
--no-lazyoffLoad all tool groups immediately on connect. Needed only by MCP clients that ignore tools/list_changed; rejected outright by the Gemini API (see below).
--default-groupslisting,function,programComma-separated groups loaded on connect under --lazy.

Lazy tool loading is the default (issue #440)

Advertising all 253 endpoints in a single tools/list is over a hard limit for at least one major provider. Gemini compiles function declarations into a constrained-decoding state machine and rejects the whole request before any tool is ever called:

text
400 INVALID_ARGUMENT
The specified schema produces a constraint that has too many states for serving

That is not a degradation, it is an outright break, and no client-side setting could work around a server that only ever offered the full set. So the bridge now loads listing,function,program (84 endpoints plus the 8 static tools) on connect and registers the rest on demand.

If your client ignores tools/list_changed it will not notice tools that are registered later, and should turn lazy loading off:

bash
uv run bridge-mcp-ghidra --no-lazy          # when you control the command line
export GHIDRA_MCP_LAZY=0                    # when you don't (Docker, uvx, some client configs)

GHIDRA_MCP_LAZY accepts 0/false/no/off and 1/true/yes/on; an explicit --lazy/--no-lazy on the command line wins over it. Startup logs which mode is in effect.

Strict program routing (multi-program safety)

Set GHIDRA_MCP_REQUIRE_PROGRAM_SELECTORS=1 to make the bridge refuse any program-scoped call that omits a program selector, returning a clear error instead of letting the call ride the server's shared "current program" (the one switch_program and the active GUI tab move).

bash
export GHIDRA_MCP_REQUIRE_PROGRAM_SELECTORS=1
uv run bridge-mcp-ghidra

Without this, a call that leaves program= out runs against whichever program is current, which is fine for a single-program workflow but a hazard once several programs are open: the call can read or edit the wrong binary with no error. The hazard is worse when more than one client shares a server, since each one moves that current-program global out from under the others.

With strict mode on, every program-scoped call must name its target. This covers every selector that picks an open program: plain program= and the cross-program tools' source_program/target_program or program_a/program_b (declared required, but the server still falls back to the current program when one arrives empty). A forgotten selector surfaces as a loud error on the first bad call instead of a silent write to the wrong binary. Tools with no program selector (open_program and close_program take path/name) are unaffected. Off by default: with the variable unset the bridge sends calls unchanged.

Reducing tool-context overhead

The bridge exposes a large catalog, so it loads only listing,function,program on connect (see above) and lets the model discover the rest on demand instead of registering everything:

  • search_tools("rename function") — keyword-search the entire catalog, including tools whose group isn't loaded. Each result says whether it's callable now and, if not, the exact load_tool_group(...) call to enable it.
  • list_tool_groups() — list all categories and their load state.
  • load_tool_group("datatype") / unload_tool_group("datatype") — load or drop a category at runtime.
  • check_tools("rename_symbol,batch_set_comments") — confirm specific tools are callable right now.

search_tools works in both lazy and --no-lazy modes, so agents that honor tools/list_changed get full discovery without the upfront context cost.

Minimal read-only allowlist

Some MCP clients gate tools through an explicit allowlist. Cut it too far and the agent loses discovery — it cannot find entry points or enumerate functions through MCP, so it works around the allowlist by curl-ing the HTTP API on 127.0.0.1:8089 directly, which defeats the point of having one. The allowlist has to be small and self-sufficient.

Minimum viable read-only set (4 tools):

ToolGroupWhat it buys you
get_metadataprogramWhich binary is loaded — name, architecture, image base, function count. Orientation, and it confirms the bridge reached Ghidra at all.
list_methodslistingPaginated function-name enumeration (offset, limit). This is the discovery tool — without it the agent cannot answer "what is in this binary".
get_entry_pointslistingWhere execution starts, so analysis has a root to work down from.
decompile_functionfunctionThe payload. Takes address or functions= (comma-separated names or addresses), so one call can pull several bodies.

That set is genuinely closed: get_entry_points and list_methods supply the addresses and names that decompile_function consumes, and a decompiled body names its callees, which feed straight back into decompile_function.

The three tools suggested in #441 — get_metadata, get_entry_points, decompile_function — all exist under exactly those names and are a workable floor. list_methods is the one addition worth making: without it the agent can only reach code that is reachable by name from something it already decompiled, so anything not referenced from an entry point is invisible.

Useful next additions, in order:

ToolGroupWhy
get_function_callers / get_function_calleesxrefWalk the call graph without decompiling every body to find edges.
get_xrefs_toxrefWho touches this address — the standard question about a global.
list_stringslistingStrings are the cheapest orientation signal in an unknown binary.
search_functionslistingName search, once the agent knows what it is hunting for.
list_imports / list_exportslistingThe binary's external surface.

Every tool above is a GET; none of them writes to the Ghidra database.

Two things to check when your allowlist is narrow:

  • Groups, not just names. The bridge registers tools by group, and the group is the category on the Java @McpTool annotation (which the running server publishes at /mcp/schema) — not the category field in tests/endpoints.json, which is a separate hand-maintained column and does not always agree. All four tools in the minimum set fall inside the default listing,function,program groups, so they are registered even under --lazy. Of the additions above, only the xref ones fall outside: under --lazy you must either allow load_tool_group as well, or start the bridge with --default-groups listing,function,program,xref.
  • A narrow allowlist plus --lazy needs the group tools. If you allowlist only leaf tools and run lazily, the agent has no way to load anything else. Either run eagerly (--no-lazy, the default) or add search_tools, list_tool_groups, load_tool_group, and check_tools to the allowlist.

Verify any allowlist against the running server rather than against this table: curl http://127.0.0.1:8089/mcp/schema lists every tool with the category the bridge groups it by.

Optional: Connect a standalone debugger server

The debugger server itself moved to the d2-game-exe repository on 2026-08-11 (its D2 calling-convention layer made it game-specific). Start it there, then point this bridge at it:

bash
export GHIDRA_DEBUGGER_URL=http://127.0.0.1:8099

The bridge's 22 debugger_* proxy tools register only when that variable is set, so leaving it unset costs nothing — the tools simply do not appear rather than appearing and failing.

Debugger server flags:

FlagDefaultDescription
--port8099HTTP server port
--host127.0.0.1Bind address (0.0.0.0 to expose on LAN)
--exports-dir—Path to a dll_exports/ directory for ordinal-to-name resolution
--log-levelINFODEBUG, INFO, WARNING, or ERROR

Set GHIDRA_DEBUGGER_URL in .env if you change the default port or host so the bridge can find it.

In Ghidra

  1. Start Ghidra and open a CodeBrowser window
  2. In CodeBrowser, enable the plugin via File > Configure > Configure All Plugins > GhidraMCP
  3. Optional: configure custom port via CodeBrowser > Edit > Tool Options > GhidraMCP HTTP Server
  4. Start the server via Tools > GhidraMCP > Start MCP Server
  5. The server runs on http://127.0.0.1:8089/ by default

Verify It's Working

bash
# Quick health check
curl http://127.0.0.1:8089/check_connection
# Expected: "Connected: GhidraMCP plugin running with program '<name>'"

# Get version info
curl http://127.0.0.1:8089/get_version

Support This Project

If Ghidra MCP saves you engineering or reverse-engineering time, consider sponsoring the project.

  • One-time sponsorship helps fund fixes, compatibility updates, and release work.
  • Recurring sponsorship helps keep maintenance, docs, and production hardening moving.
  • Company support helps prioritize long-term reliability for the bridge, headless server, debugger integration, and workflow tooling.

🔒 Security

GhidraMCP is designed for localhost-only development. The default configuration — HTTP server bound to 127.0.0.1, no authentication — is safe on a trusted single-user workstation and matches pre-v5.4.1 behavior.

If you expose the server beyond loopback, configure these three environment variables first. The server refuses to start on a non-loopback bind without a token.

Env varEffect
GHIDRA_MCP_AUTH_TOKENWhen set, every HTTP request must carry Authorization: Bearer <token>. Timing-safe comparison. /mcp/health, /health, /check_connection are exempt.
GHIDRA_MCP_ALLOW_SCRIPTSSet to 1, true, or yes to enable /run_script_inline and /run_ghidra_script. Off by default as of v5.4.1 — these endpoints execute arbitrary Java against the Ghidra process. In headless mode this also triggers OSGi BundleHost initialization at server startup (Felix framework, ~hundreds of ms); leave it off if you don't need script execution.
GHIDRA_MCP_FILE_ROOTWhen set to a directory path, filesystem-path endpoints (/load_program, /import_file, /open_project, /delete_file, etc.) canonicalize the input and require it to fall under this root. Prevents path-traversal.

Name-quality enforcement is separate from security. By default, rename_function and global write endpoints reject names that fail the built-in quality gates, and struct field writes apply the built-in field prefix convention. Disable the built-in convention layer with Edit > Tool Options > GhidraMCP HTTP Server > Strict Naming Enforcement. The same Tool Options checkbox covers rename_symbol (all symbol kinds), set_global, the apply_data_type prefix/type guard, and struct-field Hungarian prefix auto-fixes in create_struct, add_struct_field, and modify_struct_field. The setting is read when the MCP server starts or restarts. Function/global convention warnings are still returned when enforcement is disabled.

Example: exposing to a private LAN with auth

bash
export GHIDRA_MCP_AUTH_TOKEN=$(openssl rand -hex 32)
export GHIDRA_MCP_ALLOW_SCRIPTS=1     # only if your workflow needs it
export GHIDRA_MCP_FILE_ROOT=/srv/ghidra/inputs

java -jar GhidraMCPHeadless.jar --bind 0.0.0.0 --port 8089

Ghidra Server authentication

When connecting to a shared Ghidra Server, GhidraMCP can suppress the password dialog automatically. It resolves credentials in this order (first non-empty value wins):

Compatibility note: Ghidra 12.1.2 clients require Ghidra Server 12.1.2, 12.0.5, or a newer compatible server. Older shared servers are not safe targets for a 12.1 client upgrade.

  1. GHIDRA_SERVER_PASSWORD environment variable (or .env file in the Ghidra install directory or ~)
  2. ~/.ghidra-cred — single-line password file in your home directory
  3. <ghidra-install-dir>/.ghidra-cred

Username resolves similarly: GHIDRA_SERVER_USER env var → user.name system property.

If no password is found, Ghidra shows its normal GUI prompt. Set these in .env (see .env.template for the full block) to enable silent auth.

Migration from v5.4.0 → v5.4.1

  • Script endpoints now default-off. If you relied on /run_script_inline or /run_ghidra_script, export GHIDRA_MCP_ALLOW_SCRIPTS=1. This is a deliberate breaking change; the prior default was unsafe.
  • Localhost-only deployments need no changes. Auth, bind refusal, and path-root checks are all opt-in.

❓ Troubleshooting

spawn uv ENOENT / spawn python ENOENT when the client starts the server

Cause: the MCP client could not find the command on its own PATH. This happens before any bridge code runs, so there is nothing in the Ghidra log or the bridge log to look at — the process was never created.

It shows up when the client is launched by something other than a login shell:

  • a systemd user service (systemctl --user), whose PATH is /usr/local/bin:/usr/bin:/bin unless you extend it;
  • a desktop .desktop entry, dock icon, or app launcher;
  • macOS apps started from Finder, which inherit launchd's PATH.

None of those contain ~/.local/bin (uv's default install location) or ~/.cargo/bin, so "command": "uv" cannot resolve even though uv works perfectly in your terminal.

Solution: use an absolute path in the client config.

jsonc
// before — resolves against the client's PATH, fails under a service/GUI launcher
"command": "uv"
// after — no PATH lookup at all
"command": "/home/<you>/.local/bin/uv"

Find yours with which uv (POSIX) or where.exe uv (Windows). Or run:

bash
python -m tools.setup preflight

which prints the resolved absolute path, the PATH entries it searched when a launcher is missing, and a ready-to-paste config snippet. Note what that check can and cannot tell you: it resolves against your shell's PATH, not the client's, so a pass there is evidence, not proof — the absolute path is what actually removes the failure mode. (#441)

If you must keep a bare command name, give the service manager the PATH instead — e.g. Environment="PATH=%h/.local/bin:/usr/local/bin:/usr/bin:/bin" in the unit file, or systemctl --user import-environment PATH — but the absolute path is the smaller and more portable fix.

"GhidraMCP" menu not appearing in Tools

Cause: Plugin not enabled or installed incorrectly.

Solution:

  1. Verify extension is installed: File > Install Extensions — GhidraMCP should be listed
  2. Enable the plugin: File > Configure > Configure All Plugins > GhidraMCP (check the box)
  3. Restart Ghidra after installation/enabling

Server not responding / Connection refused

Cause: Server not started or wrong port.

Solution:

  1. Ensure you started the server: Tools > GhidraMCP > Start MCP Server

  2. Check configured port: Edit > Tool Options > GhidraMCP HTTP Server

  3. Check if port is in use:

    bash
    # Linux/macOS
    lsof -i :8089
    # Windows
    netstat -ano | findstr :8089
  4. Look for errors in Ghidra console: Window > Console

pip install fails with error: externally-managed-environment

Cause: PEP 668. Debian-family distros (Debian 12+, Kali, Ubuntu 23.04+) mark the system Python as externally managed, so global pip install is blocked to protect apt-managed packages.

Solution: Use a virtual environment — never --break-system-packages. The recommended path is uv, which manages a project-local .venv automatically:

bash
curl -LsSf https://astral.sh/uv/install.sh | sh
cd ghidra-mcp
uv run bridge-mcp-ghidra

Or a classic venv:

bash
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
bridge-mcp-ghidra

The debugger_* tools do not appear

Cause: They are registered only when GHIDRA_DEBUGGER_URL is set, and only on Windows. The debugger server they proxy to lives in the d2-game-exe repository since 2026-08-11 — this repo ships the proxies, not the server.

Solution: start the debugger server from that repo, then set the URL before launching the bridge:

text
export GHIDRA_DEBUGGER_URL=http://127.0.0.1:8099

A ModuleNotFoundError for pybag or comtypes while starting that server is a missing optional dependency on its side; install its Windows-only extras from that repo, and make sure you install into and run from the same interpreter.

500 Internal Server Errors

Cause: Server-side exception, often due to missing program data.

Solution:

  1. Ensure a binary is loaded in CodeBrowser
  2. Run auto-analysis first: Analysis > Auto Analyze
  3. Check Ghidra console (Window > Console) for Java exceptions
  4. Some operations require fully analyzed binaries

404 Not Found Errors

Cause: Endpoint doesn't exist or wrong URL.

Solution:

  1. Verify endpoint exists: curl http://127.0.0.1:8089/get_version
  2. Check for typos in endpoint name
  3. Ensure you're using correct HTTP method (GET vs POST)

Python Ghidra scripts fail with "No script provider found"

Cause: In Ghidra 12.1.2, Jython support is no longer enabled by default. .py scripts need the bundled Jython extension; Python 3 scripts should use PyGhidra instead of the Ghidra Script Manager.

Solution:

  1. In the Ghidra Front End, open File > Install Extensions.
  2. Check Jython, restart Ghidra, then refresh Script Manager.
  3. For new automation, prefer Java Ghidra scripts or PyGhidra.

Extension not appearing in Install Extensions

Cause: JAR file in wrong location.

Solution:

  1. Manual install location: ~/.ghidra/ghidra_12.1.2_PUBLIC/Extensions/GhidraMCP/lib/GhidraMCP.jar
  2. Or use: File > Install Extensions > Add and select the ZIP file
  3. Ensure JAR/ZIP was built for your Ghidra version

Build fails with "Ghidra dependencies not found"

Cause: Ghidra JARs not installed in local Maven repository.

Solution:

text
# Windows (recommended)
python -m tools.setup install-ghidra-deps --ghidra-path "C:\ghidra_12.1.2_PUBLIC"

📊 Production Performance

  • MCP Tools: 253 tools fully implemented (the whole catalog; the GUI plugin serves 239 of them and the headless server 226)
  • Speed: Sub-second response for most operations
  • Efficiency: 93% reduction in API calls via batch operations
  • Reliability: Atomic transactions with all-or-nothing semantics
  • AI Workflows: Proven documentation prompts refined across hundreds of real functions
  • Deployment: Automated version-aware deployment script

🛠️ API Reference

253 MCP tools backed by HTTP endpoints, grouped by catalog category. Generated from tests/endpoints.json by python -m tools.gen_readme_api_reference --write; the live schema at /mcp/schema is authoritative at runtime. Usage patterns: docs/prompts/TOOL_USAGE_GUIDE.md.

212 of these are served by both the GUI plugin and the standalone headless server. The rest are marked (GUI only) (27) or (headless only) (14) — calling one against the other server returns a 404, not an error message. See python -m tools.audit_server_scope for how the split is derived.

Program & Session Management

  • analysis_status - Get auto-analysis status for open programs
  • close_program - Close an open program by project path or name
  • create_memory_block - Create memory block, optionally initialized with byte contents (hex or base64)
  • create_property_map - Create a user property map to store typed values keyed by address
  • delete_bookmark - Delete bookmark
  • delete_property_map - Delete a user property map and all values it holds
  • exit_ghidra - Save and exit Ghidra
  • get_address_spaces - List all physical and overlay address spaces in the program (overlays include is_overlay flag and overlayed_space name)
  • get_current_program_info - Get current program info
  • get_language_metadata - Dump the program's language description: address spaces, registers, default symbols, endianness, pointer size (issue #192)
  • get_metadata - Get program metadata
  • get_program_options - Read all options in a program option group with types, current values, defaults, and descriptions
  • get_property - Read the value stored at an address in a property map
  • import_file - Import a binary file from disk into the current Ghidra project and open it
  • list_bookmarks - List bookmarks
  • list_open_programs - List open programs
  • list_option_groups - List program option groups (e.g
  • list_project_files - List project files
  • list_properties - List (address, value) entries stored in a property map, with pagination
  • list_property_maps - List user-defined property maps — typed per-address key→value stores
  • list_scripts - List available Ghidra scripts
  • open_program - Open program from project
  • read_memory - Read raw memory
  • reanalyze - Trigger full auto-analysis on a program
  • remove_program_option - Remove an option from a program option group
  • remove_property - Remove the value stored at a single address in a property map
  • run_ghidra_script - Run script with output capture
  • run_script_inline - Run inline script code
  • save_all_programs - Save all open programs
  • save_program - Save current program
  • set_bookmark - Set bookmark
  • set_image_base - Set the base address of the program (rebases all addresses)
  • set_program_option - Set a typed program option
  • set_property - Set a value at an address in a property map
  • switch_program - Switch current program

Project Organization

  • create_folder - Create a folder in the project
  • delete_file - Delete a file from the project
  • delete_project - Delete a Ghidra project (headless only)
  • list_projects - List available Ghidra projects (headless only)
  • move_file - Move a program file to a different folder in the project, preserving analysis and documentation
  • move_folder - Move a project folder and everything under it into another folder
  • project_info - Get detailed project info including running tools and open programs (GUI only)

Headless Project & Program Lifecycle

Available on the standalone headless server (GhidraMCPHeadlessServer).

  • archive_project - Archive the currently open project to a Ghidra-native .gar file (headless only)
  • checkin_program - Check an open program back in to the shared Ghidra Server as a new version (headless only)
  • close_project - Close the currently open project (headless only)
  • create_project - Create a new Ghidra project (headless only)
  • export_program - Export an open or project-resident program to a Ghidra Zip File (.gzf) (headless only)
  • get_project_info - Get info about the currently open project (headless only)
  • import_program - Import a Ghidra Zip File (.gzf) into the currently open project as a new DomainFile under target_folder (default '/') (headless only)
  • load_program - Load a binary file into the headless server for analysis (headless only)
  • load_program_from_project - Load program from Ghidra project (headless) (headless only)
  • open_project - Open an existing Ghidra project (.gpr file or directory)
  • restore_project - Restore a Ghidra .gar archive into a fresh on-disk project at parent_dir/project_name (headless only)
  • server_status - Check headless server connection status

Listing & Enumeration

  • convert_number - Convert number between bases
  • get_entry_points - Get program entry points
  • get_external_location - Get external location details
  • get_function_count - Return the number of functions in the loaded program
  • list_calling_conventions - List available calling conventions
  • list_classes - List namespace/class names
  • list_data_items - List defined data
  • list_data_items_by_xrefs - List data sorted by xref count
  • list_exports - List exported symbols
  • list_external_locations - List external locations
  • list_functions - List functions with addresses
  • list_functions_enhanced - List functions with metadata
  • list_globals - List global variables
  • list_imports - List imported symbols
  • list_methods - List all function names with pagination
  • list_namespaces - List all namespaces
  • list_segments - List memory segments
  • list_shadowed_globals - List named global DATA symbols that have NO type of their own because a larger data unit starting at an earlier address covers them
  • list_strings - List defined strings
  • search_functions - Search functions by name
  • search_strings - Search defined strings by a regex/substring pattern

Current GUI Context

  • get_current_address - Get cursor address (GUI only)
  • get_current_function - Get function at cursor (GUI only)
  • get_current_selection - Get highlighted address ranges in the CodeBrowser listing (GUI only) (GUI only)

Functions: Decompile, Rename, Prototypes & Variables

  • add_function_tag - Attach one or more tags to a function
  • batch_rename_function_components - Batch rename function components
  • clear_flow_and_repair - Run Ghidra's GUI 'Clear Flow and Repair' action on a seed range: clears instruction flow reachable from the seed, then repairs function bodies and re-disassembles retained flow (ClearFlowAndRepairCmd with clear_data=false, clear_labels=false, repair=true)
  • clear_instruction_flow_override - Clear flow override
  • create_function - Create function at address
  • create_function_tag - Create a program-wide function tag definition with an optional comment
  • decompile_function - Decompile function
  • delete_function - Delete function at address
  • delete_function_tag - Delete a program-wide function tag definition
  • disassemble_bytes - Disassemble byte range
  • disassemble_function - Disassemble function
  • force_decompile - Force fresh decompilation
  • get_function_by_address - Get function at address
  • get_function_tags - List all tags assigned to a specific function
  • get_function_variables - List all variables in a function
  • list_class_members - List the member functions of a C++ class
  • list_function_tags - List all program-wide function tag definitions with their use counts
  • remove_function_tag - Detach one or more tags from a function
  • rename_function - Rename function by name
  • rename_variables - Batch rename variables
  • search_functions_by_tag - List all functions that have a specified tag attached
  • set_function_no_return - Set no-return attribute
  • set_function_prototype - Set function prototype (return type, param types, calling convention)
  • set_function_tag_comment - Update the comment/description on an existing program-wide function tag
  • set_function_this_type - Set the decompiler/database type of the implicit 'this' pointer (ECX on x86 __thiscall/__fastcall)
  • set_variable_storage - Set variable storage
  • set_variable_type - Set the data type of a function variable (local OR parameter) by name at the decompiler (high-level) layer
  • set_variables - Set types and names for multiple variables atomically

Symbols, Labels & Globals

  • can_rename_at_address - Check if address can be renamed
  • create_label - Create label
  • delete_label - Delete label at address
  • get_function_labels - Get labels in function
  • rename_symbol - Rename a symbol of any kind

Cross-References & Call Graphs

  • add_memory_reference - Create a user-defined cross-reference between two memory addresses that the auto-analyzer can't infer (runtime-populated pointer tables, vtables, late-bound function pointers, missed jump/switch tables)
  • analyze_call_graph - Analyze function call graph patterns
  • get_assembly_context - Get assembly context
  • get_bulk_xrefs - Get xrefs for multiple addresses
  • get_full_call_graph - Get full call graph
  • get_function_call_graph - Get call graph
  • get_function_callees - Get functions called
  • get_function_callers - Get calling functions
  • get_function_jump_targets - Get jump targets
  • get_function_xrefs - Get function cross-references
  • get_xrefs_from - Get references from address
  • get_xrefs_to - Get references to address
  • remove_reference - Remove memory cross-reference(s) from one address to another — the inverse of add_memory_reference

Data Types & Structures

  • add_struct_field - Add struct field
  • analyze_global_completeness - Score a global variable's documentation completeness on a budgeted 0-100 scale — the data-address analog of analyze_function_completeness
  • analyze_struct_field_usage - Analyze struct field usage
  • apply_data_classification - Apply data classification
  • apply_data_type - Apply data type
  • audit_global - Audit a global variable's documentation state
  • audit_globals_in_function - Audit every global variable referenced from within a function in one call
  • clone_data_type - Clone data type
  • create_array_type - Create array type
  • create_data_type_category - Create data type category
  • create_enum - Create enumeration
  • create_function_signature - Create functi

Встановлення

TypingMind
{
  "mcpServers": {
    "ghidra-mcp": {
      "command": "python",
      "args": [
        "-m",
        "tools.setup"
      ]
    }
  }
}

Використовуйте MCP Ghidra MCP Server з різними моделями ШІ

TypingMind підключає інструменти MCP на рівні робочого простору, тож після підключення Ghidra MCP Server ви можете використовувати їх із різними моделями ШІ в TypingMind, а не налаштовувати окремо для кожної моделі. Ця інтеграція MCP працює локально через конектор MCP TypingMind на вашому пристрої.

Інструкція з налаштування локального конектора

Виберіть цей варіант, якщо серверу MCP потрібен доступ до локальних файлів, програм або приватних ресурсів на вашому комп’ютері.

1

Відкрийте налаштування MCP

У TypingMind перейдіть до розділу «Налаштування», відкрийте «Розширені налаштування», потім «Протокол контексту моделі» й виберіть «Параметри конектора».

  1. Відкрийте TypingMind у браузері.
  2. Натисніть значок налаштувань.
  3. Перейдіть до розділу «Розширені налаштування».
  4. Відкрийте розділ «Протокол контексту моделі».
  5. Натисніть «Параметри конектора» й виберіть «Цей пристрій».
Екран налаштування конектора MCP у TypingMind з вибраним варіантом «Цей пристрій»
2

Виконайте команду конектора

Виберіть «Цей пристрій», скопіюйте команду з TypingMind і виконайте її в терміналі. Не зупиняйте процес, поки користуєтеся MCP.

  1. Скопіюйте команду налаштування, показану в TypingMind.
  2. Відкрийте «Термінал» у macOS або Windows Terminal у Windows.
  3. Вставте й виконайте команду.
  4. Підтвердьте встановлення пакета, якщо термінал запитає дозволу продовжити.
  5. Не закривайте вікно термінала й не зупиняйте процес, поки користуєтеся інструментами MCP.
3

Додайте Ghidra MCP Server як сервер

Коли статус конектора зміниться на «Готово», натисніть «Змінити сервери» та вставте конфігурацію сервера MCP.

  1. Зачекайте, доки статус конектора зміниться на «Готово».
  2. Натисніть «Змінити сервери».
  3. Вставте конфігурацію сервера MCP Ghidra MCP Server.
  4. Збережіть список серверів.
  5. Оновіть дані, щоб переконатися, що конектор досі готовий до роботи.
Налаштування MCP у TypingMind з активним сервером і кнопкою «Змінити сервери»
{
  "mcpServers": {
    "ghidra-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Використовуйте підключення з різними моделями

Збережіть список серверів, відкрийте «Плагіни», увімкніть інструменти MCP для Ghidra MCP Server, а потім виберіть будь-яку підтримувану модель ШІ в TypingMind і використовуйте інструменти в чаті або призначте їх агенту ШІ.

  1. Відкрийте сторінку «Плагіни» в TypingMind.
  2. Увімкніть інструменти MCP для Ghidra MCP Server.
  3. Почніть чат і виберіть модель ШІ, яку хочете використовувати.
  4. Використовуйте інструменти MCP у чаті або призначте їх агенту ШІ.
  5. За потреби перемикайтеся на іншу модель ШІ без повторного підключення MCP.
Чат TypingMind із використанням увімкнених інструментів MCP і вибраної моделі ШІ
Допоможете з цим завданням через Ghidra MCP Server?
Ghidra MCP Server
Звісно. Я це прочитав.
Ось що я знайшов за допомогою Ghidra MCP Server.

Поширені запитання

Для чого використовується сервер MCP Ghidra MCP Server?

Ghidra MCP Server — це сервер MCP, який дає змогу сумісним клієнтам ШІ підключатися до зовнішніх інструментів і контексту. У TypingMind ви можете додати цей сервер MCP один раз і зробити його інструменти доступними у своєму робочому просторі ШІ.

Чи можу я використовувати MCP Ghidra MCP Server з кількома моделями ШІ в TypingMind?

Так. TypingMind підключає інструменти MCP на рівні робочого простору, тому ви можете використовувати Ghidra MCP Server з різними моделями ШІ, як-от Claude, ChatGPT, Gemini або іншими моделями, які ви налаштували в TypingMind, без окремого налаштування сервера MCP для кожної моделі.

Навіщо використовувати MCP Ghidra MCP Server із TypingMind?

TypingMind — один із найкращих інтерфейсів для чату з великими мовними моделями, адже він об’єднує різні моделі ШІ, промпти, плагіни, агентів ШІ, ключі API та інструменти MCP в одному робочому просторі. Підключивши Ghidra MCP Server, ви зможете використовувати його інструменти MCP з вибраними моделями та впорядковано працювати з чатами в TypingMind.

Як підключити MCP Ghidra MCP Server до TypingMind?

Ghidra MCP Server працює через локальний конектор MCP TypingMind. Це найкращий варіант, коли серверу MCP потрібен доступ до локальних файлів, настільних застосунків, інструментів командного рядка або приватних ресурсів на вашому комп’ютері.

Які інструменти надає MCP Ghidra MCP Server у TypingMind?

Ghidra MCP Server надає можливості MCP, які можна ввімкнути на сторінці «Плагіни» в TypingMind і використовувати в чаті або призначати агентам ШІ.

Чи потрібно передавати свої ключі API в TypingMind, щоб використовувати MCP Ghidra MCP Server?

Ні. TypingMind орієнтований насамперед на локальну роботу й дає змогу зберігати контроль над постачальниками моделей, ключами API, промптами та конфігурацією MCP. Якщо Ghidra MCP Server потребує автентифікації, під час створення підключення додайте потрібні заголовки, налаштування OAuth або локальну конфігурацію для цього сервера MCP.

Схожі сервери MCP

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇