Skip to main content
Glama

logic-mcp

Vendor-neutral MCP server for logic analyzers. Cursor (or any MCP client) can capture from hardware, open a trace file, decode a bus, and reconstruct a display framebuffer.

DreamSourceLab / DSView, Saleae, and VCD are plugins, not the product name.

Cursor ── stdio MCP ── logic-mcp
                         ├─ in-process: mock / sigrok_cli / dslogic
                         └─ ipc / dsview ── Unix socket ── vendor process
                              └─ LogicCapture → bus decode → DCS log / PNG

What it does

  • Live instrument control — scan, configure, start/stop/wait, export.

  • Offline files — open a capture (DSView CSV today; Saleae CSV / VCD are stubs).

  • Bus decode — Intel 8080 / MCU 8080 parallel is implemented; SPI, I2C, UART are stubs with roles reserved.

  • Upper decode — MIPI DCS / ST7789 command log + optional PNG reconstruction.

Vendors attach in either way:

  1. In-process — Python InstrumentBackend registered on logic_mcp.instruments.

  2. IPC — a long-lived process speaking logic_mcp.instrument.v1 on a Unix socket (patched DSView, or the reference hub logic-mcp-instrument).

MCP tool names stay vendor-neutral. Do not add dsview_set_rate-style tools.

Related MCP server: mcp-sigrok

Status

Layer

Implemented

Stub / placeholder

Instruments

mock, ipc, dsview, sigrok_cli, dslogic

saleae_live

Capture files

DSView / libsigrok4DSL CSV

Saleae CSV, VCD

Buses

i8080

spi, i2c, uart

Devices

mipi_dcs + st7789 profile

other panels via extra YAML

Requirements

  • Python 3.11+

  • uv (recommended) or pip

  • Optional: sigrok-cli on PATH (or SIGROK_CLI) for live sigrok_cli / dslogic

  • Optional: DSView rebuilt with the patch in vendor/dsview (listens on $XDG_RUNTIME_DIR/logic-mcp/dsview.sock)

Install

git clone https://github.com/dengtaowei/logic-mcp.git
cd logic-mcp
uv sync --extra dev
uv run pytest

Cursor MCP

Add to Cursor MCP settings. Point --directory at your clone:

{
  "mcpServers": {
    "logic": {
      "command": "uv",
      "args": ["--directory", "/path/to/logic-mcp", "run", "logic-mcp"]
    }
  }
}

The server speaks MCP over stdio. It returns JSON summaries, not raw sample dumps.

Then open Agent chat and talk to the model; you do not run decode scripts. First session (ST7789 over 8080): examples/README.md.

Workflows

Offline CSV

capture_open(path) → bus_decode(protocol, channel_map)
                  → display_analyze          # command log
                  → display_reconstruct      # command log + PNG

channel_map is required. Values are CSV column names or 0-based indices. A DSView export named RS,CS,RD,WR,DB0…DB7 maps like examples/channel_maps/i8080_dsview.json (dc → RS, not CS).

PNGs land under out/ (or LOGIC_MCP_OUT).

Full config in MCP (mock / sigrok)

instrument_open(backend) → instrument_configure → instrument_capture
→ bus_decode → interpret

CaptureRequest fields: sample_rate_hz, channels, duration_s xor sample_count, optional trigger, extra. There is no channel_count; pass the channel name list.

Config in the vendor GUI (DSView)

Human sets rate, channels, and trigger in DSView. MCP only arms:

instrument_open("dsview") → instrument_start → instrument_wait → instrument_export

hello.configure=false means the GUI owns sample rate and channels. instrument_capture without sample_rate_hz is valid on those backends.

Instrument backends

id

Transport

Config owner

Notes

mock

in-process

MCP

Always available; for tests and the reference hub

sigrok_cli

in-process subprocess

MCP

Portable probe via sigrok-cli

dslogic

in-process subprocess

MCP

sigrok_cli filtered to DreamSourceLab drivers. USB is exclusive: close DSView first.

ipc

Unix socket

advertised by hub

Default $XDG_RUNTIME_DIR/logic-mcp/instrument.sock

dsview

Unix socket

GUI

Default $XDG_RUNTIME_DIR/logic-mcp/dsview.sock. Needs the vendor/dsview patch.

saleae_live

—

—

Unimplemented (Logic 2 Automation API)

Reference hub (wraps an in-process backend behind the socket):

uv run logic-mcp-instrument --socket "$XDG_RUNTIME_DIR/logic-mcp/instrument.sock"
# optional: --backend mock --gui-owned

IPC methods, framing, and states: src/logic_mcp/instrument/PROTOCOL.md.

MCP tools

Inventory: protocol_list, session_status.

Instrument: instrument_list, instrument_scan, instrument_open, instrument_close, instrument_capabilities, instrument_configure, instrument_capture, instrument_start, instrument_stop, instrument_wait, instrument_export.

Decode: capture_open, protocol_roles, bus_decode, interpret, display_analyze, display_reconstruct.

Extending

Entry points in pyproject.toml:

Group

What to implement

logic_mcp.instruments

InstrumentBackend + ConnectedInstrument

logic_mcp.captures

CaptureFormat → LogicCapture

logic_mcp.buses

BusDecoder + channel roles

logic_mcp.devices

upper decoder (e.g. MIPI DCS)

Out of process: listen on the Unix socket and implement hello / status / start / stop / wait / export (and configure / capabilities if you own config). Python reference: logic-mcp-instrument.

When a vendor’s own GUI/SDK must be patched, put a unified diff under vendor/<id>/ (pinned upstream commit + series). Do not copy their whole tree. First example: vendor/dsview.

Panel YAML (profiles/st7789.yaml, or LOGIC_MCP_PROFILES): width, height, offsets, extra DCS opcodes.

Environment

Variable

Purpose

LOGIC_MCP_OUT

Artifact directory (default ./out)

LOGIC_MCP_PROFILES

Extra panel YAML directory

LOGIC_MCP_INSTRUMENT_SOCK

Default ipc socket

LOGIC_MCP_DSVIEW_SOCK

Default dsview socket

SIGROK_CLI

Path to sigrok-cli if not on PATH

License

MIT for logic-mcp.

Patches under vendor/ are against other projects and keep that project’s license. vendor/dsview is GPLv3+ (DreamSourceLab DSView).

Available Tools

19 tools
bus_decodeBus DecodeB

Create a DecodeJob on the open capture. Same waveform can have several jobs (e.g. SPI + I2C).

Inputs: protocol (required), channel_map (required), t_max, t_min, +2 more. Returns: object

capture_openCapture OpenA

Load a capture/trace file. Returns capture_id and channels. Pin maps belong on bus_decode.

Inputs: path (required), format_id. Returns: object

display_analyzeDisplay AnalyzeC

Sugar: interpret MIPI DCS + command_log sink for a display profile.

Inputs: width, height, profile, col_offset, +3 more. Returns: object

display_reconstructDisplay ReconstructC

Sugar: interpret MIPI DCS + command_log + framebuffer sinks.

Inputs: width, height, out_dir, profile, +6 more. Returns: object

instrument_capabilitiesInstrument CapabilitiesA

Sample rates, channel names, trigger support for the open instrument.

Inputs: no named parameters. Returns: object

instrument_captureInstrument CaptureC

Run a blocking capture into the session. GUI-owned backends (dsview) do not need sample_rate_hz.

Inputs: extra, out_dir, channels, timeout_s, +5 more. Returns: object

instrument_closeInstrument CloseA

Release the open instrument. Does not delete the last LogicCapture.

Inputs: no named parameters. Returns: object

instrument_configureInstrument ConfigureA

Set live capture params (rate, channels, duration or samples, trigger). Does not start yet.

Inputs: sample_rate_hz (required), extra, channels, timeout_s, +4 more. Returns: object

instrument_exportInstrument ExportC

Ask the vendor hub to export the last capture and load it into the session.

Inputs: path, format, out_dir. Returns: object

instrument_listInstrument ListA

List live-capture backends (id, vendor, status, available, options_schema).

Inputs: no named parameters. Returns: object

instrument_openInstrument OpenB

Open a live backend (mock, dslogic, sigrok_cli, …). Returns device + capabilities.

Inputs: backend (required), extra, device_id. Returns: object

instrument_scanInstrument ScanB

Discover analyzers. Omit backend to scan every implemented backend that is available.

Inputs: backend. Returns: object

instrument_startInstrument StartB

Start capture on the open instrument. DSView uses whatever the GUI already configured.

Inputs: no named parameters. Returns: object

instrument_stopInstrument StopB

Stop an in-progress capture.

Inputs: no named parameters. Returns: object

instrument_waitInstrument WaitA

Block until capture completes or timeout_s.

Inputs: timeout_s. Returns: object

interpretInterpretC

Run an upper decoder on a DecodeJob. Default sink is command_log. Add framebuffer for PNG.

Inputs: sinks, width, height, job_id, +9 more. Returns: object

protocol_listProtocol ListA

List instrument backends, capture adapters, bus decoders, upper decoders, profiles, sinks.

Inputs: no named parameters. Returns: object

protocol_rolesProtocol RolesC

Channel roles and options_schema for a bus decoder.

Inputs: protocol (required). Returns: object

session_statusSession StatusC

Open capture plus all decode/interpret jobs and artifacts.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 19 tools

    Disambiguation3/5

    Most tools map to distinct workflow phases, but instrument_capture vs instrument_start plus wait, and display_analyze vs display_reconstruct, have closely overlapping responsibilities. protocol_list and instrument_list also both touch backends, so an agent could misselect without careful reading.

    Naming Consistency3/5

    The instrument_* family is consistently named and object_verb names like capture_open and bus_decode are readable, but interpret is a bare verb and instrument_capabilities, protocol_roles, and session_status are noun-style rather than action-style. This mixed convention is understandable but not fully predictable.

    Tool Count3/5

    19 tools sits in the 16-25 heavy band, though the logic-analyzer workflow is broad enough to justify many of them. Some consolidation is possible, especially around capture/start and the display sugar tools, without losing core capability.

    Completeness4/5

    The server covers the full capture-to-decode pipeline: discovery, opening instruments, configuration, capture, decode, upper decoding, display reconstruction, and session status. Minor gaps like explicit decode-job teardown or saved artifact handling are present but agents can generally work around them.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for BusPirate 6 hardware security testing. Exposes UART, SPI, I2C, 1-Wire, power supply, GPIO, and logic analyzer operations as tools.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that exposes all functionality of sigrok-cli as MCP tools, enabling hardware initialization, signal acquisition, and protocol decoding for logic analyzers.
      40 PyPI
      3
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Local MCP server for building an agent-facing integration around DreamSourceLab DSView. Enables native logic capture, protocol decode, and analysis with artifact management for I2C, SPI, and UART.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to launch and manage an owned Mindustry runtime, create logic fixtures, configure processors with mlog programs, observe live memory values, and verify program replacements with digest preconditions.
      7 npm
      1
      -