Skip to main content

Crate re_ghidra_mcp_cc

Crate re_ghidra_mcp_cc 

Source
Expand description

Claude-Code-specific glue for the re-ghidra-mcp-cc plugin.

The server, its 19 tools and the Ghidra worker all live in the shared ghidra-mcp crate. What is genuinely Claude-Code-shaped lives here: reading the host’s settings file — .claude/re-ghidra-mcp-cc.local.md on Claude, .opencode/re-ghidra-mcp-opencode.local.md on OpenCode, selected by RE_GHIDRA_HOST — and the preflight the SessionStart hook reports.

Why a settings file matters more for this plugin than for most: one server is one Ghidra project. The project directory, project name and bootstrap program are per-workspace by nature, so without a settings layer every repo needs a hand-written .mcp.json that duplicates the plugin’s registration just to carry three strings.

Structs§

Probe
What the environment looks like to the preflight, gathered by the caller.

Enums§

Host
Which agent front is running. The settings file is per-host: a session on one host must never read the other host’s file, which is what makes .opencode/…local.md and .claude/…local.md disjoint rather than a migration path between them.

Constants§

MIN_JAVA_MAJOR
Ghidra 12.1.2 declares application.java.min=21; anything older fails at JVM start with a message that does not mention the version.

Functions§

extract_frontmatter 🔒
Extract the YAML frontmatter block from a .local.md file.
host_from_env
host_from_str over the process environment.
host_from_str
The host named by RE_GHIDRA_HOST. Unset or anything but exactly "opencode" means Host::Claude: the Claude front has never read this variable, so defaulting there keeps every existing install on today’s behavior. OpenCode sets the variable in opencode.jsonc’s mcp.servers.ghidra.environment (Task 5).
load_settings
Load the settings layer for project_dir. A missing or unreadable file is not an error — it simply contributes nothing, and the environment or CLI flags supply the values instead.
parse_java_major
Parse the major version out of java -version output.
preflight
Report what is missing, in the order a user should fix it. An empty vector means every cheap check passed — and the hook then says nothing at all.
settings_from_markdown
The settings-file layer, in the shape the shared config resolver consumes.
settings_path
The settings file this plugin reads, relative to a project root.