mcpXL30
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcpXL30
WORK IN PROGRESS
mcpXL30 is an MCP (Model Context Protocol) server that exposes a curated
subset of the pyxl30 control library to LLM
agents (i.e. AI contorl of the XL30 ESEM).
Note that this project was partially generated with LLM support.
Features
Async MCP tools for common Philips XL30 operations (identify, read/set high tension, change scan modes, trigger pump/vent cycles, capture TIFF images).
Live MCP resources that describe the connected instrument and active config.
Safety envelope that limits accelerating voltage and sensitive operations.
Fine grained settings that control allowed operations for the LLM agent.
Optional remote HTTP/UDS transport with the authentication workflow explained in my blog post.
Related MCP server: rei-lads-mcp
Installation
pip install mcpXL30
# or
pip install "mcpXL30[remote]" # adds FastAPI/uvicorn/argon2 for remote modeConfiguration
The server loads JSON configuration from ~/.config/mcpxl30/config.json by
default (override via --config). A minimal example:
{
"instrument": {
"port": "/dev/ttyUSB0",
"log_level": "INFO",
"retry_count": 3,
"reconnect_count": 3
},
"image_capture": {
"remote_directory": "C:\\\\TEMP",
"filename_prefix": "MCPIMG_"
},
"safety": {
"max_high_tension_kv": 15.0,
"allow_venting": false,
"allow_pumping": true,
"allow_scan_mode_changes": true,
"allow_stage_motion": false,
"allow_detector_switching": true,
"allow_beam_shift": true,
"allow_scan_rotation_changes": true,
"allow_image_filter_changes": true,
"allow_specimen_current_mode_changes": false,
"allow_beam_blank_control": true,
"allow_oplock_control": false
},
"logging": {
"level": "INFO",
"logfile": null
},
"remote_server": {
"uds": "/var/run/mcpxl30.sock",
"api_key_kdf": {
"algorithm": "argon2id",
"salt": "<base64>",
"time_cost": 3,
"memory_cost": 65536,
"parallelism": 1,
"hash_len": 32,
"hash": "<base64>"
}
}
}Use mcpxl30-genkey --config /path/to/config.json (or mcpxl30 --genkey) to
generate a new API key and populate the Argon2 hash inside the remote_server
block. The plain token prints once to stdout.
The safety block gates riskier capabilities. Keep allow_stage_motion and
allow_oplock_control disabled unless you trust the calling agent. Imaging and
detector-related fields default to safe-but-capable settings, but you can toggle
them per deployment.
Running the server
stdio transport (default)
mcpxl30 --config ~/.config/mcpxl30/config.jsonThe process utilizes the stdio transport.
Remote FastAPI/uvicorn transport
pip install "mcpXL30[remote]"
mcpxl30 --transport remotehttp --config ~/.config/mcpxl30/config.jsonThe FastAPI app exposes
/mcp(MCP streaming API) and/status(unauthenticated health check).Authentication expects the API key in
Authorization: Bearer,X-API-Key, or the?api_key=query parameter.Binding uses a Unix domain socket (
remote_server.uds) unless you specify a TCPport, in which casehost(default0.0.0.0) applies.
MCP functionality
Tools
Instrument Basics
Tool | Purpose |
| Return the microscopes type/serial, scan mode, high tension. |
| Inspect or change accelerating voltage (safety-capped). |
| Read or change scan mode ( |
| Store images (TIFF or console photo). |
| Chamber vent/pump control (safety gated). |
Beam & Detector Controls
Tool | Purpose |
| Read or set probe current (1–10). |
| Read or set magnification (20–400 000). |
| Inspect/update stigmator X/Y. |
| Inspect or switch active detector ( |
| Included above but relevant for beam tuning. |
Scan Timing & Geometry
Tool | Purpose |
| Read or set line time (ms or |
| Inspect or adjust lines per frame. |
| Read or set scan rotation ( |
| Manage area/dot shift percentages ( |
| Control selected area dimensions. |
Imaging Utilities
Tool | Purpose |
| Read or set contrast (0–100). |
| Read or set brightness (0–100). |
| Run built-in adjustment routines. |
| Inspect or update the image databar text. |
Stage & Alignment
Tool | Purpose |
| Home the stage ( |
| Read or move X/Y/Z/tilt/rotation ( |
| Inspect or adjust beam shift ( |
Image Filtering & Specimen Current
Tool | Purpose |
| Manage FastMCP image filter + frame count ( |
| Inspect or change detector mode ( |
| Read specimen current (requires measure mode). |
Beam Safety & Locks
Tool | Purpose |
| Inspect or control beam blank state ( |
| Inspect or control the operator lock ( |
Every setter uses blocking pyxl30 calls inside asyncio.to_thread, preserving the FastMCP event loop responsiveness. Review the safety settings to enable only the tools you trust agents with.
All setters perform blocking pyxl30 calls inside asyncio.to_thread so the MCP
event loop stays responsive.
Resources
mcpxl30://instrument/capabilities– supported scan modes, image filter names, and the configured safety envelope.mcpxl30://instrument/config– sanitized live configuration (excludes API secrets).
Examples
An examples/example_config.json file is included to bootstrap deployments.
The repository mirrors mcpMQTT's project layout so existing FastMCP
infrastructure (supervisors, packaging, docs) can be reused with minimal
changes.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Safety tools for AI agents: safe page reader, prompt-injection, secrets, PII and MCP server scans
AI Agent Utility Layer for agent safety, web monitoring, crypto research and tool discovery.
LLM agent security scan: injection, jailbreak, tool abuse probes plus guardrail audit.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to control hardware devices like Arduino, Raspberry Pi, 3D printers, CNC machines, and custom robots via serial ports and HTTP. Provides tools for device discovery, command sending, sensor reading, servo control, G-code execution, and emergency stops with safety features.44 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to connect to and control OPC UA LADS laboratory instruments, with approval-gated execution of state-changing operations and retrievable SHA-256 witnessed provenance records.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to connect to and control Siglent oscilloscopes and power supplies over SCPI/TCP using typed tool calls with input validation, safety controls, and built-in observability.1Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables unified discovery, query, and control of laboratory instruments (power supplies, oscilloscopes, signal generators, multimeters) via VISA/SCPI, with device-specific libraries and an MCP server exposing 19 tools for natural language interaction.-