A Ghidra plugin that provides an HTTP server to expose program data, along with an MCP (Model Context Protocol) server for AI assistants to interact with Ghidra.
- List and search functions, classes, segments, imports, exports, namespaces, and data
- Decompile functions by name or address
- Rename functions, data labels, and variables
- Get function references (xrefs)
- Set comments and function prototypes
- List strings in the binary
- List Structs: List all structs in the program with pagination
- Get Struct Details: Get detailed information about a specific struct including fields, sizes, and offsets
- Create Struct: Create new structs with custom fields
- Rename Struct: Rename existing structs
- Add Struct Field: Add new fields to existing structs
- Remove Struct Field: Remove fields from existing structs
- Auto-analyze Structs: Automatically analyze the binary to identify potential struct patterns
- Build the Java plugin using Maven:
mvn clean package - Install the generated
.jarfile in Ghidra's plugin directory - Enable the plugin in Ghidra
- Configure the HTTP server port in Tool Options
- Install dependencies:
pip install -r requirements.txt - Run the MCP server:
python bridge_mcp_ghidra.py
# List first 50 structs
list_structs(offset=0, limit=50)# Get detailed information about a specific struct
get_struct("MyStruct")# Create a struct with fields
create_struct("Person", "int id,char name,float age")# Rename an existing struct
rename_struct("OldName", "NewName")# Add a field at the end
add_struct_field("MyStruct", "newField", "int")
# Add a field at specific offset
add_struct_field("MyStruct", "newField", "int", "16")# Remove a field
remove_struct_field("MyStruct", "oldField")# Analyze binary for struct patterns
auto_analyze_structs()The Ghidra plugin exposes the following HTTP endpoints:
GET /list_structs?offset=X&limit=Y- List structs with paginationGET /get_struct?name=NAME- Get struct detailsPOST /create_struct- Create new structPOST /rename_struct- Rename structPOST /add_struct_field- Add field to structPOST /remove_struct_field- Remove field from structGET /auto_analyze_structs- Auto-analyze structs
The plugin can be configured through Ghidra's Tool Options:
- Server Port: The HTTP server port (default: 8080)
mvn clean package[License details here]
