Documentation
Quick start
From bare board to “Claude, click Start” in five steps. The example uses mcp-io-hid; the procedure is the same for every module, only the name changes.
1. Flash the firmware
Ordered modules ship pre-flashed, so you can skip straight to step 2. For a prototype you built yourself (on an ESP32-S3-DevKitC-1, for example):
- Install PlatformIO (the “PlatformIO IDE” VS Code extension, or
pip install platformio). - Clone the repository and open the firmware folder, for example
firmware/mcp-io-hid. - Connect the board's UART port to your computer, then run Upload and Monitor.
$ git clone https://github.com/mcp-io/mcp-io-gateway.git
$ cd mcp-io-gateway/firmware/mcp-io-hid
$ pio run -t upload
$ pio device monitor
2. Connect
- HID: plug the box's native USB port into the target machine. It sees a standard keyboard and mouse, no driver needed, right from the BIOS. Bluetooth LE is active at the same time: pair the box from the target's Bluetooth settings if you'd rather go wireless.
- HDMI / VGA: connect the target's video output to the box's input (a splitter lets you keep the local monitor; DisplayPort via an adapter).
- Cam: USB power is all it needs. Point it at whatever the LLM should watch, with steady lighting.
- Analog, lab version: USB power, 3.3 V signals maximum on the terminals.
- Analog, industrial version: clip the box onto the DIN rail, power it with 24 V, then wire its inputs in parallel with the lamps and sensors, and its relays in parallel with the control panel buttons. Wiring by a qualified person, with the machine locked out.
The box boots armed. The physical button: short press to arm or disarm, hold for 5 s to reboot into the setup portal. When disarmed, no action reaches the target. Keep it within reach during your first tests. On the DevKitC-1 prototype, it's the BOOT button. LED: green = armed, red = disarmed, blue = the LLM is acting, blinking purple = setup portal.
3. Set up Wi-Fi
- On first boot, the box creates a Wi-Fi access point called
mcp-io-setup-XXXX, passwordmcp-io-setup. - Connect your computer or phone to it: the portal opens automatically, otherwise go to http://192.168.4.1.
- Pick your network and a hostname, then write down the token shown during setup (randomly generated, and you can change it).
- Confirm: the box reboots and joins your network, for example as
mcp-io-hid.local.
The box only supports 2.4 GHz Wi-Fi. Keep it on a trusted local network, never directly on the internet. Inside a metal cabinet, plan for an external antenna.
4. Connect the LLM
Claude Code
$ claude mcp add --transport http mcp-io-hid http://mcp-io-hid.local/mcp --header "Authorization: Bearer <token>"
Replace <token> with the token from step 3. Repeat for each module (mcp-io-cam, mcp-io-hdmi…): each one is a separate MCP server. Give them meaningful names, such as lab-pc-keyboard or press-3-io.
Other MCP clients
Add an MCP server of type HTTP (Streamable HTTP) with the URL http://<hostname>.local/mcp and the header Authorization: Bearer <token>.
5. Test
Without an LLM, check that the box responds by listing its tools:
$ curl -s http://mcp-io-hid.local/mcp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Then, in Claude Code, try: “Open the Start menu, launch Notepad and type Hello.” With mcp-io-analog: “Read all channels and tell me whether the machine is in fault.”
Named channels (mcp-io-analog)
A channel gives an input or output a name, a meaning and a unit. The LLM reads hydraulic_pressure = 182 bar instead of “2347 mV on ADS1115 input 0”. The configuration is stored on the box.
- Types:
digital_in(lamp, limit switch, optocoupler output),digital_out(relay),analog_in(ESP32 ADC or the 16-bit ADS1115, recommended). - Inversion (
invert) for active-low signals, and labelson_label/off_label(“FAULT” / “OK”). - Linear scaling:
[in_min_mv, in_max_mv]→[out_min, out_max]+unit. A 4-20 mA, 0-250 bar sensor across a 150 Ω shunt: 600-3000 mV → 0-250 bar. A 0-10 V signal through a 10 k / 4.7 k divider: 0-3197 mV → 0-10 V. - Fault flag:
channels_readreports out-of-range values, typically a broken 4-20 mA loop.
# Example: hydraulic press
channel_define {"name":"fault_lamp","type":"digital_in","pin":4,"invert":true,"on_label":"FAULT","off_label":"OK"}
channel_define {"name":"cycle_running","type":"digital_in","pin":5,"invert":true}
channel_define {"name":"hydraulic_pressure","type":"analog_in","source":"ads1115","ads_channel":0,
"in_min_mv":600,"in_max_mv":3000,"out_min":0,"out_max":250,"unit":"bar"}
channel_define {"name":"cycle_start_button","type":"digital_out","pin":38,"description":"in parallel with the green panel button"}
The LLM can then chain: channels_read (“pressure 182 bar, no fault”), channel_write on cycle_start_button with pulse_ms: 300 to press the button, then wait_for until cycle_running goes off again.
MCP tools by module
Each box lists its tools through tools/list; the exact parameters are described in the schema it returns. Tools that act (outputs, keyboard, mouse, configuration) require the box to be armed.
mcp-io-hid
| Tool | What it does |
|---|---|
keyboard_type | Types a string of text |
keyboard_key | Key or shortcut: enter, ctrl+c, gui+r, ctrl+alt+delete, f5… |
mouse_move | Moves the pointer to absolute coordinates (pixels) |
mouse_click | Left, right or middle click, single or double, at (x, y) |
mouse_drag | Drag and drop from one point to another |
mouse_scroll | Scroll wheel |
set_screen_size | Sets the target's resolution (default 1920×1080) |
set_keyboard_layout | Target keyboard layout: us or fr |
device_status | Armed/disarmed state, connection to the target, layout, recent actions |
mcp-io-cam
| Tool | What it does |
|---|---|
camera_capture | Takes a photo, returned as MCP image content |
camera_settings | Resolution, brightness, contrast, mirroring… |
camera_flash | Turns the illumination LED on or off |
device_status | Module status and detected sensor |
mcp-io-hdmi (and mcp-io-vga)
| Tool | What it does |
|---|---|
screen_capture | Captures the target's screen, resized for the LLM |
capture_info | Detected signal, input resolution |
device_status | Module status |
VGA through a VGA-to-HDMI converter (built into mcp-io-vga), DisplayPort through a DP-to-HDMI adapter.
mcp-io-analog: named channels
| Tool | What it does |
|---|---|
channels_list | Channel configuration: type, wiring, labels, scaling, unit |
channels_read | Reads all channels (or some): states with labels, values in units, out-of-range fault flag |
channel_write | Output on/off, or a pulse_ms pulse to press a button through a relay |
wait_for | Waits until a channel is on/off or above/below a threshold (60 s max) |
channel_define | Creates or updates a channel: digital_in, digital_out, analog_in (GPIO or ADS1115), inversion, labels, scaling |
channel_delete | Deletes a channel and frees its pin |
mcp-io-analog: low-level tools
| Tool | What it does |
|---|---|
list_pins | Lists available pins, their capabilities and state |
gpio_mode | Configures a pin (input, output, pull-up, pull-down…) |
gpio_write | Writes a logic level |
gpio_read | Reads a logic level |
adc_read | Measures a voltage in mV (average, min, max) |
pwm_write | Generates a PWM signal (frequency, duty cycle) |
dac_write | Analog voltage 0-3.3 V (classic ESP32, GPIO 25/26) |
i2c_scan | Detects devices on the I2C bus |
i2c_read | Reads bytes from an I2C device |
i2c_write | Writes bytes to an I2C device |
config_save / config_clear | Saves or erases the pin configuration restored at boot |
device_status | Module status |
Security best practices
- Machine safety:
mcp-io-analogoutputs are wired in parallel with the normal controls, never into an emergency-stop, guard or light-curtain chain. - Start read-only (input channels, camera, screen capture); only add outputs once you trust how the LLM behaves.
- The box boots armed: disarm it (short press) when it's not in use. When disarmed, outputs switch off, keyboard and mouse are released and the camera is blocked.
- Use a long, unique token per box, and never commit it to a repository.
- Local network only: no port forwarding, no internet exposure. For remote access, go through a VPN.
- Traffic is unencrypted HTTP in the current version (TLS is planned), so use a trusted network.
- Watch the status LED and check
device_statusto see what the LLM has done.
Troubleshooting
- The
.localname doesn't resolve (common on Windows): use the box's IP address, shown in your router or in the serial monitor. - Actions are refused: the box is disarmed; check with
device_status. - Error 401: the token is missing or wrong in the
Authorizationheader. - Typed text comes out wrong (“a” becomes “q”): the layout doesn't match; call
set_keyboard_layoutwith the target's layout. - Clicks land in the wrong place: set the right resolution with
set_screen_size. - Bluetooth doesn't work in the BIOS: that's expected; use the USB connection.
- An analog channel reports a fault: the signal is out of range, often a broken 4-20 mA loop or reversed wiring; also double-check the declared scaling.
- A measured value is off: check
in_min_mv/in_max_mvagainstadc_read, and the shunt or divider values. wait_fortimes out: the maximum is 60 s; for longer waits, the LLM simply calls it again.
Source code
Firmware, architecture docs and project tracking: github.com/mcp-io/mcp-io-gateway.
Questions? contact@mcp-io.ai