Triangr turns a binary into an agent-ready reverse engineering workbench.
Use it to analyze executables and smart contracts in depth, providing tools that keep AI agents from wasting tokens and presenting unsubtantiated guesses.
This is the maintained, hardened, feature-extended fork of
LaurieWired/GhidraMCP.
Ghidra keeps the project context, angr answers program-analysis questions,
and MCP lets AI tools drive the workflow.
Your agents can inspect binary, compare Ghidra & Oxidizer decompilation, trace how to reach a branch, solve constraints at an address, lift blocks to VEX or AIL, summarize CFGs and callgraphs, rename functions and variables, edit structures, annotate paths, and patch bytes from the same MCP bridge.
Since structures, function and variable names, and annotations are made directly into Ghidra projects, knowledge about the binary grows from one run to the next. Triangr works with the Ghidra GUI or fully headless, with no GUI running.
This fork preserves credit for the original work, design, and naming by LaurieWired. New endpoints, hardening, and incorporated pull requests are listed in CHANGELOG.md.
Install Triangr and its local toolchain:
git clone https://github.com/rustopian/Triangr.git triangr
cd triangr
./scripts/install.sh --install-deps --yesStart Ghidra and enable the plugin:
source ~/.local/share/triangr/env.sh
"$GHIDRA_HOME/ghidraRun"Create or open a Ghidra project, import a binary, and open it for analysis.
When the main analysis window appears, enable Triangr under File ->
Configure -> Developer. The plugin starts a localhost HTTP server at
http://127.0.0.1:8080/; verify it with:
curl http://127.0.0.1:8080/healthAdd the MCP server to your AI tool's MCP JSON config, using the wrapper written by the installer:
{
"mcpServers": {
"triangr": {
"command": "/ABSOLUTE/PATH/TO/.local/share/triangr/bin/triangr-mcp",
"args": [
"--ghidra-server",
"http://127.0.0.1:8080/"
]
}
}
}Or skip the GUI and let Triangr import and analyze the binary itself (see Headless Mode):
{
"mcpServers": {
"triangr": {
"command": "/ABSOLUTE/PATH/TO/.local/share/triangr/bin/triangr-mcp",
"args": ["--headless", "--binary", "/path/to/target", "--project", "/path/to/projects"]
}
}
}Sample supported tasks:
- "Summarize the loaded binary and list all entrypoints, public and hidden."
- "Decompile auth check functions in Ghidra and Oxidizer and make a Rust prototype."
- "Find paths that can reach this address and explain the constraints."
- "Make the code more readable analyzing and naming the 10 most common structures."
Triangr works with Claude Code, Codex, Claude Desktop, VS Code, Cline, 5ire, and other MCP-capable AI tools.
Ghidra tools return structured JSON: list tools are paginated (offset/limit,
check has_more), and failures are MCP tool errors with a stable code such as
[FUNCTION_NOT_FOUND] or [AMBIGUOUS_NAME]. Addresses are hex strings, with or
without 0x.
Triangr exposes the Ghidra project as structured AI tool context:
- Identify the program (format, language, compiler, image base, entry points, hashes), and list or filter functions, classes, namespaces, segments, imports, exports, strings, data, and xrefs.
- Walk the call graph one level at a time with callers and callees, including indirect calls through pointers.
- Decompile and disassemble by function or address, including async decompilation with task polling and configurable timeouts for large functions.
- Rename functions, data, and local variables, set function prototypes, set local variable types, and preserve first-attempt variable rename reliability.
- Create, list, inspect, and edit structures, and apply them as variable types, using Ghidra's built-in data type parser for complex C-style type expressions.
- Read memory (with unmapped gaps marked) or raw bytes, write bytes, create functions, and force re-disassembly after code patches.
- Read and set disassembly and decompiler comments, including preview-token guarded overwrite flows so agents see the current comment and pending replacement before applying destructive annotation writes.
- Check backend health, mode, uptime, and activity during long analysis sessions.
angr gives the bridge executable reasoning beyond static project inspection:
- Decompile functions through angr's Oxidizer decompiler and compare Oxidizer output against Ghidra decompiler output.
- Find symbolic paths to a target address, optionally avoiding addresses.
- Add JSON-described constraints at a found state and evaluate requested values.
- Check static reachability between addresses.
- Recover and summarize CFG and callgraph structure.
- Lift blocks to VEX or AIL for lower-level IR inspection.
- Use p-code support for targets such as eBPF, including Ghidra language inference when available.
- Use AngryGhidra when installed for compatible symbolic execution workflows, while falling back to the core angr helper when appropriate.
The angr tools need the optional angr extra (Python 3.12+), which the
installer includes.
triangr-mcp --headless (or ghidra-mcp --headless) imports and analyzes a
binary with PyGhidra, with no Ghidra GUI
running, and serves it through the same tools. GUI-only tools such as
get_current_address are hidden in this mode.
~/.local/share/triangr/bin/triangr-mcp --headless --binary /path/to/target --project ~/triangr-projects--project DIRkeeps the Ghidra project between runs and saves changes on exit. Without it, a temporary project is used and changes are discarded.--no-analyze,--language, and--compilercontrol import and analysis;--extension-jaruses a specificGhidraMCP.jarinstead of the installed extension.- Headless mode needs Python 3.10–3.13, the
headlessextra (installed by the installer), the Triangr extension installed in Ghidra, andGHIDRA_INSTALL_DIR(set by the installer'senv.sh). - On macOS, build Ghidra's decompiler once with
support/gradle/gradlew buildNativesfrom the Ghidra directory if your Ghidra build has no native decompiler for your platform.
The installer supports Linux, WSL2, and macOS. It can install common packages when a supported package manager is available:
- Linux:
apt,dnf, orpacman - macOS: Homebrew
- WSL2: Linux package managers, with WSLg or another X server for the Ghidra GUI
If you skip package-manager installation, install these yourself first:
Python 3.10+ (3.12+ for angr), git, curl or wget, unzip, and JDK 21. For
Ghidra extension builds, the installer uses a Gradle version Ghidra supports,
downloading it when needed, and runs it on JDK 21.
git clone https://github.com/rustopian/Triangr.git triangr
cd triangr
./scripts/install.shFor a non-interactive install that also attempts system dependencies:
./scripts/install.sh --install-deps --yesUseful options:
./scripts/install.sh --help
./scripts/install.sh --prefix ~/.local/share/triangr
./scripts/install.sh --no-angryghidra
./scripts/install.sh --no-extensionThe script defaults to user-owned paths under ~/.local/share/triangr and can
be re-run safely. It:
- Detects Linux, WSL2, or macOS.
- Prompts before using a package manager unless
--install-depsor--yesis supplied. - Downloads Ghidra 12.0.4 by default.
- Creates a dedicated Python virtual environment.
- Installs the bridge runtime dependencies, including angr/Oxidizer and PyGhidra.
- Installs the current checkout into that environment.
- Builds the Triangr Ghidra extension with Gradle, otherwise falls back to a release asset built for the same Ghidra version.
- Installs the extension into the downloaded Ghidra tree.
- Moves any existing extension folder aside with a
.old.<timestamp>suffix before replacing it. - Clones AngryGhidra when requested and builds it with a Ghidra-compatible Gradle, downloading that Gradle when needed.
- Writes
env.shwithGHIDRA_HOME,GHIDRA_INSTALL_DIR,GHIDRA_MCP_ANGR_PYTHON,ANGRYGHIDRA_HOME,ANGRYGHIDRA_SCRIPT, and related paths. - Writes
bin/triangr-mcp, a wrapper suitable for MCP client configs.
The script does not edit Claude, Codex, Cline, or other MCP client configs.
After installation:
source ~/.local/share/triangr/env.sh
ghidra-mcp --help
~/.local/share/triangr/bin/triangr-mcp --help
python -c "import angr; print(angr.__version__)"
"$GHIDRA_HOME/ghidraRun"In Ghidra:
- Restart Ghidra if it was already open.
- Create or open a project, import a binary, and open it for analysis.
- Enable the Triangr plugin under
File->Configure->Developer. - Optional: enable AngryGhidra under
File->Configure->Miscellaneous. - Check the bridge:
curl http://127.0.0.1:8080/healthDownload the latest release from this repository. It contains the Ghidra plugin and Python MCP client.
- Run Ghidra.
- Select
File->Install Extensions. - Click the
+button. - Select the
ghidra_<version>_PUBLIC_<date>_GhidraMCP.zipextension archive that matches your Ghidra version. TheGhidraMCPname is retained for compatibility with existing installs. - Restart Ghidra.
- Create or open a project, import a binary, and open it for analysis.
- Make sure the Triangr plugin is enabled in
File->Configure->Developer. - Optional: configure host and port under
Edit->Tool Options->Triangr HTTP Server. A host other than127.0.0.1exposes the program to the network without authentication.
The Python MCP client can be installed from this repository:
pipx install "ghidramcp[angr,headless] @ git+https://github.com/rustopian/Triangr.git"
uv tool install "ghidramcp[angr,headless] @ git+https://github.com/rustopian/Triangr.git"Both install the ghidra-mcp command and the bridge_mcp_ghidra alias. Drop
the extras you do not need.
Or directly from a checkout:
python3 -m venv .venv
.venv/bin/python -m pip install -e ".[angr,headless]"Any MCP client should work with Triangr. If you used the installer, prefer the
generated wrapper at ~/.local/share/triangr/bin/triangr-mcp. It loads the
right angr, AngryGhidra, and Ghidra environment automatically. The server IP and
port default to 127.0.0.1:8080 and should point at the target Ghidra instance.
Go to Claude -> Settings -> Developer -> Edit Config ->
claude_desktop_config.json and add:
{
"mcpServers": {
"triangr": {
"command": "/Users/YOUR_USER/.local/share/triangr/bin/triangr-mcp",
"args": [
"--ghidra-server",
"http://127.0.0.1:8080/"
]
}
}
}If you are running from a checkout rather than an installed console script, use:
{
"mcpServers": {
"triangr": {
"command": "python",
"args": [
"/ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py",
"--ghidra-server",
"http://127.0.0.1:8080/"
]
}
}
}claude mcp add triangr -- ~/.local/share/triangr/bin/triangr-mcp --ghidra-server http://127.0.0.1:8080/Run MCP: Add Server from the Command Palette, or add the following to
.vscode/mcp.json in your workspace:
{
"servers": {
"triangr": {
"type": "stdio",
"command": "/Users/YOUR_USER/.local/share/triangr/bin/triangr-mcp",
"args": ["--ghidra-server", "http://127.0.0.1:8080/"]
}
}
}Run the MCP server over Streamable HTTP:
~/.local/share/triangr/bin/triangr-mcp --transport streamable-http --mcp-host 127.0.0.1 --mcp-port 8081 --ghidra-server http://127.0.0.1:8080/Then add http://127.0.0.1:8081/mcp as a remote server in your client (in Cline:
Server Name Triangr, Server URL http://127.0.0.1:8081/mcp). The older
--transport sse (URL http://127.0.0.1:8081/sse) still works but is
deprecated.
Open 5ire and go to Tools -> New:
- Tool Key:
triangr - Name:
Triangr - Command:
/Users/YOUR_USER/.local/share/triangr/bin/triangr-mcp
Use python /ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py instead if running from a
checkout.
- Set
GHIDRA_INSTALL_DIRto your Ghidra directory (12.0.4 and 12.1.4 are tested). - Build the extension with Gradle on JDK 21:
cd extension && "$GHIDRA_INSTALL_DIR/support/gradle/gradlew" buildExtensionThe generated zip in extension/dist/ includes the built Ghidra plugin and the
resources Ghidra needs to recognize the extension:
lib/GhidraMCP.jar, retained as the compatibility artifact nameextension.propertiesModule.manifest
The Python MCP server runs from a checkout with uv run ghidra-mcp and is tested
with uv run pytest. With GHIDRA_INSTALL_DIR set and the extension built,
uv run --extra headless pytest also runs the end-to-end tests against a real
headless Ghidra.
extension/: the Ghidra extension.core/holds the GUI-independent analysis services,http/the local backend server, andgui/andheadless/the two ways a program is supplied. Triangr's additions live inTriangrService,TriangrModel,TriangrRoutes, andAsyncDecompileTasks.src/ghidra_mcp/: the Python MCP server. Triangr's tools live intriangr_tools.pyandangr_tools.py;helpers/angr_decompile.pyruns inside the angr Python environment.scripts/install.sh: the installer.