dsview-mcp
Local MCP server for building an agent-facing integration around DreamSourceLab DSView.
Current scope:
- detect the local
DSViewinstallation and decoder/resource directories - detect currently attached DreamSourceLab USB devices
- enumerate installed DreamSourceLab-compatible protocol decoders
- inspect DSView session files (
.dsc) and capture bundles (.dsl) - list shipped default session presets
- build a native probe helper against the DSView source tree
- probe devices through DSView's native
ds_*API - run buffered native single-shot logic captures with sample-rate, sample-count, channel-enable, and simple-trigger control
- return raw-capture metadata plus a quick first-pass signal activity summary
- run native single-decoder protocol decode against saved raw captures
- run native linear decoder stacks against saved raw captures
- provide protocol-specific stack entry points for
I2C,SPI, andUART - analyze decoded captures for line health, transaction structure, and common protocol-level anomalies
- export structured decoder annotations as JSON plus a small preview in the MCP response
- create managed session artifact bundles with manifests, raw captures, decoder output, analysis JSON, and run reports
- persist trigger/timing artifacts plus structured findings alongside capture/decode/analyze runs
- persist event-window artifacts as raw capture snippets around findings, I2C transactions, and SPI transfers
- run UART baudrate/inversion sweeps and SPI mode/bit-order sweeps with confidence scoring
- expose a Codex-friendly standard workflow path with a preflight smoke test and protocol-specific capture entry points
- export managed session artifact bundles as ZIP files
- run end-to-end
capture_and_analyze_*workflows forI2C,SPI, andUARTthat persist their artifacts automatically, including optional sweep reports
Why this exists:
DSViewexposes rich logic-analyzer features in the GUI: trigger configuration, protocol decoder stacks, result search/export, and session save/load- the installed
DSViewbinary on this machine only exposes a minimal CLI (--help,--version,--loglevel,--storelog, optional file argument) - the DSView source tree includes the real low-level APIs in
libsigrok4DSLandlibsigrokdecode4DSL
Important findings from the current machine:
DSViewis installed at/usr/local/bin/DSView- decoder scripts are installed under
/usr/local/share/libsigrokdecode4DSL/decoders - default session presets are installed under
/usr/local/share/DSView/res - the
DSViewexecutable exportsds_*,sr_*, andsrd_*symbols, but it cannot be loaded directly viactypesbecause it is a PIE executable - a native helper can be built locally against the DSView source tree and can already enumerate devices through
ds_get_device_list() - the currently attached hardware is detected natively as
DSLogic PLus - native buffered logic capture now works against the attached
DSLogic PLusfrom the MCP server without GUI automation - native single-decoder protocol decode now works through
libsigrokdecode4DSL - native linear decoder stacks now work through
libsigrokdecode4DSLsession stacking - protocol-aware analysis now works on top of decoded output for
I2C,SPI, andUART - session artifact handling now works for managed capture/decode/analyze runs, including ZIP export
- timing artifacts now include trigger metadata, capture health, and per-channel edge/pulse summaries
- timing artifacts now include I2C bus-free / ACK metrics and SPI transfer / clock metrics
- findings artifacts now include AI-friendly diagnostic findings with severity, evidence, sample ranges, and next actions
- event windows now include raw binary slices plus an index JSON for quick drill-down from findings to signal excerpts
- parameter sweeps now compare UART baudrate/inversion candidates and SPI mode/bit-order candidates, then rank them with confidence scores
- sweep findings now emit actionable mismatch hints such as suspected UART baudrate or SPI mode mismatches
- a
dsview_smoke_testtool now verifies DSView installation, decoder inventory, native helper build, device visibility, and optional live capture - synthetic verification succeeded with
0:uarton generated test data and produced one decoded byte annotation (0x55) - synthetic verification succeeded with
1:uart -> midiand produced a decoded MIDI note-on annotation - synthetic verification succeeded with
1:spi -> spiflashand produced a decodedRDIDcommand annotation - synthetic verification succeeded with
1:i2cand produced decoded bus/address/data annotations - live verification succeeded on the attached
DSLogic PLus: capture plus decoder execution completed headless without crashes and returned zero annotations on an idle capture - live verification of the analysis layer succeeded on an idle UART-style capture and correctly flagged channel
0asstuck-lowwithNo UART bytes decoded - managed session artifact verification succeeded on a headless UART capture-and-analyze run and produced a session manifest plus exported ZIP bundle
- live verification now also persists timing and findings artifacts for managed session runs
What is still missing for fuller phase 2 coverage:
list_devicesselect_devicelist_device_modeslist_device_configcapture_repeatexport_decoder_results- richer trigger models beyond the current simple-trigger path
.dsc/.dslsession round-trip for captures and decoder setups- importing arbitrary existing captures/decodes into a managed artifact session
Recommended architecture for phase 2:
- Extend the native helper from probe/capture into config-list and decoder commands.
- Wrap those commands from this MCP server.
- Keep
.dscand.dslfile compatibility so the agent can round-trip with the DSView GUI.
Why not automate the GUI directly:
- it is fragile
- it does not return structured machine-readable decode data
- it is difficult to make reliable for unattended debugging sessions
This repository now provides discovery/introspection, real native single-shot logic capture, single-decoder decode, linear decoder stacks, protocol-aware analysis, and managed session artifact handling with direct entry points for I2C, SPI, and UART. The next step is richer config listing, more trigger coverage, import of existing artifacts, and fuller DSView session import/export.
Recommended Codex standard path:
- Run
dsview_smoke_test(live_capture=true)before a live debug session. - Use one of
capture_and_analyze_i2c_native,capture_and_analyze_spi_native, orcapture_and_analyze_uart_nativeas the primary artifact-producing workflow. - Enable
run_parameter_sweep=truefor SPI/UART when decode quality is uncertain. - Use
recommended_debug_workflows(protocol=...)to retrieve the MCP's preferred workflow sequence and default arguments.