OpenMHS

Connect AI agents to programmable hardware.

OpenMHS is an open-source gateway that sits between an AI agent and the instruments it wants to use: power supplies, motion stages, sensors, lab instruments. Every command is checked against a written contract and a deny-by-default policy, journaled, and verified by reading the device back. Anything hazardous waits for a person, and every step is kept in a log that cannot be changed without it showing.

A person at a lab desk. A cable from the desk runs to the OpenMHS gateway, which connects to a robot arm, a power supply, a linear stage and a temperature sensor.
One person, one gateway, many machines. The agent asks; the gateway decides what reaches the hardware.

Why it exists

Letting a language model drive real equipment goes wrong in three predictable ways.

1. Nothing says what a device accepts

A model guesses at units, ranges and ordering, and a bare 5 can mean volts, millivolts or a mistake. OpenMHS describes each device in a descriptor with units, limits, preconditions and side effects, and refuses what does not fit.

2. Permission lives in the prompt

Telling a model "don't exceed 12 V" is only a request. In OpenMHS a deterministic policy decides, deny by default, with scoped credentials and human approval for hazardous actions. A model cannot grant itself access.

3. Timeouts are ambiguous

If a write goes unanswered, the device may or may not have changed. OpenMHS records UNKNOWN_OUTCOME, never retries blindly, and reconciles by reading the device. Every command is journaled; the audit log is hash-chained.

See it work

A real gateway with simulated devices. The agent is refused a 5 V jump (too fast), gets 2 V confirmed by readback, is refused 48 V (out of range), and the audit log verifies. Recorded from a real run; no hardware.

Terminal recording: an agent asks a simulated power supply for 5 V and is refused for changing too fast, sets 2 V and has it confirmed by readback, is refused 48 V as out of range, and the audit log verifies.
From the project repository (docs/assets/demo.svg), recorded by tools/record_demo.py.

Try it in a minute

No release is published yet, so build from source with Rust 1.89 or newer.

git clone https://github.com/KNambiarDJsc/Open-MHS
cd Open-MHS
cargo install --locked --path crates/openmhs-cli    # installs openmhs and openmhsd
openmhs demo                                        # guided tour, about 10 seconds

Then run the gateway yourself, or connect your own device, from the docs. The full demo run is on the reports page.

Where it fits

AI agents already use software tools through the Model Context Protocol (MCP). OpenMHS speaks MCP to agents, and Modbus TCP, MQTT, SCPI, HTTP, OPC UA and ROS 2 to machines. In between it adds what physical work needs: units, limits, approvals, uncertain outcomes and evidence. Read what it is for the background, or how it works for the details.

Status: pre-alpha. Release engineering (milestone M10) is built but nothing is published yet. Every adapter has been tested against simulators; none has been run against physical hardware by the project. OpenMHS is a supervisory layer, not a safety system: emergency stops and interlocks belong to the hardware.