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.mdand.claude/…local.mddisjoint 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.mdfile. - host_
from_ env host_from_strover the process environment.- host_
from_ str - The host named by
RE_GHIDRA_HOST. Unset or anything but exactly"opencode"meansHost::Claude: the Claude front has never read this variable, so defaulting there keeps every existing install on today’s behavior. OpenCode sets the variable inopencode.jsonc’smcp.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 -versionoutput. - 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.