Ghidra MCP Analysis
Implementation target
This skill assumes the Ghidra MCP implementation is LaurieWired/GhidraMCP. It uses:
- a Ghidra extension/plugin that exposes a local HTTP server from Ghidra, defaulting to
http://127.0.0.1:8080/
bridge_mcp_ghidra.py, a Python MCP bridge that talks to the Ghidra-side HTTP server
- stdio transport by default for Codex MCP, with optional SSE mode for clients that need it
Setup checklist
- Install Ghidra and Python 3.
- Download a LaurieWired/GhidraMCP release ZIP.
- In Ghidra:
File -> Install Extensions -> + -> select the GhidraMCP-*.zip release.
- Restart Ghidra.
- Enable
GhidraMCPPlugin in File -> Configure -> Developer.
- Optionally configure the Ghidra-side HTTP port with
Edit -> Tool Options -> GhidraMCP HTTP Server.
- Configure Codex to run the bridge:
[mcp_servers.ghidra]
command = "python3"
args = [
"/ABSOLUTE_PATH_TO/GhidraMCP/bridge_mcp_ghidra.py",
"--ghidra-server",
"http://127.0.0.1:8080/"
]
Restart Codex and verify the ghidra MCP server is visible under /mcp before using live analysis.
Available LaurieWired/GhidraMCP capabilities
Use these capabilities by their MCP tool names when available:
| Capability |
Tool(s) |
| Current context |
get_current_address, get_current_function, get_function_by_address |
| Function listing/search |
list_methods, list_functions, search_functions_by_name |
| Classes/namespaces |
list_classes, list_namespaces |
| Decompilation/disassembly |
decompile_function, decompile_function_by_address, disassemble_function |
| Imports/exports/segments/data |
list_imports, list_exports, list_segments, list_data_items |
| Strings |
list_strings with optional filter |
| Xrefs |
get_xrefs_to, get_xrefs_from, get_function_xrefs |
| Renaming |
rename_function, rename_function_by_address, rename_data, rename_variable |
| Comments |
set_decompiler_comment, set_disassembly_comment |
| Types/prototypes |
set_function_prototype, set_local_variable_type |
Recommended workflow
Orient
- Confirm Ghidra has the target program open and analyzed.
- Use
get_current_function / get_current_address when the user points at something in the UI.
- Use
list_segments, list_imports, list_exports, and filtered list_strings for initial context.
Survey efficiently
- Prefer
search_functions_by_name and list_strings(filter=...) over dumping everything.
- Use pagination (
offset, limit) for list_methods, list_classes, list_imports, list_exports, list_data_items, and list_strings.
Analyze functions
- Use
decompile_function_by_address when an address is known.
- Use
decompile_function when a stable symbol/function name is known.
- Use
disassemble_function when decompiler output is ambiguous, optimized out, or missing low-level details.
Trace relationships
- Use
get_xrefs_to / get_xrefs_from for address-oriented tracing.
- Use
get_function_xrefs for function-name-oriented tracing.
- Build source -> transform -> sink chains with exact addresses and function names.
Annotate only with evidence
- Use
rename_function_by_address or rename_function when behavior is confirmed.
- Use
rename_variable, rename_data, set_function_prototype, and set_local_variable_type incrementally.
- Use
set_decompiler_comment or set_disassembly_comment to record reasoning at important addresses.
Report
- Include addresses, original names, new names/comments/types applied, decompiler/disassembly evidence, xref paths, and confidence.
- Separate confirmed behavior from hypotheses.
Reference loading
Read references/workflow.md for LaurieWired/GhidraMCP transport details, tool recipes, and output templates.
1---2name: ghidra-mcp-analysis3description: Use for reverse engineering and binary analysis with LaurieWired/GhidraMCP. Trigger for Ghidra MCP setup, bridge_mcp_ghidra.py usage, GhidraMCP plugin workflows, decompilation, function/string/import/export/xref analysis, renaming functions/data/variables, setting comments/types/prototypes, or producing Ghidra-backed RE notes.4---56# Ghidra MCP Analysis78## Implementation target910This skill assumes the Ghidra MCP implementation is **LaurieWired/GhidraMCP**. It uses:1112- a Ghidra extension/plugin that exposes a local HTTP server from Ghidra, defaulting to `http://127.0.0.1:8080/`13- `bridge_mcp_ghidra.py`, a Python MCP bridge that talks to the Ghidra-side HTTP server14- stdio transport by default for Codex MCP, with optional SSE mode for clients that need it1516## Setup checklist17181. Install Ghidra and Python 3.192. Download a LaurieWired/GhidraMCP release ZIP.203. In Ghidra: `File` -> `Install Extensions` -> `+` -> select the `GhidraMCP-*.zip` release.214. Restart Ghidra.225. Enable `GhidraMCPPlugin` in `File` -> `Configure` -> `Developer`.236. Optionally configure the Ghidra-side HTTP port with `Edit` -> `Tool Options` -> `GhidraMCP HTTP Server`.247. Configure Codex to run the bridge:2526```toml27[mcp_servers.ghidra]28command = "python3"29args = [30 "/ABSOLUTE_PATH_TO/GhidraMCP/bridge_mcp_ghidra.py",31 "--ghidra-server",32 "http://127.0.0.1:8080/"33]34```3536Restart Codex and verify the `ghidra` MCP server is visible under `/mcp` before using live analysis.3738## Available LaurieWired/GhidraMCP capabilities3940Use these capabilities by their MCP tool names when available:4142| Capability | Tool(s) |43|---|---|44| Current context | `get_current_address`, `get_current_function`, `get_function_by_address` |45| Function listing/search | `list_methods`, `list_functions`, `search_functions_by_name` |46| Classes/namespaces | `list_classes`, `list_namespaces` |47| Decompilation/disassembly | `decompile_function`, `decompile_function_by_address`, `disassemble_function` |48| Imports/exports/segments/data | `list_imports`, `list_exports`, `list_segments`, `list_data_items` |49| Strings | `list_strings` with optional `filter` |50| Xrefs | `get_xrefs_to`, `get_xrefs_from`, `get_function_xrefs` |51| Renaming | `rename_function`, `rename_function_by_address`, `rename_data`, `rename_variable` |52| Comments | `set_decompiler_comment`, `set_disassembly_comment` |53| Types/prototypes | `set_function_prototype`, `set_local_variable_type` |5455## Recommended workflow56571. **Orient**58 - Confirm Ghidra has the target program open and analyzed.59 - Use `get_current_function` / `get_current_address` when the user points at something in the UI.60 - Use `list_segments`, `list_imports`, `list_exports`, and filtered `list_strings` for initial context.61622. **Survey efficiently**63 - Prefer `search_functions_by_name` and `list_strings(filter=...)` over dumping everything.64 - Use pagination (`offset`, `limit`) for `list_methods`, `list_classes`, `list_imports`, `list_exports`, `list_data_items`, and `list_strings`.65663. **Analyze functions**67 - Use `decompile_function_by_address` when an address is known.68 - Use `decompile_function` when a stable symbol/function name is known.69 - Use `disassemble_function` when decompiler output is ambiguous, optimized out, or missing low-level details.70714. **Trace relationships**72 - Use `get_xrefs_to` / `get_xrefs_from` for address-oriented tracing.73 - Use `get_function_xrefs` for function-name-oriented tracing.74 - Build source -> transform -> sink chains with exact addresses and function names.75765. **Annotate only with evidence**77 - Use `rename_function_by_address` or `rename_function` when behavior is confirmed.78 - Use `rename_variable`, `rename_data`, `set_function_prototype`, and `set_local_variable_type` incrementally.79 - Use `set_decompiler_comment` or `set_disassembly_comment` to record reasoning at important addresses.80816. **Report**82 - Include addresses, original names, new names/comments/types applied, decompiler/disassembly evidence, xref paths, and confidence.83 - Separate confirmed behavior from hypotheses.8485## Reference loading8687Read `references/workflow.md` for LaurieWired/GhidraMCP transport details, tool recipes, and output templates.