Expand description
Wire types, framing, JSON-RPC, and address canonicalization for the host <-> Ghidra-worker socket. No Ghidra dependency: pure, unit-testable.
Modules§
- address
- Strict-total address canonicalization (spec §9). Lenient input, one canonical output form. This is the single code path; no tool formats addresses itself.
- error
- Error envelope + code set (spec §10). Serialized as the MCP tool result body
{ error: { code, message, suggested_action, details? } }with isError:true (the isError flagging is applied by the MCP layer in M1). - error_
map - Total map from the Java worker’s string error codes to the Rust
ErrorCodeset (spec §4.1). Every known worker string maps to a variant; any UNKNOWN string falls back toWorkerUnavailablewith the raw code preserved indetails.worker_codeso nothing is silently lost. - frame
- Length-delimited framing: 4-byte big-endian length prefix + UTF-8 JSON body (spec §5).
- owner_
only - Owner-only directory lockdown: the Unix
chmod 0700equivalent on both platforms. Single home for the DACL/chmodlogic so the two callers (ghidra-mcp::loggingfor the log dir,ghidra-worker-ctl::bootfor the per-boot token dir) cannot drift apart. - protocol
- Cross-language wire DTOs for the M1a read tools (spec §3). These are the worker’s response shapes;
the server canonicalizes address strings (via
address::AddressCanonicalizer) before returning them to the MCP client, but the wire form carries whateverspace:offsetthe worker emits. - rpc
- JSON-RPC 2.0 host <-> worker types + the versioned init handshake (spec §5).