Skip to main content

boardex-logic

MCP server that lets a Boardex agent capture and decode digital signals with a logic analyzer. First backend: sigrok (sigrok-cli), which supports the Kingst LA series (LA1010/LA1016/LA2016/LA5016/LA5032 via the kingst-la2016 driver), cheap FX2 clones (fx2lafw), and dozens of other analyzers. New analyzers plug in without changing any tool.

Tools exposed to the agent

Tool What it does
list_analyzers Discover connected logic analyzers
get_capabilities Channels, sample rates, and trigger types of one device
capture Acquire samples; returns a compact per-channel edge list
decode_bus Capture + decode a bus (I2C/SPI/UART/...) into transactions
capture_during Trigger-armed short bus capture for sporadic traffic (defaults tuned for I2C)

Every tool returns an OperationResult (verdict, summary, data, ...), so the agent branches on a machine-readable outcome, never on prose.

Measurements first, then compact transitions

An acquisition can be millions of samples wide, and an agent shouldn't have to do physics on a raw array. So capture returns per-channel measurements the agent branches on directly, plus a compact transition list for detail:

  • data.measurements[ch] — active (did it toggle?), edges, frequency_hz (estimated fundamental), duty_cycle (0..1), min_pulse_width_s (surfaces glitches/runt pulses).
  • data.transitions[ch] — [[sample_index, level], ...] (edges only), clipped for size on very busy channels; the exact counts live in measurements.
  • data.sample_rate_hz, data.num_samples, data.duration_s.

The requested sample count is honored deterministically (streaming analyzers like the LA1010 over-deliver; the extra is clamped) so a sample index maps to real time.

dev = list_analyzers()["data"]["devices"][0]["device_id"]
caps = get_capabilities(dev)["data"]           # pick a valid rate/channels
cap = capture(dev, channels=[0, 1], sample_rate_hz=10_000_000,
              num_samples=100_000, trigger_channel=0, trigger_edge="rising")
m = cap["data"]["measurements"]["CH0"]
if m["active"] and abs(m["frequency_hz"] - 1_000_000) < 1_000:
    ...                                         # clock is ~1 MHz as expected

Decoding buses

decode_bus runs a libsigrokdecode protocol decoder over a fresh capture so the agent can check a bus against a datasheet instead of eyeballing waveforms:

decode_bus(dev, protocol="i2c", channel_map={"scl": 0, "sda": 1},
           sample_rate_hz=4_000_000, num_samples=200_000)
# -> data.annotations: [{"start":..., "end":..., "decoder":"i2c", "text":"START"}, ...]
decode_bus(dev, protocol="uart", channel_map={"rx": 0},
           options={"baudrate": "115200"}, duration_s=0.05)

Verdict is inconclusive if nothing decoded (wrong channel map, sample rate too low, or an idle bus) rather than a hard failure.

Install

# from the repo root
pip install -e servers/boardex-core
pip install -e servers/boardex-logic

This package shells out to a system-installed sigrok-cli (it is not a Python dependency). list_analyzers().data.backends is empty until sigrok is on PATH. Install it with your package manager, e.g. apt install sigrok-cli.

Kingst LA series caveat: the kingst-la2016 driver was added after libsigrok 0.5.2, so distro packages (e.g. Debian bookworm's sigrok-cli) are too old to drive Kingst devices — build libsigrok/sigrok-cli from git master. These analyzers also need a vendor firmware + FPGA bitstream uploaded on every plug-in; extract them from the KingstVIS software with sigrok-fwextract-kingst-la2016 (from sigrok-util) and drop them in ~/.local/share/sigrok-firmware/. Without the blobs --scan shows the device but capture fails. See docs/kingst-la-bringup.md.

Run

boardex-logic          # runs over stdio, the transport MCP clients use

Register it with an MCP client

{
  "mcpServers": {
    "boardex-logic": { "command": "boardex-logic" }
  }
}

Add a new analyzer backend

Backends are discovered as plugins — your adapter can live in its own pip-installable package with zero changes to this one:

  1. Implement boardex_core.LogicAnalyzer.
  2. Publish an entry point in your pyproject.toml:
[project.entry-points."boardex.logic_backends"]
saleae = "boardex_saleae.adapter:SaleaeAdapter"
  1. Prove conformance with the shared suite (boardex_core.testing.LogicAnalyzerConformance).

That's it — pip install your package and the backend appears in list_analyzers(). No tool or agent changes. See ../CONTRIBUTING.md and ../../docs/ARCHITECTURE.md.

Metadata

Release files for boardex-logic 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boardex-logic 0.1.0
File Size Uploaded Provenance Actions
boardex_logic-0.1.0.tar.gz 25.5 kB Without provenance Details for boardex_logic-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for boardex-logic 0.1.0
File Interpreter ABI Platform Actions
boardex_logic-0.1.0-py3-none-any.whl Python 3 none any Details for boardex_logic-0.1.0-py3-none-any.whl

Total release size: 49.7 kB

Release files / boardex_logic-0.1.0.tar.gz

Download URL boardex_logic-0.1.0.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d076a49b35b3c20f64f8bb6065e49268a2788d97e87629c86a4e32072a8a358a
BLAKE2b-256 checksum
How to use checksums
c99584acb2b99e7e16f1a11ff29944a992262c1d3e75f04ca9a9caffb346d4a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / boardex_logic-0.1.0-py3-none-any.whl

Download URL boardex_logic-0.1.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7186b621a2209c3e960de051d71453b7593556e87927837d509e8f806706644d
BLAKE2b-256 checksum
How to use checksums
740fdae2de0cd759adc64ee9e6c98f23cc5de92c9fbd9232dc3036aeff408abf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for boardex-logic 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page