mcp_server.tools

Pure tool functions for MemDiver — dataset discovery and analysis.

Each function takes a ToolSession + explicit params and returns a dict. The MCP server and future web gateway both call these directly.

scan_dataset(session, root, keylog_filename='keylog.csv', protocols=None)[source]

Scan a dataset directory for available protocols, libraries, and phases.

Parameters:
  • session (ToolSession)

  • root (str)

  • keylog_filename (str)

  • protocols (List[str] | None)

Return type:

dict

list_phases(session, library_dir)[source]

List available lifecycle phases for a library directory.

Parameters:
  • session (ToolSession)

  • library_dir (str)

Return type:

dict

list_protocols(session)[source]

List all registered protocol descriptors.

Parameters:

session (ToolSession)

Return type:

dict

analyze_library(session, library_dirs, phase, protocol_version, keylog_filename='keylog.csv', template_name='Auto-detect', max_runs=10, normalize=False, expand_keys=True, algorithms=None)[source]

Run the full analysis pipeline on library directories.

Parameters:
  • session (ToolSession)

  • library_dirs (List[str])

  • phase (str)

  • protocol_version (str)

  • keylog_filename (str)

  • template_name (str)

  • max_runs (int)

  • normalize (bool)

  • expand_keys (bool)

  • algorithms (List[str] | None)

Return type:

dict

import_raw_dump(session, raw_path, output_path, pid=0)[source]

Import a raw .dump file to .msl format.

Parameters:
  • session (ToolSession)

  • raw_path (str)

  • output_path (str)

  • pid (int)

Return type:

dict