Ghidra MCP server.
Project description
MCPyGhidra
An MCP (Model Context Protocol) server that exposes Ghidra reverse-engineering capabilities to LLM clients. Built on pyghidra-decaf.
MCPyGhidra exposes binary analysis capabilities via MCP: decompilation, disassembly, symbol lookup, cross-references, type inspection, binary patching, and scriptable analysis.
Related project: If you use IDA Pro rather than Ghidra, see MCPyIDA for an equivalent MCP server for IDA Pro.
Prerequisites
- Ghidra a recent release (tested with Ghidra 11.x+; download)
- Java a compatible JDK (bundled with Ghidra)
- Python 3.10–3.13
- pyghidra-decaf (installed via PyPI alongside mcpyghidra)
Installation
pip install mcpyghidra
Then configure your Ghidra installation:
export GHIDRA_INSTALL_DIR=/path/to/ghidra_12.0_PUBLIC
For detailed setup, see docs/installation.md.
Quick Start
Headless Mode
Launch the MCP server in headless mode for non-interactive analysis:
export GHIDRA_INSTALL_DIR=/path/to/ghidra
mcpyghidra-headless --binary /path/to/firmware.elf
The server prints a JSON readiness signal to stdout:
{"status": "ready", "host": "127.0.0.1", "port": 6050, "binary": "/path/to/firmware.elf"}
Then configure your MCP client to connect to http://127.0.0.1:6050/mcp.
With an MCP Client
Point any MCP-compatible client at the running server:
{
"mcpServers": {
"ghidra": {
"type": "streamable-http",
"url": "http://127.0.0.1:6050/mcp"
}
}
}
See docs/mcp-client-config.md for client-specific examples.
What's Exposed
MCPyGhidra exposes 26 tools organized into categories:
- Listing & context: list entries, inspect binary metadata, resolve functions
- Analysis: decompile, disassemble, cross-references, control-flow graphs
- Types: type enumeration and detailed inspection
- Modification: rename symbols, update variables, set comments, patch instructions
- Scripting: Python code execution with back-to-client RPC callbacks
- Search: binary pattern and instruction sequence matching
See docs/tools-reference.md for full details.
Troubleshooting
GHIDRA_INSTALL_DIR not set— point it at your Ghidra install:export GHIDRA_INSTALL_DIR=/path/to/ghidra_12.0_PUBLIC.- Client can't connect — confirm the server is running and reachable at the Streamable HTTP endpoint
http://127.0.0.1:6050/mcp. - Server startup hangs — analyzing large binaries can take minutes; try a small binary (e.g.
mcpyghidra-headless --binary /bin/ls) to verify the setup.
See docs/installation.md and docs/quickstart.md for the full troubleshooting guides.
Documentation
- Installation & Setup
- Quickstart Guide
- Connecting MCP Clients
- Tools Reference
- Running Modes (Headless & GUI)
- RPC Callbacks (Advanced)
- Documentation Hub
Development
This project uses uv for environment and package management.
Setup
curl -sSf https://astral.sh/uv/install.sh | bash
git clone https://github.com/nightwing-us/mcpyghidra.git
cd mcpyghidra
uv venv
uv pip install -e ".[dev]"
Testing
uv run pytest --tb=short
Type Checking
uv run mypy
Linting
uv run ruff check src tests
uv run ruff format src tests
Related Projects
MCPyGhidra and MCPyIDA are maintained in parallel as sister projects with intended feature parity — MCPyGhidra targets Ghidra and MCPyIDA targets IDA Pro.
- MCPyIDA — equivalent MCP server for IDA Pro
- pyghidra-decaf — Python-native Ghidra plugin development framework (underpins MCPyGhidra)
License
Apache-2.0 — see LICENSE for details.
Copyright © 2026 Nightwing Group, LLC.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpyghidra-0.6.0.tar.gz.
File metadata
- Download URL: mcpyghidra-0.6.0.tar.gz
- Upload date:
- Size: 333.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a2cdbe79502c56a0e138d03be2d7861d5faecf9439a8c6f2ec1042c7ccf2902
|
|
| MD5 |
494381d8add87c0b847f7bd2e625f8d2
|
|
| BLAKE2b-256 |
e045c9390a3c3f62d763cb7efc65b44831eff4707f42ed00968ea6a2402cc218
|
Provenance
The following attestation bundles were made for mcpyghidra-0.6.0.tar.gz:
Publisher:
release.yml on nightwing-us/mcpyghidra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpyghidra-0.6.0.tar.gz -
Subject digest:
4a2cdbe79502c56a0e138d03be2d7861d5faecf9439a8c6f2ec1042c7ccf2902 - Sigstore transparency entry: 1660282713
- Sigstore integration time:
-
Permalink:
nightwing-us/mcpyghidra@bdeec6f4b7284375f8ccf654f680d89f413dc73d -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/nightwing-us
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bdeec6f4b7284375f8ccf654f680d89f413dc73d -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcpyghidra-0.6.0-py3-none-any.whl.
File metadata
- Download URL: mcpyghidra-0.6.0-py3-none-any.whl
- Upload date:
- Size: 86.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70e3f25987b9548f46402839726923255b7cfd6d5c525cf4f507421a0aa94fe9
|
|
| MD5 |
4c14b4fcbbc98193413f40796eb21a25
|
|
| BLAKE2b-256 |
53d29295d9e67808b1770e53d1129d0bd54ab3df45ffef82bbbbf094f2f19a34
|
Provenance
The following attestation bundles were made for mcpyghidra-0.6.0-py3-none-any.whl:
Publisher:
release.yml on nightwing-us/mcpyghidra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpyghidra-0.6.0-py3-none-any.whl -
Subject digest:
70e3f25987b9548f46402839726923255b7cfd6d5c525cf4f507421a0aa94fe9 - Sigstore transparency entry: 1660282817
- Sigstore integration time:
-
Permalink:
nightwing-us/mcpyghidra@bdeec6f4b7284375f8ccf654f680d89f413dc73d -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/nightwing-us
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bdeec6f4b7284375f8ccf654f680d89f413dc73d -
Trigger Event:
push
-
Statement type: