The asyncroscopy MCP server lets local or remote model clients call live Tango device commands through FastMCP.
Runtime Contract¶
Start the Tango/device stack:
uv run startup_scripts/run_servers.py --yaml configs/Spectra300.yamlStart MCP separately:
uv run startup_scripts/run_mcp.py --yaml configs/mcp.yamlconfigs/mcp.yaml is the explicit MCP config. It contains the Tango endpoint,
the MCP HTTP endpoint, the DATA device address, and the command blocklist.
What MCP Does At Startup¶
MCPServer:
Connects to the Tango database.
Lists exported devices.
Skips blocked Tango classes.
Queries each device’s commands.
Skips blocked commands.
Registers the remaining commands as FastMCP tools.
Registers native helper tools such as
list_devicesandget_data_from_key.
There is no package search, source introspection requirement, or separate AutoScript-specific MCP class.
Command Names¶
Tango commands are exposed as MCP tools using the device class and command name. For example:
SCAN.State
SCAN.Status
AutoScriptMicroscope.acquire_scanned_imageThe exact tool set depends on which devices are exported in the Tango database when MCP starts.
Data Access¶
get_data_from_key is the required MCP-native data helper. It reads a DATA/Tiled
key for acquired HDF5 data and returns JSON-safe metadata plus a small preview.
Use this helper when a model needs to inspect acquisition results without learning the full Tiled/HDF5 access pattern.
Safety Boundary¶
MCP exposes hardware-control commands, so the YAML blocklist is part of the runtime safety boundary. Keep destructive or server-management commands blocked:
blocked_classes:
- DataBase
- DServer
blocked_functions:
"*":
- Init
- Kill
- RestartServerAdd project-specific exclusions before connecting an autonomous model client.