AI Skill Hub 强烈推荐:Ghidra逆向工程MCP服务器 是一款优质的MCP工具。已获得 2.0k 颗 GitHub Star,AI 综合评分 8.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
基于Ghidra的开源MCP工具集,提供200+个AI驱动的逆向工程工具和GUI插件。整合先进的二进制分析能力与AI能力,适合安全研究员、逆向工程师和恶意软件分析人员进行自动化代码分析和漏洞挖掘。
Ghidra逆向工程MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于Ghidra的开源MCP工具集,提供200+个AI驱动的逆向工程工具和GUI插件。整合先进的二进制分析能力与AI能力,适合安全研究员、逆向工程师和恶意软件分析人员进行自动化代码分析和漏洞挖掘。
Ghidra逆向工程MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/bethington/ghidra-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"ghidra----mcp---": {
"command": "npx",
"args": ["-y", "ghidra-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 Ghidra逆向工程MCP服务器 执行以下任务... Claude: [自动调用 Ghidra逆向工程MCP服务器 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"ghidra____mcp___": {
"command": "npx",
"args": ["-y", "ghidra-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
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.
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.pyscripts inghidra_scripts/require installing the Jython extension from File > Install Extensions and restarting Ghidra.
Cause: Ghidra JARs not installed in local Maven repository.
Solution: ```text
Ghidra JARs must be installed into your local Maven repository (~/.m2/repository) before compilation. This is a one-time setup per machine, and again when your Ghidra version changes. -Deploy now installs these automatically by default.
The tool enforces version consistency between: - pom.xml (ghidra.version) - --ghidra-path version segment (e.g., ghidra_12.1.2_PUBLIC)
If these do not match, deployment fails fast with a clear error.
Recommended for all platforms: usepython -m tools.setupdirectly.ensure-prereqsinstalls runtime Python requirements plus the Ghidra JARs needed in the local Maven repository.deploycopies the build output, installs the user-profile extension, and patches Ghidra user config.
1. Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git
cd ghidra-mcp
2. Recommended: run environment preflight first:
python -m tools.setup preflight --ghidra-path "F:\ghidra_12.1.2_PUBLIC"
3. Build and deploy to Ghidra:
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):
# 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:
python -m tools.setup --help
6. Optional build-only mode (advanced/troubleshooting):
python -m tools.setup build
Supported build path: python -m tools.setup build uses Maven under the hood and is the canonical workflow used by the repo tasks and docs.
# Manual Maven build (requires Ghidra deps already installed in local .m2)
mvn clean package assembly:single -DskipTests
# Secondary/manual Gradle build path only (not used by tools.setup or VS Code tasks)
GHIDRA_INSTALL_DIR=/path/to/ghidra gradle buildExtension
1. Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git
cd ghidra-mcp
2. Install system prerequisites (if not already installed):
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 barepip installfails 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.venvautomatically, and is what this repo's commands use): >> or a classic virtual environment: >> curl -LsSf https://astral.sh/uv/install.sh | sh > uv run bridge-mcp-ghidra # resolves deps into .venv and starts the bridge >> python3 -m venv .venv && source .venv/bin/activate > pip install -e . > bridge-mcp-ghidra >
3. Run environment preflight:
python -m tools.setup preflight --ghidra-path ~/ghidra_12.1.2_PUBLIC
4. Build and deploy to Ghidra (single command):
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:
python -m tools.setup install-ghidra-deps --ghidra-path ~/ghidra_12.1.2_PUBLIC
6. Show command help:
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/.
1. Install prerequisites:
brew install openjdk@21 maven python ghidra
2. Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git
cd ghidra-mcp
3. Install Ghidra JARs into local Maven:
python -m tools.setup install-ghidra-deps \
--ghidra-path /opt/homebrew/opt/ghidra/libexec
4. Build and deploy:
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:
/opt/homebrew/opt/ghidra/libexec/ghidraRun
In the main project window: Tools > GhidraMCP > Start MCP Server
6. Configure Cursor/Claude MCP (~/.cursor/mcp.json):
{
"mcpServers": {
"ghidra": {
"command": "uv",
"args": ["run", "--directory", "/path/to/ghidra-mcp", "bridge-mcp-ghidra"]
}
}
}
@Pandoriaantje maintains community AUR packages:
ghidra-mcp-git — tracks mainghidra-mcp — tracks tagged releasesInstall with your AUR helper of choice, e.g.:
yay -S ghidra-mcp # or ghidra-mcp-git
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:
curl -LsSf https://astral.sh/uv/install.sh | sh
cd ghidra-mcp
uv run bridge-mcp-ghidra
Or a classic venv:
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
bridge-mcp-ghidra
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
```bash
python -m tools.setup ensure-prereqs --ghidra-path "C:\ghidra_12.1.2_PUBLIC" python -m tools.setup build python -m tools.setup deploy --ghidra-path "C:\ghidra_12.1.2_PUBLIC"
python -m tools.setup preflight --strict --ghidra-path "C:\ghidra_12.1.2_PUBLIC"
#### Option 1: Stdio Transport (Recommended for AI tools)
uv run bridge-mcp-ghidra # or: python -m bridge_mcp_ghidra
To add the bridge to Autohand Code from a cloned checkout:
autohand mcp add ghidra 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)
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):
{
"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)
uv run bridge-mcp-ghidra --transport sse --mcp-host 127.0.0.1 --mcp-port 8081
| Flag | Default | Description |
|---|---|---|
--transport | stdio | stdio (AI tools), streamable-http (web clients), sse (deprecated) |
--mcp-host | 127.0.0.1 | Bind host for HTTP transports |
--mcp-port | — | Port for HTTP transports |
--lazy | off | Load only the default tool groups on connect. Faster startup, but MCP clients that don't support tools/list_changed will see an incomplete tool list. Not recommended for Claude Code. |
--no-lazy | (default) | Load all tool groups immediately on connect. Required for most AI clients. |
--default-groups | listing,function,program | Comma-separated groups loaded on connect when --lazy is set. |
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).
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.
The bridge exposes a large catalog. To keep the model's tool surface small, run with --lazy (loads only listing,function,program on connect) and let 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 eager and --lazy modes, so agents that honor tools/list_changed get full discovery without the upfront context cost.
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:
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:
| Flag | Default | Description |
|---|---|---|
--port | 8099 | HTTP server port |
--host | 127.0.0.1 | Bind address (0.0.0.0 to expose on LAN) |
--exports-dir | — | Path to a dll_exports/ directory for ordinal-to-name resolution |
--log-level | INFO | DEBUG, 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
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
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.
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)get_bulk_xrefs - Get xrefs for multiple addressesget_function_xrefs - Get function cross-referencesget_xrefs_from - Get references from addressget_xrefs_to - Get references to addressremove_reference - Remove memory cross-reference(s) from one address to another — the inverse of add_memory_referencepython -m tools.setup bump-version --new X.Y.Z ```
The authoritative build system today is Maven. tools.setup, the VS Code tasks, and the documented deploy flow all build through pom.xml and write artifacts to target/. build.gradle remains in the repo as a manual fallback for direct Ghidra/Gradle users, but it is not the primary path.
| Command | What it does |
|---|---|
ensure-prereqs | Install Python deps + Ghidra Maven JARs in one shot. Start here on a new machine. |
preflight | Validate Python, build tool, Ghidra path, and JAR availability without making changes. Add --strict to also check network reachability. |
build | Build the plugin JAR and extension ZIP via Maven (or Gradle when TOOLS_SETUP_BACKEND=gradle). |
deploy | Copy the built extension into the Ghidra profile and patch FrontEndTool.xml for auto-activation. |
start-ghidra | Launch the configured Ghidra installation. |
clean | Remove Maven/Gradle build outputs (target/, build/). |
clean-all | Remove build outputs plus local cache artifacts (.m2 Ghidra JARs, etc.). |
install-ghidra-deps | Install only the Ghidra JARs into ~/.m2. Useful when the build environment changes. |
install-python-deps | Install the Python dependency groups via uv sync. |
run-tests | Run the Java offline test suite (no live Ghidra needed). |
verify-version | Check that version strings are consistent across pom.xml, CHANGELOG.md, and README.md. |
bump-version --new X.Y.Z | Atomically update all version references. Pass --tag to create a git tag. |
Common flags accepted by most commands:
| Flag | Description |
|---|---|
--ghidra-path PATH | Ghidra installation directory. Defaults to GHIDRA_PATH from .env. |
--dry-run | Print actions without executing them. |
--force | Reinstall Ghidra JARs even if already present (install-ghidra-deps, ensure-prereqs). |
--with-debugger | Force-install debugger Python requirements (Windows only). |
--use-debugger-toggle | Read INSTALL_DEBUGGER_DEPS from .env to decide whether to install debugger deps. |
--test TIER | (deploy only) Opt into live deploy regression tiers such as release or debugger-live. |
--strict | (preflight only) Also check network reachability for Maven Central and PyPI. |
Deploy test tiers are opt-in because benchmark tiers can import/reset Benchmark.dll and BenchmarkDebug.exe in the active Ghidra project. Use --test release before cutting releases, or set GHIDRA_MCP_DEPLOY_TESTS=release in a local .env when you want every deploy on your machine to run the live benchmark regression. See Testing and Release Regression.
```text
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/statusare advertised as names likedebugger_status_2when needed to avoid collisions with static bridge tools.
ghidra-mcp-bridge wheel; bridge-mcp-ghidra console script) that translates MCP protocol to HTTP calls (225 catalog entries)python -m tools.setup ensure-prereqs --ghidra-path "C:\ghidra_12.1.2_PUBLIC" python -m tools.setup build python -m tools.setup deploy --ghidra-path "C:\ghidra_12.1.2_PUBLIC"
If you see a version mismatch error, align both values: 1. pom.xml → ghidra.version 2. --ghidra-path version segment (ghidra_X.Y.Z_PUBLIC)
Then rerun:
python -m tools.setup preflight --ghidra-path "C:\ghidra_12.1.2_PUBLIC"
```text
Ghidra MCP 服务概述:一个用于 Ghidra 的 Model Context Protocol (MCP) 服务器,提供二进制分析功能。
功能特性: - 二进制分析能力 - 函数分析 - 数据流分析 - 数据结构发现 - 字符串提取 - 自动部署 - 批量操作 - 原子事务 - 全面日志
环境依赖与系统要求: - Java 21 LTS - Apache Maven 3.9+ - Ghidra 12.1 - Python 3.10+ - 共享 Ghidra 服务器用户:Ghidra 12.1 客户端要求 Ghidra 服务器版本为 12.1、12.0.5 或更高版本
安装步骤说明: - 克隆仓库 - 安装系统依赖项 - 运行环境预检查 - 构建并部署
使用教程: - 基本使用 - 流式 HTTP 传输
配置说明: - 环境变量 - Docker 环境变量 - JVM 选项
API/接口说明: - 版本更新 - 命令参考
工作流 / 模块说明: - 全面 MCP 兼容性 - 244 MCP 工具 - 生产就绪可靠性 - 实时分析
FAQ 摘要: - 版本匹配错误
业界领先的AI赋能逆向工程平台,200+工具覆盖面广,Java实现稳定可靠,2k+ Stars验证其价值,活跃维护中。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,Ghidra逆向工程MCP服务器 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | ghidra-mcp |
| 原始描述 | 开源MCP工具:Ghidra MCP Server — 200+ MCP tools for AI-powered reverse engineering. GUI plugi。⭐2.0k · Java |
| Topics | 逆向工程二进制分析Ghidra扩展安全研究AI工具集 |
| GitHub | https://github.com/bethington/ghidra-mcp |
| License | Apache-2.0 |
| 语言 | Java |
收录时间:2026-05-22 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端