Skip to main content
Glama
sidman76

mhs_demo_server

by sidman76

mhs-demo

A demo agent that operates simulated lab hardware (a CO2 incubator and a centrifuge) through an MCP server, in the pattern described by Anthropic's Model Hardware Standard (MHS) research preview.

This is not Anthropic's real MHS SDK. As of this writing MHS is a gated research preview — no public spec, package, or sample code has been released. This repo reimplements the pattern from that announcement (device discovery + read/write primitives + natural-language safety-limit metadata) against two simulated instruments, so the agent-loop shape is ready to swap onto real MHS drivers once they ship.

What's here

  • mhs_demo_server.py — an MCP server exposing three tools over stdio:

    • list_devices — discover devices, parameters, units, and safety limits

    • read — get a parameter's current value

    • write — set a parameter; rejected if unwritable or outside safety limits (includes a cross-parameter interlock example: the centrifuge door can't unlock while it's spinning)

  • mhs_demo_agent.py — a Claude agentic loop that discovers the MCP server's tools, converts them to Anthropic tool schemas, and calls them to satisfy a user request end to end.

Simulated devices:

Device

Parameters

incubator_01

temperature_c (4–45°C), humidity_pct (0–100%), door_open (read-only)

centrifuge_01

speed_rpm (0–15000), door_locked (interlocked with speed)

Related MCP server: mcp-live-telemetry

Setup

pip install -r requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...   # or create a .env file with this line

Run

python mhs_demo_agent.py
# or with a custom prompt:
python mhs_demo_agent.py "Set the incubator to 39C and spin the centrifuge at 20000 RPM"

The agent spawns mhs_demo_server.py as a subprocess over stdio, discovers its tools, and runs a tool-use loop with Claude until the model returns a final answer.

Model

Uses claude-opus-4-6 via the Anthropic SDK.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server for PyLabRobot that exposes liquid handler, plate reader, thermocycler, and heater-shaker as MCP tools. It ships in simulation mode by default, allowing end-to-end testing without hardware.
    10
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Exposes live industrial IoT telemetry to any MCP client, streaming simulated sensor data from a fleet of machines and detecting anomalies, with the ability to inject faults on demand.
    4
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Exposes digital twin device data capabilities as MCP tools, allowing MCP clients to query device status, read real-time metrics, fetch time-series data, and check alerts. Includes a simulated PLC driver with a clean interface for connecting real devices via OPC-UA, Modbus, or gateway APIs.
    6
    MIT