Logo van GhidraMCP

GhidraMCP

Community
13bm

Active Socket based MCP Server for Ghidra

Uitgever13bm
RepositoryGhidraMCP
TaalJava
Forks
23
Sterren
140
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    GhidraMCP biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    140 sterren en 23 forks in de gekoppelde repository.

GhidraMCP

Build License

A Ghidra extension that exposes 70 reverse-engineering tools to AI assistants through the Model Context Protocol (MCP). Open a binary in Ghidra, enable the plugin, and let Claude (or any MCP client) decompile functions, rename symbols, annotate code, search for vulnerabilities, and more.

Architecture

 AI Client (Claude Desktop / CLI)
        |  stdio + MCP JSON-RPC
        v
   Go MCP Bridge  (mcp_bridge)
        |  TCP, length-prefixed JSON-RPC
        v
   Ghidra Plugin  (MCPServerPlugin)
        |
        v
   Ghidra Program API

The Ghidra plugin (Java) starts a TCP server inside Ghidra and auto-launches the Go bridge binary. The bridge speaks MCP over stdio to the AI client and forwards calls to the Java plugin over a local TCP socket with 4-byte length-prefixed JSON-RPC framing. Optional API-key authentication protects the TCP channel.

Features

  • 70 MCP tools spanning query, mutation, analysis, malware triage, IoT/embedded security, structure management, async decompilation, and multi-instance support
  • Easy setup -- plugin auto-starts the bridge; use MCP > Settings > Write to Claude Config to configure your MCP client
  • Cross-platform -- prebuilt bridge binaries for Linux x86_64, Windows x86_64, macOS x86_64 and macOS ARM64
  • Configurable -- port, localhost-only binding, API-key auth, auto-start, bridge enable/disable via GhidraMCP.properties
  • Multi-instance -- work with multiple Ghidra windows simultaneously using target_port to route tool calls
  • Async decompilation -- decompile large functions without blocking; poll for results later
  • Connection retry -- the bridge reconnects automatically if Ghidra restarts or the connection drops
  • Pagination -- large result sets (functions, strings, imports, ...) support offset/limit for safe incremental retrieval
  • CI/CD -- automated builds, Go + Java tests, Ghidra integration tests, and auto-release when a new Ghidra version drops

Quick Start

Prerequisites

Install

  1. Download the latest release ZIP from Releases
  2. In Ghidra: File > Install Extensions > "+" > select the ZIP
  3. Restart Ghidra

Enable

  1. Open a project and a program (binary)
  2. File > Configure > GhidraMCP -- check MCPServerPlugin
  3. The plugin auto-starts the TCP server (default localhost:8765) and launches the bridge

To configure Claude Desktop, open MCP > Settings and click Write to Claude Config. For other MCP clients, click Copy to Clipboard and add this to your client config:

json
{
  "mcpServers": {
    "ghidra": {
      "command": "/path/to/mcp_bridge",
      "args": ["--host", "localhost", "--port", "8765"]
    }
  }
}

If you have an API key set, include it in the env block (the plugin does this automatically):

json
{
  "mcpServers": {
    "ghidra": {
      "command": "/path/to/mcp_bridge",
      "args": ["--host", "localhost", "--port", "8765"],
      "env": {
        "GHIDRA_API_KEY": "your-key-here"
      }
    }
  }
}

You can also grab the snippet from Ghidra: MCP > Copy MCP Config (copies it to your clipboard).

Tools

Full reference with parameters, types, and examples: TOOLS.md

The tables below give a quick overview. See TOOLS.md for detailed parameter docs.

Query (1-21)

ToolDescription
list_functionsList all functions with entry points, sizes, return types
list_classesList all classes / namespaces
list_importsList imported symbols and external dependencies
list_exportsList exported symbols
list_namespacesList all namespaces
list_data_itemsList defined data (globals, constants, arrays, structs)
list_stringsList strings with optional substring filter
search_functions_by_nameSearch functions by name substring
get_function_by_addressDetailed info for a function at an address
get_current_addressAddress currently selected in Ghidra
get_current_functionFunction at the current cursor position
decompile_functionDecompile by name to C pseudocode
decompile_function_by_addressDecompile by address to C pseudocode
disassemble_functionRaw disassembly listing for a function
get_xrefs_toCross-references TO an address
get_xrefs_fromCross-references FROM an address
get_function_xrefsAll xrefs (callers + callees) for a function
get_program_infoProgram metadata (arch, compiler, format, etc.)
get_memory_mapMemory layout with segment permissions
get_variablesParameters and locals for a function

Mutation (22-38)

ToolDescription
rename_functionRename a function by name
rename_function_by_addressRename a function by address
rename_dataRename a data label
rename_variableRename a local variable
set_decompiler_commentSet a decompiler-view comment
set_disassembly_commentSet a disassembly-view comment
set_function_prototypeSet full function prototype
set_local_variable_typeChange a variable's data type
set_bookmarkAdd a bookmark
remove_bookmarkRemove a bookmark
set_equateSet a named constant on a scalar operand
create_structureCreate a structure data type
create_enumCreate an enum data type
apply_data_typeApply a data type at an address
set_namespaceSet namespace or class for a function
set_calling_conventionSet calling convention for a function
set_image_baseSet the image base address
set_memory_permissionsModify memory block permissions

Advanced Analysis (39-45)

ToolDescription
patch_bytesPatch raw bytes at an address
get_basic_blocksGet basic blocks for a function
extract_api_call_sequencesExtract API call sequences for security analysis
identify_user_input_sourcesFind user-input entry points
generate_call_graphHierarchical call graph
identify_crypto_patternsDetect crypto implementations
find_obfuscated_stringsLocate obfuscated strings

Malware Analysis (46-53)

ToolDescription
search_bytesSearch for byte patterns
emulate_functionEmulate a function
extract_iocsExtract indicators of compromise
find_dynamic_api_resolutionDetect dynamic API resolution
detect_anti_analysisDetect anti-analysis techniques
add_external_functionAdd an external function reference
get_pe_infoPE header details
get_elf_infoELF header details

IoT / Embedded Security (54-59)

ToolDescription
create_memory_blockCreate a memory block
detect_security_mitigationsDetect binary security mitigations
find_format_string_vulnsFind format-string vulnerabilities
find_rop_gadgetsFind ROP gadgets
detect_control_flow_flatteningDetect control-flow flattening
mark_code_coverageMark code coverage regions

Utility (60-62)

ToolDescription
get_bookmarksList bookmarks (optionally by address)
list_equatesList all equates
pingHealth-check the connection

Multi-Instance (63)

ToolDescription
list_ghidra_instancesScan ports 8765-8774 for running Ghidra instances

All tools accept an optional target_port parameter to route calls to a specific Ghidra instance. This lets you work with multiple binaries open in separate Ghidra windows simultaneously.

Structure Management (64-68)

ToolDescription
get_structureGet full details of a structure (fields, offsets, types)
list_structuresList all defined structures with pagination
edit_structureAdd, insert, delete, replace, or clear fields in a structure
rename_structureRename an existing structure
delete_structureDelete a structure data type

Async Decompilation (69-70)

ToolDescription
decompile_function_asyncStart async decompilation of a large function (returns task ID)
get_decompile_resultPoll for an async decompilation result by task ID

Async decompilation is useful for large functions that may take 30+ seconds to decompile. The client can start the decompilation, continue other work, and poll for the result later.

Configuration

The plugin stores settings in GhidraMCP.properties inside Ghidra's user settings directory:

PropertyDefaultDescription
port8765TCP port for the Java server
localhost_onlytrueBind to localhost only
api_key(empty)Shared secret for bridge authentication
auto_starttrueStart the server when the plugin loads
bridge_enabledtrueAuto-launch the Go bridge binary

Settings Dialog

Open MCP > Settings in the Ghidra menu to configure all properties through a GUI. The dialog includes:

  • Editable fields for port, localhost binding, API key, auto-start, and bridge enabled
  • Generate button to create a cryptographically random 32-character API key
  • Write to Claude Config button to merge GhidraMCP into Claude Desktop's claude_desktop_config.json
  • Copy to Clipboard button to copy the MCP config JSON snippet for manual setup
  • Security warning if you enable remote access without an API key
  • Auto-restart prompt if the server is running when you save

Changes are saved to disk when you click OK. You can also edit the properties file directly at the path shown in the dialog.

If auto_start is false, start the server manually from MCP > Toggle Server in the Ghidra menu.

Note: The bridge_enabled setting is for advanced use cases — developers debugging the bridge binary or users with a custom MCP client that talks TCP directly to the Java server. Most users should leave it enabled.

Security

By default the TCP server binds to localhost only and has no API key, which is fine for local single-user use. For stricter setups:

API-Key Authentication

  1. Open MCP > Settings and click Generate to create a random key (or type your own)
  2. Click OK to save — the bridge picks up the key automatically on next start
  3. On connect, the bridge sends an authenticate request with the key before any other calls
  4. The server rejects all non-auth requests until authentication succeeds
  5. After 3 failed attempts the server terminates the connection

The API key is passed to the bridge via the GHIDRA_API_KEY environment variable (not as a CLI flag) to prevent leaking it in the process argument list. When running the bridge manually, set the environment variable:

bash
# Linux/macOS
export GHIDRA_API_KEY="your-key-here"
./mcp_bridge --host localhost --port 8765

# Windows (PowerShell)
$env:GHIDRA_API_KEY = "your-key-here"
.\mcp_bridge.exe --host localhost --port 8765

When an API key is set, the Write to Claude Config and Copy to Clipboard buttons in the Settings dialog include the key in the env block automatically.

Localhost Binding

With localhost_only=true (default), the server only accepts connections from 127.0.0.1. Set to false if you need remote access (e.g., Ghidra on a headless server), but always use an API key when exposing the port beyond localhost.

Remote / Headless Setup

GhidraMCP can serve AI clients running on a different machine. This is useful when Ghidra runs on a headless analysis server while the AI client runs elsewhere.

  1. Open MCP > Settings
  2. Uncheck Localhost Only to accept remote connections
  3. Click Generate to create an API key (always use one for remote access)
  4. Click OK and restart the server

On the remote machine, configure the MCP client to point at the Ghidra host:

json
{
  "mcpServers": {
    "ghidra": {
      "command": "/path/to/mcp_bridge",
      "args": ["--host", "ghidra-server.local", "--port", "8765"],
      "env": {
        "GHIDRA_API_KEY": "your-key-here"
      }
    }
  }
}

Warning: Always use an API key when exposing the server beyond localhost. Without authentication, anyone who can reach the port has full access to the Ghidra API.

Building from Source

bash
git clone https://github.com/13bm/GhidraMCP.git
cd GhidraMCP

Build the Go bridge

bash
cd mcp-bridge
go build -o mcp_bridge .
cd ..

Build the Ghidra extension

bash
export GHIDRA_INSTALL_DIR=/path/to/ghidra
gradle buildExtension

The extension ZIP will be in dist/.

Run tests

bash
# Go tests
cd mcp-bridge && go test ./... -v && cd ..

# Java unit + integration tests (requires Xvfb on headless Linux)
xvfb-run gradle test -PGHIDRA_INSTALL_DIR=$GHIDRA_INSTALL_DIR

CI/CD

The project uses GitHub Actions for automated builds and releases:

  • build.yml -- Triggered on push/PR to master and on tags. Runs Go tests, cross-compiles the bridge for 4 platforms, runs Java unit + Ghidra integration tests under Xvfb, builds the extension ZIP, and creates GitHub Releases on v* tags.
  • check-ghidra-release.yml -- Runs daily. Detects new Ghidra releases, opens a version-bump PR, auto-approves via GitHub App, and auto-merges if all tests pass.

Contributing

Contributions welcome! Please open issues or submit pull requests.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes
  4. Push and open a Pull Request

License

Apache License 2.0

Acknowledgments


GhidraMCP is not affiliated with or endorsed by the NSA or the Ghidra project.

Installatie

TypingMind
{
  "mcpServers": {
    "13bm-ghidramcp": {
      "command": "/path/to/mcp_bridge",
      "args": [
        "--host",
        "localhost",
        "--port",
        "8765"
      ]
    }
  }
}

Gebruik GhidraMCP MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra GhidraMCP is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg GhidraMCP toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van GhidraMCP.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "13bm-ghidramcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van GhidraMCP in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van GhidraMCP in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je GhidraMCP gebruiken om me hiermee te helpen?
GhidraMCP
Zeker. Ik heb het gelezen.
Dit vond ik met GhidraMCP.

Veelgestelde vragen

Waarvoor wordt de MCP-server GhidraMCP gebruikt?

GhidraMCP is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik GhidraMCP MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je GhidraMCP gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom GhidraMCP MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als GhidraMCP verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik GhidraMCP MCP met TypingMind?

GhidraMCP werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt GhidraMCP MCP in TypingMind?

GhidraMCP biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om GhidraMCP MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als GhidraMCP authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇