ghidra-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ghidra-mcp
Give your AI agent a reverse engineer's toolkit. Load binaries, decompile functions, trace call graphs, search byte patterns, and annotate symbols -- all through the Model Context Protocol.
Why ghidra-mcp?
Headless -- no Ghidra GUI required. Runs on servers, CI pipelines, containers, anywhere.
Direct JVM access -- PyGhidra launches the JVM in-process. No HTTP bridges, no plugins to install, no multi-process coordination.
Simple setup --
pip install, set one env var, run. Three commands to working tools.22 tools covering the full RE workflow: session management, function analysis, data discovery, and annotations.
Related MCP server: GhidraMCP
Quick Start
# 1. Install dependencies (into your PyGhidra environment)
pip install pyghidra "mcp>=1.2.0,<2" "pydantic>=2.0"
# 2. Clone
git clone https://github.com/SumTuusDeus/ghidra-mcp.git
cd ghidra-mcp
# 3. Run (stdio -- standard MCP transport)
GHIDRA_INSTALL_DIR=/opt/ghidra python -m ghidra_mcpThat's it. Your MCP client can now call 22 reverse engineering tools.
SSE transport (persistent server)
GHIDRA_INSTALL_DIR=/opt/ghidra python -m ghidra_mcp --sse
# Listening on http://127.0.0.1:18080
# Custom port
GHIDRA_INSTALL_DIR=/opt/ghidra python -m ghidra_mcp --sse --port 9090MCP client configuration
Claude Desktop / stdio:
{
"mcpServers": {
"ghidra": {
"command": "python",
"args": ["-m", "ghidra_mcp"],
"env": {
"GHIDRA_INSTALL_DIR": "/opt/ghidra"
}
}
}
}SSE-based clients:
{
"mcpServers": {
"ghidra": {
"baseUrl": "http://127.0.0.1:18080/sse"
}
}
}Architecture
Agent -> MCP client -> stdio/SSE -> ghidra_mcp -> PyGhidra -> Ghidra JVM (in-process)JVM launches once on first tool call, persists for server lifetime
One binary loaded at a time;
load_binaryswaps the active programProjects cached at
~/.ghidra-mcp/projects/for instant reloadsSynchronous Ghidra API calls (JVM is not thread-safe for Ghidra operations)
Requirements
Tools (22)
Session Management
Tool | Description |
| Load a binary for analysis. First load triggers auto-analysis (30-120s). Subsequent loads are instant (project cached). |
| Metadata: architecture, compiler, format, function count, SHA256 |
| Re-run Ghidra auto-analysis |
Function Analysis
Tool | Description |
| List functions with pagination and sorting |
| Search by name substring (case-insensitive) |
| Detailed info: signature, params, local variables, calling convention |
| Decompile to C pseudocode |
| Assembly listing for a function |
| Callers and callees with configurable depth (max 3) |
| Cross-references to/from an address |
Data & Discovery
Tool | Description |
| Defined strings with optional substring filter |
| Imported symbols and libraries |
| Exported symbols |
| Memory segments with permissions (rwx) |
| Non-global namespaces (classes, modules) |
| Hex byte pattern search with |
Annotations (persistent mutations)
Tool | Description |
| Rename a function by name or address |
| Rename a local variable within a function |
| Set a decompiler or disassembly comment at an address |
| Set a C-style type signature |
| Change a variable's data type |
| Create or modify a struct data type |
Testing
# Smoke test (loads /usr/bin/ls, decompiles a function)
GHIDRA_INSTALL_DIR=/opt/ghidra python tests/smoke_test.py
# Comprehensive test (exercises all tool categories)
GHIDRA_INSTALL_DIR=/opt/ghidra python tests/comprehensive_test.pyProject Structure
ghidra-mcp/
ghidra_mcp/
__init__.py
__main__.py # Entry point with transport selection
server.py # FastMCP server setup
core.py # JVM init, project/program management
utils.py # Pagination, address parsing, helpers
models/
inputs.py # Pydantic input models
tools/
session.py # load_binary, get_program_info, run_analysis
functions.py # list, search, get, decompile, disassemble, call_graph, xrefs
data.py # strings, imports, exports, segments, namespaces
search.py # byte pattern search
annotate.py # rename, comment, prototype, retype, struct
tests/
specs/ # Design specs (reference)
pyproject.tomlLimitations
Single binary at a time (
load_binaryswaps the active program)First load triggers full auto-analysis (30-120s for large binaries)
PyGhidra must be installed in the same Python environment
All Ghidra API calls are synchronous (JVM threading constraint)
License
Apache 2.0 -- see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables LLMs to perform binary analysis using Ghidra in headless mode, extracting functions, pseudocode, structs, and enums from binaries for interactive reverse-engineering.95-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to autonomously reverse engineer binaries using Ghidra's capabilities including decompilation, function analysis, automatic renaming, and BSim integration for function similarity matching.1AGPL 3.0
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to automate reverse engineering and binary analysis by running scripts, retrieving metadata, searching values, text, and byte sequences, and reading disassembly.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to import, disassemble, and debug binaries directly so they can perform cross-reference reasoning, rename stripped functions, and recover structure layouts during native reverse-engineering workflows. It integrates with offline ELF reconnaissance output to support symbol and struct recovery without opening the Ghidra GUI.-