← Back to Ghidra MCP Server

Install Ghidra MCP Server

Pick your client, copy the command, done.

1

Add it to Claude Code

claude mcp add -e "GHIDRA_PATH=${GHIDRA_PATH}" -e "JAVA_HOME=${JAVA_HOME}" ghidra-mcp -- python path/to/ghidra-mcp/main.py
Required:GHIDRA_PATHJAVA_HOME

Environment Variables

Set these before running Ghidra MCP Server.

VariableDescriptionRequired
GHIDRA_PATHPath to the local Ghidra installation directory.Yes
JAVA_HOMEPath to the Java 21 JDK installation.Yes

Available Tools (4)

Once configured, Ghidra MCP Server gives your AI agent access to:

analyze_functionPerforms deep analysis on a specific function including decompilation and cross-reference mapping.
function_addressdepth
rename_functionRenames a function within the Ghidra project.
addressnew_name
create_structureDefines a new data structure in the Ghidra project.
namefields
run_scriptExecutes a specified Ghidra script file.
script_pathargs

Try It Out

After setup, try these prompts with your AI agent:

Analyze the function at 0x00401000 and suggest a descriptive name based on its logic.
Find all orphaned code blocks in the current binary and list their entry points.
Create a new structure definition for the network packet header found at 0x00405000.
Run the standard function documentation workflow on the current program.
Compare the function at 0x00401000 with the same function in the previous binary version.
Alternative installation methods

Windows Setup

.\mcp4ghidra-setup.ps1

Keep this setup from going cold

Save the docs, env vars, and workflow around Ghidra MCP Server in Conare so Claude Code, Codex, and Cursor remember it next time.

Remember this setup