references/workflow.md
GitHubLaurieWired/GhidraMCP Workflow Reference
Architecture
LaurieWired/GhidraMCP has two parts:
- Ghidra plugin/extension: runs inside Ghidra and exposes an HTTP server, default
http://127.0.0.1:8080/. - Python MCP bridge:
bridge_mcp_ghidra.py, which exposes MCP tools and forwards requests to the Ghidra HTTP server.
Default Codex stdio configuration:
[mcp_servers.ghidra]
command = "python3"
args = [
"/ABSOLUTE_PATH_TO/GhidraMCP/bridge_mcp_ghidra.py",
"--ghidra-server",
"http://127.0.0.1:8080/"
]
Optional SSE bridge mode, useful for clients that consume remote MCP/SSE endpoints:
python3 bridge_mcp_ghidra.py --transport sse --mcp-host 127.0.0.1 --mcp-port 8081 --ghidra-server http://127.0.0.1:8080/
Tool recipes
UI-selected function triage
get_current_functionget_current_addressdecompile_function_by_address(<current address>)get_xrefs_to(<current address>)disassemble_function(<current address>)if decompilation is unclear
String-to-code workflow
list_strings(filter="keyword")- Pick string address.
get_xrefs_to(<string address>)get_function_by_address(<xref address>)decompile_function_by_address(<function address>)- Rename/comment once behavior is confirmed.
Import-to-sink workflow
list_imports(offset=0, limit=...)- Identify suspicious API/import.
get_xrefs_to(<import thunk/address>)when an address is available.- Decompile caller functions and trace argument sources.
- Use comments to mark source/validation/sink boundaries.
Function search workflow
search_functions_by_name("query")decompile_function("matched_name")get_function_xrefs("matched_name")- Rename by address if the original symbol is unstable or duplicated.
Annotation guidance
- Prefer address-based mutation tools when possible:
rename_function_by_address,set_function_prototype,set_local_variable_type. - Use
rename_functiononly when the old name is unique and stable. - Add a comment before or with a rename when the behavior is non-obvious.
- For type changes, record the evidence: call signature, field offset pattern, imported API contract, or observed constants.
Output template
## GhidraMCP Analysis Notes
Target: <program/binary>
Ghidra server: <host:port>
Objective: <question>
### Findings
- `<function/address>`: <confirmed behavior and evidence>
### Evidence table
| Address | Function | Evidence | Action taken | Confidence |
|---|---|---|---|---|
### Annotations applied
- `<address>`: renamed/commented/typed as `<value>` because <reason>
### Open questions
- <unknowns>
### Next steps
- <focused follow-up>