MCP tool reference
The MCP server exposes analysis tools, playbook prompts, and case resources. Many tools use the same analysis services as the CLI and Web API. This page describes the response fields and errors that an MCP client receives.
```{admonition} Analysis-time region filter (region_filter)
- class:
note
consensus, aligned_window, consensus_regions, analyze_candidates, n_sweep, experiment, read_hex and read_hex_raw take an optional region_filter: a comma list of region categories (e.g. "heap,stack"; categories as for import_raw_dump’s region_types), or "all" for no filter. It applies to .msl inputs only and is a non-destructive view filter: each dump is read as if only the selected regions existed, so offsets are filtered-view offsets and the result records region_filter. If you leave it out, the session’s region filter applies (none by default; set it with set_region_filter, read it with get_region_filter). An explicit value, "all" included, always takes precedence over the session’s filter.
The downstream stages search_reduce, brute_force, auto_floor and emit_plugin also take region_filter. Left out, they reuse the filter the upstream stage recorded in its artifact (consensus.json / candidates.json / hits.json), so offsets stay consistent across the chain. Pass a value only to override that filter, or "all" to clear it. aligned_window / consensus_regions always use the filter a built consensus recorded. An unknown category name is rejected as invalid input.
```{admonition} Error body
:class: note
A tool that fails returns a JSON error object rather than an MCP protocol error. Every tool uses the same structured shape, and so does a read-sandbox denial ([](sandbox.md)):
{"error": "<message>", "code": "<machine code or null>", "category": "<NOT_FOUND | INVALID_INPUT | PRECONDITION | ...>"}
An error that carries context adds it under `details`. The exception is the original inspect tools (`read_hex`, `read_hex_raw`, `get_entropy`, `analyze_region`, `extract_strings`, `detect_format`, `get_session_info`, `vas_regions`, `get_processes`, `get_modules`, `get_handles`, `get_connections`, `get_module_index`, `get_import_provenance`, `get_blocks`, `resolve_va`, `search_bytes`, `get_page_states`, `get_cross_references`, `identify_structure`). For compatibility, they keep their older body: `{"error": "<message>"}`, with any details (such as `offset` and `file_size`) merged in at the top level. A locked encrypted dump is not an error: it returns `{"error": "<hint>", "tag_status": "<status>"}`. Any of these bodies can be detected by its `"error"` key.
```{admonition} Memory budget (force_memory)
- class:
note
analyze_library, analyze_candidates, consensus, aligned_window, consensus_regions, export_pattern and experiment build a consensus over every input dump, and that build is checked against a memory budget first (a safety fraction of the host’s available memory, capped by MEMDIVER_MEMORY_BUDGET_MB when set). When the estimated peak exceeds it, the tool does no work and returns a structured error instead:
{"error": "<estimate vs budget and suggestions>", "code": "memory_budget_exceeded",
"category": "PRECONDITION", "estimate_bytes": <int>, "budget_bytes": <int>,
"details": {"estimate_bytes": ..., "budget_bytes": ..., "operation": ..., "breakdown": ..., "source": ...}}
Every one of these tools takes force_memory: bool = False. Fewer or smaller dumps (or a region_filter) are the safe fix; re-calling with force_memory=true runs the build anyway (a warning is logged). Any other tool error that carries details now includes them under details too.
```{admonition} Heap awareness (`allocator`, `heap_policy`)
:class: note
`consensus`, `aligned_window`, `consensus_regions`, `analyze_candidates` and `locate_key` take `allocator: str = "auto"`: the heap allocator used to label each byte's heap role (`auto` detects it; a [registered allocator name](heap.md#supported-allocators) forces that parser; `off` turns heap analysis off). This is non-destructive. `consensus` reports the result under `heap` (and writes `heap_roles.npz` beside `variance.npy`), `aligned_window` returns `heap_roles`, and each `locate_key` hit gets a `heap` entry naming its chunk. A hit in a `free`, `cached` or `quarantined` chunk is a residual copy.
`analyze_candidates` and `search_reduce` also take `heap_policy: str = "annotate"`:
- `"annotate"` (default) is non-destructive. Each region gets a `heap` block (`chunk`, `residual`, `role_counts`), and the ranking stays the same.
- `"mask"` removes allocator metadata (chunk headers, free-list links) from the candidates before they are reduced. The number of bytes removed is in `stages.heap_masked`. It fails with a PRECONDITION error when no heap annotation is available.
- `"user_data"` keeps only bytes inside chunk user data (live or freed payload; freed slots are kept and flagged). The number of bytes removed is in `stages.heap_outside_user_data`. It needs a heap map from an allocator whose user-data roles were validated: `ptmalloc2`, `golang`, `cpython`, `segment_heap` or `nt_heap`.
- `"off"` turns heap analysis off.
`search_reduce` reads the heap roles from the `heap_roles.npz` that `consensus` wrote beside the variance file.
Dataset inspection
Tool |
Purpose |
|---|---|
|
Enumerate libraries + phases under a dataset root. |
|
List canonical phases for a specific library directory. |
|
Enumerate supported protocols (TLS12, TLS13, SSH2, …). |
|
Set the session’s default |
|
Return the session’s current |
Analysis
Tool |
Purpose |
|---|---|
|
Run selected algorithms against a library run set. |
Dump inspection
Tool |
Purpose |
|---|---|
|
Hex-dump a range of bytes. |
|
Read raw bytes from a dump file, returned base64-encoded. |
|
Shannon entropy profile with configurable window / threshold. |
|
Investigate one offset: byte value, local entropy band, strings. |
|
ASCII/UTF-8 string extraction. |
|
Search a dump for every occurrence of a byte pattern. |
|
Detect the binary format at an offset in a dump’s raw container. |
|
MSL session metadata (PID, module list, connection table). |
|
Cross-references between MSL blocks. |
|
Best-match structure overlay at an offset. |
MSL structure
Tool |
Purpose |
|---|---|
|
List the per-dump VAS region layout from an MSL file. |
|
Translate a virtual address to file and VAS offsets for an MSL dump. |
|
Surface the MSL three-state page model (CAPTURED/FAILED/UNMAPPED). |
|
List processes captured in an MSL file (pid/ppid/uid/exe/cmdline). |
|
List loaded modules in an MSL file (path/base_addr/size/version). |
|
List open handles/fds in an MSL file (pid/fd/type/path). |
|
List network connections in an MSL file (pid/family/protocol/addrs). |
|
List MODULE_LIST_INDEX entries in an MSL file (uuid/base/size/path). |
|
IMPORT_PROVENANCE records with the note parsed (kept/excluded regions, materialized copy + original EoC hash, |
|
List all blocks in an MSL file grouped by category. |
Heap analysis
See Supported allocators for parser coverage. Every tool takes allocator ("auto" detects), works on .msl (with key material when encrypted) and raw dumps, and base_va places a flat raw dump without a .maps sidecar. summary/chunks/chunk_at/free_lists/roles also take regions (parse only these mappings) and max_chunks (walk cap). Bad input (unknown allocator/state/view, a VA window together with an offset window) returns the structured {"error", ...} body.
Tool |
Purpose |
|---|---|
|
Rank allocator candidates with their evidence and the detected platform. Start here. |
|
Whole-heap overview: regions, chunk counts/bytes by state, size histogram, bytes per role ( |
|
One page of the chunk table, filtered by |
|
The chunk containing a |
|
Walked free lists (tcache, fastbins, …) optionally of one |
|
Byte-role runs of an |
Case data lake
Tabular results live as Parquet tables in a case directory, queryable with read-only SQL, with a versioned annotation record beside them. The schema is also served as the MCP resource memdiver://case/{case_dir}/schema (URL-encode the directory).
Tool |
Purpose |
|---|---|
|
Create (or re-open) a case; a bare name means |
|
Manifest, tables (runs, row counts) and annotation captures. |
|
Columns, types, location mappings, runs and rows per table. |
|
ONE read-only SELECT (DuckDB SQL), |
|
Export a dump ( |
|
The key finders (structure-based key recognisers) with the |
|
Scan the captured bytes of a dump ( |
|
Compile a YARA rule without scanning: |
|
Scan the captured bytes of one dump ( |
|
List stored YARA rules of the per-user library and, with |
|
One stored YARA rule with its source; |
|
Store a YARA rule by |
|
Remove a stored YARA rule from exactly the named scope (same default as put; not found if it lives only in the other scope); its last source is archived to history. |
|
Run a detector’s fixtures (positive controls + decoys): verdict |
|
Store a fixture in a case: finder / YARA rule name, a sample ( |
|
Bundled and stored detector fixtures with their |
|
Retire a stored fixture (archived under |
|
The printable strings of the captured bytes of a dump, one row each ( |
|
Everything containing a |
Memory images
Note: pakunoda is a separate third-party tool, not part of MemDiver. MemDiver integrates with it optionally: it is installed only with the image extra (pip install "memdiver[image]"), is imported lazily, and is never vendored in the MemDiver wheel. Without it, the features that use it report that it is not installed.
Full-image views of a memory image (LiME, ELF core, …) via Volatility 3 (pip install "memdiver[image]"). A view is a small .mdview descriptor file that opens like any dump. The MCP server has no job queue, so slow steps (image hashing, pakunoda) block the call; the REST API runs them as tasks.
Tool |
Purpose |
|---|---|
|
Size, physical layer chain, versions and cached-profile status; never hashes the image or runs pakunoda. |
|
Resolve the kernel profile (ISF): explicit, cache, pakunoda, vol3 symbol dirs. |
|
Write a |
|
|
|
Extract a process view into an |
|
Sibling groups of one image (processes of one binary by ELF build-id): shape, roles, per-member frame accounting; optional |
|
Differential over one sibling group ( |
|
Bundled Volatility 3 plugins of an OS family. |
|
A plugin’s user requirements (bundled name, or |
|
Run a plugin over a |
|
Read-only |
|
One |
|
Source text of a new plugin (kernel module, optional |
|
Load plugin |
|
Register an external vol3 output (Parquet/CSV/JSON) as a run of a |
|
Write a |
|
Stored user plugin sources of a case (name, sha256, size, updated, version). |
|
One stored plugin source; |
|
Store plugin source as |
|
Store a plugin fixture (plugin or stored source, view, args, row predicates) under |
|
Stored plugin fixtures of a case. |
|
Run a fixture: verdict |
|
The installed |
|
Build a Volatility 3 plugin from findings in up to 16 dumps. For single-key synthesis, pass |
|
Run a plugin by NAME under the stock |
|
Score a plugin NAME against a corpus’s ground-truth sidecars ( |
Format conversion
Tool |
Purpose |
|---|---|
|
Convert a dump (raw, ELF core, minidump, |
|
Metadata-only preview of an import: regions with their category, per-category counts/bytes, and what a |
|
Auto-detect a volatile region and export a YARA/JSON/Vol3 pattern. |
|
Export a YARA/JSON/Vol3 pattern from a KNOWN offset + length. |
|
Emit a Wireshark-loadable NSS key log from recovered TLS secrets. |
Consensus
Tool |
Purpose |
|---|---|
|
Build a per-byte consensus variance vector; writes |
|
Read ONE window in EVERY dump at the address the consensus aligned. |
|
List EVERY occurrence of a consensus class, paginated and jumpable. |
Known secret & detectors
Tool |
Purpose |
|---|---|
|
Locate a secret you ALREADY HOLD across N dumps — honest three-valued (found / absent / nothing searched). See Locating a known key. |
|
Search N dumps for a handshake field, each from ITS OWN capture. |
|
Turn a KNOWN secret’s location into a scanning signature. |
|
Compile ONE YARA rule set and scan N dumps with it. |
|
RUN a MemDiver-emitted Volatility3 plugin over N dumps. |
|
Score detector firings against the key’s known-true intervals. |
Pipeline stages
Tool |
Purpose |
|---|---|
|
Rank candidate regions across N dumps — NO oracle, NO capture needed. |
|
Variance + alignment + entropy candidate reducer. Returns the ranked regions inline ( |
|
Iterate candidates through a decryption oracle. The oracle is self-tested first; one that fails (for example, it accepts random input) is refused with |
|
N-curve sweep with convergence reporting. |
|
Automated oracle-arbitrated variance-floor selection → verdict. |
|
Synthesize a Volatility3 plugin from a verified hit. |
|
All stages in one call, with one verdict. |
|
Windows process dumps (native |
|
Go process dumps (native |
|
Android Scudo process dumps (native |
|
Read-only: the method |
Format oracles
The shipped format oracles (gocryptfs-gcm, luks, xts-fsmagic, aead-generic, ssh-kdf-consistency, x25519-pubkey, x25519-dh-consistency) as a BYO-oracle source.
Tool |
Purpose |
|---|---|
|
List them: candidate key lengths, cost per verify, the evidence each needs, |
|
Which one fits a dump, and why (gocryptfs vault in |
|
Build one from its evidence (sample blob, gocryptfs vault file/dir, raw LUKS header) and return the |
Verification & experiments
Tool |
Purpose |
|---|---|
|
Summarise the TLS sessions in a capture (the pcap arm/validate step). |
|
Inventory a capture for the explicit capture verifier: dissected protocols, sessions per adapter, the registered adapters and their key types (needs tshark). |
|
Verify ONE candidate key ( |
|
Check whether a candidate key read at an offset decrypts a known ciphertext. Set |
|
Run the full spawn→dump→consensus→verify→emit experiment. |
Semantic-workbench tools by workflow
Tools added with the memory-image / case workbench. Image, vol3_*, case, YARA, detector-fixture, key-finder and heap tools are tabled in their sections above; this section adds the rest, grouped by workflow. List every tool with tools/list in your MCP client; the playbook prompts below say in which order to call them.
Case inventory and annotations
Tool |
Purpose |
|---|---|
|
Inventory of a case: views, images (exists/size), |
|
What has been concluded about a capture (its analysis record). |
|
Record a conclusion about a capture (append-only, never edits history). |
|
Correct an entry: append a replacement that supersedes |
|
Withdraw an entry (a retraction is appended; nothing is deleted). |
ISF profile workbench (see The ISF workbench)
Tool |
Purpose |
|---|---|
|
Run one pakunoda probe on a full image ( |
|
Create an empty draft for a capture, list drafts, read a materialized summary. |
|
One draft operation: |
|
Import (a subset of) an ISF JSON file into the draft; records its sha256. |
|
Retract an entry, read the version history, diff against an older version or an ISF file. |
|
Validate the draft as an ISF document and report per-plugin readiness. |
|
Write the draft (at |
|
Try a draft or an ISF file on the image, with a ground-truth diff. |
|
Decode which struct fields a kernel function touches. |
|
Disassemble |
N-dump structure and object models (see Object model: learn from N dumps, find in one)
Tool |
Purpose |
|---|---|
|
Consensus keyed by DELTA from each dump’s own anchor (e.g. the key). |
|
Who points here: captured words holding a pointer into a target. |
|
Propose field boundaries around a verified anchor, learned from N dumps. |
|
Learn a layout and build the artifact model. |
|
Export an artifact model (JSON) as a Volatility3 plugin. |
|
Validate a model’s plugin on held-out captures against ground truth. |
Result budget (opt-in)
Set MEMDIVER_MCP_RESULT_BUDGET=<bytes> (minimum 1024; unset or 0 = off) so no tool result exceeds that many UTF-8 bytes. Off, results are byte-identical to before. A larger result is shrunk deterministically: scalar keys are kept, each list keeps its first K items with <key>__truncated: {"kept", "total"}, nested dicts recurse one level, and if that is not enough the largest values become {"omitted_bytes": n}. A truncated result always carries a top-level _result_budget (budget, original_bytes, returned_bytes, hint); the hint names the tool’s own limit/offset when it has them. Non-JSON text is cut with a marker line. Structured errors pass through unchanged, and the budget applies after the read sandbox (Path sandbox).
Prompts (playbooks)
The server registers 8 MCP prompts. Each renders a numbered procedure naming the exact tools and parameters, what to check in each result, and the traps hit on real data. All arguments are optional; given values are substituted into the steps.
Prompt |
Arguments |
For |
|---|---|---|
|
none |
What MemDiver is, the playbook list, the resources and conventions. Fetch this first. |
|
|
Open an image, resolve a profile, run Volatility 3 plugins, query and annotate rows. |
|
|
Scaffold, store, check, run and fixture-test a Volatility 3 plugin. |
|
|
Hand-build an ISF kernel profile when automatic resolution fails. |
|
|
Process, |
|
|
Cohorts, consensus and anchor consensus across N dumps. |
|
|
Key log, layout, artifact model, exported plugin, held-out validation. |
|
|
Which struct fields a kernel function touches, joined to an ISF. |
Resources
Four read-only resource templates serve case state as JSON. URL-encode the case directory. They run the same read sandbox as the tools (Path sandbox) and return the same structured JSON error on a denial.
URI |
Content |
|---|---|
|
Inventory of a case (as |
|
Schema of a case (as |
|
Current annotations of one capture. |
|
Materialized summary of one ISF draft. |
See each tool’s input schema via the MCP client’s tool picker, or read the implementations in mcp_server/tool_families/ (one register(mcp, ctx) module per tool family, called in order from mcp_server/server.py) and mcp_server/tools.py / mcp_server/tools_inspect.py / mcp_server/tools_pipeline.py / mcp_server/tools_xref.py.