Skip to content

NUANCE-MCP plugin

mcp

NUScope inside NUANCE-MCP: data tools for the LLM, and sealed files for every acquisition.

NUANCE-MCP (https://github.com/NUANCE-IT/NUANCE-MCP) loads this module through the nuance_mcp.plugins entry point. register(ctx) then

  • saves every acquisition (acquire_tem_image, acquire_stem, acquire_4d_stem, acquire_diffraction, acquire_eels) as a NUScope .h5 file: calibrated axes, the column state as metadata, the tool call and its parameters as provenance, sealed with SHA-256 hashes and signed with your EMDataBridge identity when you have one. The tool response gains plugins.nuscope = {"file", "seal", "signed_by", ...};
  • adds tools that work on files, so the model can read, check and analyse data with calibrated units: nuscope_describe, nuscope_verify, nuscope_analyze, nuscope_history, nuscope_list, nuscope_identity.

Files go to $NUSCOPE_ACQUISITION_DIR (default ~/NUScope/acquisitions), one folder per day. Set NUSCOPE_SAMPLE to record the sample name.

NUScope does not import NUANCE-MCP: the acquisition results are read by their attributes (data, pixel_size_nm, tags ... or counts, energy_eV).

dataset_from_acquisition

dataset_from_acquisition(tool: str, params: dict, result: Any, instrument: dict) -> Dataset

A calibrated NUScope dataset from a NUANCE-MCP ImageReturn / SpectrumReturn, with provenance.

register

register(ctx) -> None

Entry point for NUANCE-MCP (nuance_mcp.plugins).