Specification · section 14

Bridging existing ecosystems

MHP is deliberately thin enough to sit on top of the control layers labs already run. The reference implementation ships an adapter for each, built on one mechanism: bindings. A binding pairs an MHP name with a callable into the foreign layer, and BoundDriver turns three lists of bindings into a complete MHP driver with every gate, tier, job and notification inherited.

from openmhp.adapters import BoundDriver, Signal, Setting, Action
dev = BoundDriver(
    device={"id": "hotplate-01", "class": "hotplate", "notes": "Fume hood 2."},
    signals=[Signal("plate_temperature", read=lambda: plc.read(0x10), unit="degC")],
    settings=[Setting("target_temperature", write=lambda v: plc.write(0x20, v), limits={"min": 20, "max": 300})],
    actions=[Action("shutdown", run=lambda job, p: plc.write(0x21, 0), approval="confirm")],
    estop=lambda: plc.write(0x21, 0))
LayerAdapterMapping
SiLA 2sila_device(host, port, …)Property → signal. One-parameter unobservable command → setting. Command → action; observable commands stream progress and accept cancel. Any stop command → estop. Leases replace LockController.
PyLabRobotplr_device(machine, …)Every public coroutine on a Machine → action with params from its signature. setup() on start, stop() on estop. Coroutines run on a private event loop.
MADScimadsci_node(url, …)Self-describing: /info actions → actions with params and notes; /state keys → signals; /status busy → ping state; /action plus polling → jobs; /admin/safety_stop → estop. No binding map needed.
OPC UA / Modbusopcua_device(url, …)Variable node → signal or setting. Method node → action with positional args. Abort method → estop. Modbus uses BoundDriver with two register callables.
ROS 2ros2_device(node, …)Topic subscription → signal. Topic publication → setting. Action server → action with feedback → progress and cancel. Trigger service → estop.

Adapters MUST implement the gates in §7 themselves. Wrapping a layer that lacks limits does not exempt the MHP server from enforcing them. The reference adapters get this for free from BoundDriver, and are tested against injected fakes so the mapping logic is verified without vendor libraries or hardware.

14.1 Agent Skills

MHP ships three Agent Skills so that any skills-capable harness can bring hardware under the protocol and operate it without bespoke prompting. Skills follow the same progressive-disclosure design as the protocol: a harness holds only their names and descriptions until a task matches.

SkillActivates whenDoes
openmhp-onboard-deviceone instrument to connectinterviews the owner, writes descriptor and driver, validates, serves, registers
openmhp-adapt-fleeta SiLA 2, PyLabRobot, MADSci, OPC UA or ROS 2 fleetone adapter file per device, manifest, directory, mhp-mcp config, proof checklist
openmhp-operateany task on connected hardwarethe find, describe, check, dry-run, act, verify loop; refusal handling; e-stop rules