MCP server for STEM microscope control and analysis with spectral data collection, PCA analysis, clustering, and image visualization
This server exhibits significant definition quality gaps. Of 14 tools, most have descriptions (13/14 present), but they are often generic or lack critical detail required for LLM planning. Tool names follow verb_noun conventions reasonably well, but parameter schemas are inconsistent. Only 5 tools show complete schema with all parameters typed and described. Output schemas are undocumented across all tools. Error handling is generic ('Error: ...') without recovery guidance. The server conflates multiple concerns (STEM microscopy, AFM scanning, particle segmentation) without clear separation. Critical security issues: Download_Data_File writes to filesystem without validation; Initialize_Microscope and Register_Data_File modify global state without transactional guarantees. No audit logging, no permission gates, no input sanitization against path traversal.
Check if the segmentation model is loaded and ready
Perform K-means clustering on spectral data
Collect spectra from a grid of points. This is useful for clustering and analysis.
Download a data file from a URL to the current working directory
Get a summary of all analysis results performed so far
Get the overview image from the microscope and store it for visualization
Get the spectrum from a specific point (x, y) on the sample
Output schemas are UNDOCUMENTED across all 14 tools. LLMs cannot know what fields, types, or formats are returned, blocking structured reasoning and multi-step planning.
Naming inconsistency: 14 tools use 3 different naming conventions (PascalCase: Initialize_Microscope; lowercase_underscore: initialize_afm, get_full_scan; CamelCase: Segment_Image). LLMs conflate similar-sounding tool names, define one canonical style and apply it uniformly.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 45 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 36 | - | v1 |
Initialize the STEM microscope connection and optionally register a data file
Perform Principal Component Analysis on collected spectral data
Register a data file (H5 format) with the microscope
Apply segmentation model to an image and return the original and predicted segmentation mask
Get the complete 2D scan image. Auto-initializes if server forgot state.
Initialize the AFM microscope and return dataset info.
Scan a single line at a specific coordinate.
Path traversal and arbitrary file write vulnerabilities in Download_Data_File and Segment_Image. filename parameter in Download_Data_File is passed directly to os.path.abspath() without sanitization, LLM could pass '../../../etc/passwd' or absolute paths outside intended directory. Segment_Image accepts unconstrained image_path parameter. These violate pattern:tool-gateway (sanitize all agent input).
Silent dependencies between tools. Perform_PCA_Analysis and Cluster_Spectra implicitly require prior Collect_Grid_Spectra call (operate on global _current_data['spectra']). If preconditions aren't met, they fail silently. Tool descriptions don't document dependencies, forcing LLMs to guess correct call sequences.
Global state (_mic_server, _current_data) violates MCP statelessness principle. Multiple Initialize_Microscope calls modify _mic_server without atomicity. Concurrent requests will interfere. MCP 2026-07-28 requires stateless request handling, each request must be self-contained with _meta carrying protocol version and capabilities.
Parameter enums are missing. channel parameter in Get_Point_Spectrum, Collect_Grid_Spectra, get_full_scan defaults to 'Channel_001' but no enum of valid channels is provided. direction in scan_individual_line and get_full_scan lack enum constraints (LLM could pass 'diagonal' or 'upside-down'). Unconstrained strings invite hallucinated values.
Error handling is generic throughout. All tools return error strings like 'Error: {exception}' without recovery guidance. Pattern:recovery-guide requires actionable next steps, e.g., 'File not found. Check path or call Download_Data_File() first.' Current errors are unhelpful to agents.
Numeric parameters lack min/max constraints. grid_size_x, grid_size_y default to 10 but have no documented limits, LLM could pass 1000000 causing timeout/OOM. n_components in Perform_PCA_Analysis lacks guidance (valid range 1 to number_of_features). coord in scan_individual_line has no units or range. Unbounded numbers let LLMs pass absurd values.
No audit logging or permission gates. Tools like Initialize_Microscope, Download_Data_File, and Segment_Image modify state or filesystem without logging who initiated the action or checking permissions. Pattern:audit-trail and pattern:permission-gate require traceability for compliance and incident response.
Descriptions lack WHEN and WHY guidance. Most tool descriptions state WHAT they do but not when to call them vs similar tools, prerequisites, or expected outcomes. E.g., 'Initialize_Microscope' vs 'Register_Data_File', when should an agent use which? Descriptions don't clarify. Pattern:tool-description requires this context for proper LLM tool selection.