# 13bm/GhidraMCP [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/13bm/GhidraMCP  
**GitHub Stars:** 137  
**Views:** 11  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/13bm-ghidramcp

## Description
MCP server for integrating Ghidra with AI assistants. This plugin enables binary analysis, providing tools for function inspection, decompilation, memory exploration, and import/export analysis via the Model Context Protocol.

## Tools
Capabilities this server exposes over MCP:

- **list_functions** — List all functions with entry points, sizes, return types
- **list_classes** — List all classes / namespaces
- **list_imports** — List imported symbols and external dependencies
- **list_exports** — List exported symbols
- **list_namespaces** — List all namespaces
- **list_data_items** — List defined data (globals, constants, arrays, structs)
- **list_strings** — List strings with optional substring filter
- **search_functions_by_name** — Search functions by name substring
- **get_function_by_address** — Detailed info for a function at an address
- **get_current_address** — Address currently selected in Ghidra
- **get_current_function** — Function at the current cursor position
- **decompile_function** — Decompile by name to C pseudocode
- **decompile_function_by_address** — Decompile by address to C pseudocode
- **disassemble_function** — Raw disassembly listing for a function
- **get_xrefs_to** — Cross-references TO an address
- **get_xrefs_from** — Cross-references FROM an address
- **get_function_xrefs** — All xrefs (callers + callees) for a function
- **get_program_info** — Program metadata (arch, compiler, format, etc.)
- **get_memory_map** — Memory layout with segment permissions
- **get_variables** — Parameters and locals for a function
- **rename_function** — Rename a function by name
- **rename_function_by_address** — Rename a function by address
- **rename_data** — Rename a data label
- **rename_variable** — Rename a local variable
- **set_decompiler_comment** — Set a decompiler-view comment
- **set_disassembly_comment** — Set a disassembly-view comment
- **set_function_prototype** — Set full function prototype
- **set_local_variable_type** — Change a variable's data type
- **set_bookmark** — Add a bookmark
- **remove_bookmark** — Remove a bookmark
- **set_equate** — Set a named constant on a scalar operand
- **create_structure** — Create a structure data type
- **create_enum** — Create an enum data type
- **apply_data_type** — Apply a data type at an address
- **set_namespace** — Set namespace or class for a function
- **set_calling_convention** — Set calling convention for a function
- **set_image_base** — Set the image base address
- **set_memory_permissions** — Modify memory block permissions
- **patch_bytes** — Patch raw bytes at an address
- **get_basic_blocks** — Get basic blocks for a function
- **extract_api_call_sequences** — Extract API call sequences for security analysis
- **identify_user_input_sources** — Find user-input entry points
- **generate_call_graph** — Hierarchical call graph
- **identify_crypto_patterns** — Detect crypto implementations
- **find_obfuscated_strings** — Locate obfuscated strings
- **search_bytes** — Search for byte patterns
- **emulate_function** — Emulate a function
- **extract_iocs** — Extract indicators of compromise
- **find_dynamic_api_resolution** — Detect dynamic API resolution
- **detect_anti_analysis** — Detect anti-analysis techniques
- **add_external_function** — Add an external function reference
- **get_pe_info** — PE header details
- **get_elf_info** — ELF header details
- **create_memory_block** — Create a memory block
- **detect_security_mitigations** — Detect binary security mitigations
- **find_format_string_vulns** — Find format-string vulnerabilities
- **find_rop_gadgets** — Find ROP gadgets
- **detect_control_flow_flattening** — Detect control-flow flattening
- **mark_code_coverage** — Mark code coverage regions
- **get_bookmarks** — List bookmarks (optionally by address)
- **list_equates** — List all equates
- **ping** — Health-check the connection
- **list_ghidra_instances** — Scan ports 8765-8774 for running Ghidra instances
- **get_structure** — Get full details of a structure (fields, offsets, types)
- **list_structures** — List all defined structures with pagination
- **edit_structure** — Add, insert, delete, replace, or clear fields in a structure
- **rename_structure** — Rename an existing structure
- **delete_structure** — Delete a structure data type
- **decompile_function_async** — Start async decompilation of a large function (returns task ID)
- **get_decompile_result** — Poll for an async decompilation result by task ID

## Claude Desktop Quick Installation
Heuristic fallback — verify the package name and runner against the repository README before running it. Uses `npx` (confidence: low):

```json
"mcpServers": {
  "ghidramcp": {
    "command": "npx",
    "args": ["-y","13bm-ghidramcp"]
  }
}
```

## Documentation

## What 13bm/GhidraMCP MCP server does

13bm/GhidraMCP MCP server brings Ghidra’s program analysis features into MCP-compatible AI clients. After a binary is open in Ghidra and the extension is enabled, an assistant can inspect the program and request structured information about functions, classes, namespaces, imports, exports, strings, data items, memory regions, variables, and executable metadata.

The server also exposes operations that change the Ghidra project. These include renaming functions, data labels, variables, and structures; adding or removing bookmarks; changing prototypes and local variable types; setting comments; applying data types; editing memory permissions; patching bytes; and managing structures, enums, namespaces, and calling conventions. These mutation tools can alter the active analysis, so they should be used with the expected Ghidra project state in mind.

## How it works

The integration has two parts: a Java plugin running inside Ghidra and a Go bridge process used by the MCP client. The plugin starts a TCP listener inside Ghidra and can launch the bridge automatically. The bridge communicates with the AI client over MCP and stdio, then forwards requests to the plugin over a local TCP socket using length-prefixed JSON-RPC messages.

13bm/GhidraMCP MCP server can route requests to different Ghidra windows with the optional `target_port` parameter. It also supports reconnecting after a dropped connection or Ghidra restart. Large result sets can be retrieved incrementally with `offset` and `limit`, while long-running decompilation jobs can be started asynchronously and checked later using a task ID.

## Setup and configuration

Download the release ZIP, install it through Ghidra’s extension installer, and restart Ghidra. Open a project and program, then enable `MCPServerPlugin` under Ghidra’s configuration menu. The plugin starts its TCP service on `localhost:8765` by default and launches the bridge.

Claude Desktop configuration can be written from the Ghidra MCP settings menu. Other MCP clients can use the generated bridge command and pass the local host and port as arguments. Configuration is controlled through `GhidraMCP.properties`, including the port, localhost-only binding, API-key authentication, automatic startup, and whether the bridge is enabled. If authentication is configured, the client receives `GHIDRA_API_KEY` in its environment configuration.

The documented prerequisites are Ghidra 12.0.3 or newer, Java 21 or newer, and an MCP-compatible AI client. Release bridge binaries are provided for Linux x86_64, Windows x86_64, macOS x86_64, and macOS ARM64.

## Tools and capabilities

13bm/GhidraMCP MCP server groups its tools across several analysis areas:

- Query program structure, functions, symbols, strings, memory maps, variables, imports, exports, and cross-references.
- Decompile functions by name or address, inspect raw disassembly, and retrieve the current cursor address or function.
- Analyze basic blocks, call graphs, API call sequences, crypto patterns, obfuscated strings, input sources, and security mitigations.
- Support malware and binary triage with byte searches, emulation, IOC extraction, PE and ELF metadata, anti-analysis checks, and dynamic API-resolution detection.
- Inspect embedded-security concerns such as format-string vulnerabilities, ROP gadgets, control-flow flattening, and code coverage regions.
- Edit analysis results, manage structures, and run asynchronous decompilation for large functions.

## Limitations and notes

The material describes a local Ghidra-based setup rather than a hosted analysis service. A program must be open in Ghidra for the plugin to operate, and the MCP client must be configured to reach the bridge. The default TCP endpoint is local, but the project provides settings for binding and authentication.

Results and edits depend on the active Ghidra instance and program. Multiple instances are supported through port routing, with instance discovery scanning ports 8765 through 8774. Large or slow decompilations may need the asynchronous tools instead of a blocking request.

_Full upstream README: https://allmcps.com/mcp/13bm-ghidramcp/readme_

