Skip to main content

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)
  • MCP Python SDK 1.x (installed automatically; pinned <2). SDK 2.0 changed the transport contract; 2.x support is planned but not available yet.

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 /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 /bin/ls) to verify the setup.

See docs/installation.md and docs/quickstart.md for the full troubleshooting guides.

Documentation

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

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.

Metadata

Release files for mcpyghidra 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcpyghidra 0.8.0
File Size Uploaded Provenance
mcpyghidra-0.8.0.tar.gz 376.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcpyghidra 0.8.0
File Interpreter ABI Platform
mcpyghidra-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 477.4 kB

Release files / mcpyghidra-0.8.0.tar.gz

Download URL mcpyghidra-0.8.0.tar.gz
Size 376.0 kB
Tags Source
SHA-256 checksum
How to use checksums
05a4758a494412c0c4b2b74e936dc8ad8591d9a3ad39ad3bffb8bcaf97442c76
BLAKE2b-256 checksum
How to use checksums
86f3fceadfcafca754dce79ce96f1d674eb58054112bc30f89f5ef8884346954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / mcpyghidra-0.8.0-py3-none-any.whl

Download URL mcpyghidra-0.8.0-py3-none-any.whl
Size 101.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bbef25e36961a0e8f0e09299046d514d869f485742d5145d18ca093e16ba654
BLAKE2b-256 checksum
How to use checksums
4a7de2ddd1b5f20313c506f189e0b97772e537c5936a20a136524b5f4e226f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Security for mcpyghidra 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcpyghidra-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page