SuperAPI AI Directory

GhidraMCP

Ghidra plugin for binary analysis: function inspection, decompilation, memory exploration and import/export analysis.

Open website

About this tool

GhidraMCP is an extension plugin for Ghidra that provides 70 reverse engineering tools to AI assistants through the Model Context Protocol (MCP), enabling AI clients to participate in binary analysis work. It uses an architecture combining a Java plugin with a Go bridge program: the Java plugin starts a TCP server inside Ghidra and automatically launches the Go bridge binary; the bridge program communicates with AI clients via MCP over stdio, then forwards calls to the local TCP socket in JSON-RPC frames with a 4-byte length prefix. Optional API key authentication is used to protect the TCP channel, which by default binds only to localhost, making it suitable for local single-user use.

The tool capabilities cover multiple categories, including querying, modification, analysis, malware triage, IoT/embedded security, structure management, asynchronous decompilation, and multi-instance support. All tools accept an optional target_port parameter, used to route calls to a specified Ghidra instance, so different binaries can be handled simultaneously in multiple Ghidra windows. Asynchronous decompilation is suitable for large functions that may take more than 30 seconds to complete; clients can initiate decompilation first, continue with other work, and then poll for the result. For large result sets such as functions, strings, and imports, offset / limit pagination is supported, so they can be safely retrieved incrementally.

In terms of usage: an MCP-compatible AI client is required (such as Claude Desktop, Claude Code, etc.), and the latest release ZIP package should be downloaded from Releases; in Ghidra, install it by selecting that ZIP via File > Install Extensions > "+"; after opening a project and binary program, check MCPServerPlugin in File > Configure > GhidraMCP; the plugin will automatically start the TCP server (default localhost:8765) and launch the bridge program. When configuring Claude Desktop, you can click Write to Claude Config in MCP > Settings; other MCP clients can click Copy to Clipboard and add it to the client configuration. If an API key is set, it needs to be included in the env blockmedium (the plugin handles this automatically). The configuration snippet can also be obtained in Ghidra via MCP > Copy MCP Config. For the full tool reference (including parameters, types, and examples), see TOOLS.md.

Settings are stored in the GhidraMCP.properties file in the Ghidra user settings directory. You can also configure the port, localhost binding, API key, auto-start, and bridge enable/disable via the MCP > Settings graphical interface. The dialog provides a Generate button to generate a 32-character random API key, a Write to Claude Config button to merge GhidraMCP into Claude Desktop's claude_desktop_config.json, and a Copy to Clipboard button to copy the MCP configuration JSON snippet. If you save while the service is running, you will be prompted whether to restart automatically. When auto_start is false, you can manually start the server from MCP > Toggle Server. The bridge_enabled setting is intended for advanced scenarios (such as debugging the bridge program or using a custom MCP client that communicates directly with the Java server over TCP); most users should keep it enabled.

Regarding security, by default the TCP server binds only to localhost and has no API key. A stricter configuration can enable API key authentication: generate or enter a key in MCP > Settings and save it; the bridge will first send an authenticate request when connecting, and the server will reject all unauthenticated requests until authentication succeeds; after 3 consecutive failures, the connection is terminated. The API key is passed via the GHIDRA_API_KEY environment variable rather than a command-line argument, to prevent it from leaking in the process argument list. When localhost_only is true (the default), the server only accepts connections from 127.0.0.1; if remote access is needed (for example, Ghidra running on a headless server while the AI client is on another machine), you can uncheck it and be sure to use an API key. In remote/headless scenarios, you need to point the MCP client on the remote machine to the Ghidra host.

Project support is built from source: build the Go bridge and the Ghidra extension separately; the extension ZIP will be generatedin the dist/ directory. The project uses GitHub Actions for automated builds and releases: build.yml runs on push, PR, or tag, runs Go tests, cross-compiles the bridge for 4 platforms, runs Java unit tests and 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 versions, submits version upgrade PRs, auto-approves via a GitHub App, and automatically merges after tests pass. The license is Apache License 2.0. GhidraMCP is not affiliated with or endorsed by the NSA or the Ghidra project. The project welcomes contributions; you can submit an issue or pull request.