API & MCP
Everything a person can do on Ohmforge UART, I²C and SPI Protocol Decoder, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://ohmforgeprotocoldecoder.usefulweb.app/api/v1/calculate– run Ohmforge UART, I²C and SPI Protocol DecoderGET https://ohmforgeprotocoldecoder.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Ohmforge UART, I²C and SPI Protocol Decoder
Decodes serial buses from a capture: UART with automatic baud-rate detection and 5–9 data bits, parity and stop bits (8N1, 8E1, 7E1 …), I²C with START/repeated START/STOP, 7- and 10-bit addresses, read/write and ACK/NACK, and SPI in all four CPOL/CPHA modes with chip select, 4–32 bit words and MSB or LSB first. Reads sigrok/PulseView and logic-analyzer CSV (sampled or one row per change) and oscilloscope CSV, where analog channels are converted to logic levels with a threshold and hysteresis. Returns a frame table with error flags (framing, parity, break, NACK, incomplete words) and a timing diagram.
| Field | Type | Default | Description |
|---|---|---|---|
file | file | — | Capture file. CSV from a scope (Rigol, Siglent, Keysight, Tektronix or any "time, channel…" table), a sigrok/PulseView or logic-analyzer CSV, or a WAV recording; up to 25 MB and 2 million rows. Files are processed in memory and not kept. |
csv | textarea | — | Or paste the CSV text. Used when no file is uploaded. |
sampleRate | number | — | Sample rate (only if the file has no time column) |
protocol (required) | select (uart, i2c, spi) | "uart" | Protocol |
rx | text | — | UART: channel to decode. Channel name from the file header, e.g. RX, D0 or CH1. Empty = automatic. |
scl | text | — | I²C: SCL channel |
sda | text | — | I²C: SDA channel |
sclk | text | — | SPI: clock channel |
mosi | text | — | SPI: MOSI channel. "none" if not captured. |
miso | text | — | SPI: MISO channel. "none" if not captured. |
cs | text | — | SPI: chip-select channel. "none" if not captured. |
baud | integer | — | UART: baud rate. Empty or 0 = detect from the shortest pulses. |
dataBits | select (5, 6, 7, 8, 9) | "8" | UART: data bits |
parity | select (none, even, odd, mark, space) | "none" | UART: parity |
stopBits | select (1, 1.5, 2) | "1" | UART: stop bits |
inverted | boolean | false | UART: inverted line (idle low) |
cpol | select (auto, 0, 1) | "auto" | SPI: clock polarity (CPOL) |
cpha | select (0, 1) | "0" | SPI: clock phase (CPHA) |
wordBits | integer | 8 | SPI: bits per word |
bitOrder | select (msb, lsb) | "msb" | SPI: bit order |
csActive | select (low, high) | "low" | SPI: chip select active |
threshold | number | — | Logic threshold for analog channels (optional). Empty = midway between the low and high levels found in the capture. |
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://ohmforgeprotocoldecoder.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_protocol_decoder - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-protocol-decoder
{
"mcpServers": {
"ohmforge-protocol-decoder": { "type": "http", "url": "https://ohmforgeprotocoldecoder.usefulweb.app/mcp" }
}
}