Skip to main content
Glama
saleae-mso-mcp

saleae-mso-mcp

saleae-mso-mcp

A Model Context Protocol server for the Saleae Logic MSO mixed-signal oscilloscope. It lets Claude (or any MCP client) configure the scope, run timed or edge-triggered captures, and read back measurements and waveforms, all from a chat.

Saleae's built-in Logic 2 MCP server supports their logic analyzers but not the Logic MSO yet. This project fills that gap by talking to the hardware directly through Saleae's official saleae-mso-api, with no Logic 2 GUI involved.

Status: alpha. Developed against the Logic MSO on Linux. Feedback and PRs welcome.

What the model gets

Raw scope data is millions of samples, far too much for a context window. The server therefore returns facts first and points on request:

Tool

Purpose

get_device_info

Is an MSO connected? Serial, part number, capture folder.

capture_timed

Capture for N seconds.

capture_triggered

Wait for an analog edge, capture around it (t = 0 at trigger).

list_captures / get_capture_summary

Browse saved captures.

measure

Min/max/mean/RMS/AC-RMS, Vpp, frequency, period, duty cycle, 10–90 % rise/fall, or edge stats for logic channels, over any time window.

get_waveform

[time, volts] points, min/max-decimated so glitches survive.

get_digital_transitions

Initial state + edge times of a logic channel.

export_csv

Full-resolution CSV written next to the capture.

delete_capture

Remove a capture.

release_device

Hand the USB device back to Logic 2.

Every capture is saved to disk (default ~/.local/share/saleae-mso-mcp/captures) and can be re-analysed later, even after a restart.

Related MCP server: logic-analyzer-ai-mcp

Install

Requirements: Python ≥ 3.11, a Logic MSO, and Logic 2 ≥ 2.4.20 installed once (it provides the USB drivers / udev rules).

git clone https://github.com/magradze/saleae_mso_mcp.git
cd saleae_mso_mcp
uv sync --extra hardware

With plain pip:

python -m venv .venv && . .venv/bin/activate
pip install -e '.[hardware]' --extra-index-url https://downloads.saleae.com/pypi/

On Linux without Logic 2, install the udev rules: python -m saleae.mso_api.utils.install_udev.

Connect to Claude

Claude Desktop: edit claude_desktop_config.json (Linux ~/.config/Claude/, macOS ~/Library/Application Support/Claude/, Windows %APPDATA%\Claude\):

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

Claude Code:

claude mcp add saleae-mso -- uv --directory /path/to/saleae-mso-mcp run saleae-mso-mcp

Restart the client, then ask something like "capture CH1 for 10 ms at 1 GS/s and tell me the frequency and rise time".

Only one program can own the MSO at a time. Close Logic 2 before capturing, or ask the model to call release_device before reopening Logic 2.

Try it without hardware

uv run saleae-mso-mcp --backend simulated

The simulated backend produces deterministic sine waves on analog channels and square waves on logic channels. It is what the test suite and CI use.

Configuration

Env var

CLI flag

Default

SALEAE_MSO_BACKEND

--backend

hardware (simulated for no device)

SALEAE_MSO_SERIAL

--serial

first MSO found

SALEAE_MSO_CAPTURE_DIR

--capture-dir

~/.local/share/saleae-mso-mcp/captures

SALEAE_MSO_CAPTURE_TIMEOUT

60 seconds

SALEAE_MSO_MAX_POINTS

2000 waveform points per call

SALEAE_MSO_MAX_TRANSITIONS

1000 edges per call

SALEAE_MSO_MAX_SAMPLE_RATE

1.6e9; used when a capture omits sample_rate_hz

SALEAE_MSO_AUTO_MAX_SAMPLES

20000000 samples per channel before that rate is divided down

--transport streamable-http runs the server over HTTP instead of stdio.

Architecture

saleae_mso_mcp/
├── server.py        MCP tools: thin layer, validation + error mapping
├── service.py       application service: locking, persistence, result shaping
├── analysis.py      pure numpy measurements and min/max decimation
├── domain.py        backend-neutral requests (pydantic) and capture data
├── store.py         on-disk capture repository + small LRU cache
├── settings.py      env/CLI configuration
├── cli.py           entry point
└── backends/
    ├── base.py      Backend protocol
    ├── hardware.py  Logic MSO via saleae-mso-api (imported lazily)
    └── simulated.py synthetic signals for tests and demos

Adding support for another instrument means writing one more backend.

Development

uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check .

License

MIT © Giorgi Magradze. Not affiliated with Saleae, Inc. "Saleae" and "Logic MSO" are trademarks of their respective owners.

Available Tools

11 tools
capture_timedB

Capture for a fixed duration and return a per-channel measurement summary.

If you set sample_rate_hz, keep duration_s * sample_rate_hz to tens of millions of samples at most.

Inputs: duration_s (required), label, analog, digital, +2 more.

capture_triggeredA

Wait for an analog edge trigger, capture around it (t = 0 at the trigger) and summarise.

Inputs: analog (required), trigger (required), label, digital, +5 more.

delete_captureB
DestructiveIdempotent

Permanently delete a saved capture and its files.

Inputs: capture_id (required).

export_csvA
Idempotent

Write full-resolution channel data to a CSV file inside the capture folder and return its path.

Inputs: channel (required), capture_id (required), stop_s, start_s.

get_capture_summaryC
Read-only

Settings and per-channel measurements of a saved capture.

Inputs: capture_id (required).

get_device_infoA
Read-only

Report whether a Logic MSO is connected, its serial and part number, and where captures are saved.

Inputs: no named parameters.

get_digital_transitionsC
Read-only

Initial state and transition times of a digital channel within a window.

Inputs: channel (required), capture_id (required), stop_s, start_s, +1 more.

get_waveformA
Read-only

Return [time_s, volts] points for an analog channel.

Long windows are reduced with min/max decimation so spikes and glitches are kept. Narrow the window to see full resolution.

Inputs: channel (required), capture_id (required), stop_s, start_s, +1 more.

list_capturesB
Read-only

List saved captures, newest first.

Inputs: limit.

measureA
Read-only

Measure one channel over a time window.

Analog: min/max/mean/RMS/AC-RMS, peak-to-peak, frequency, period, duty cycle, rise/fall (10-90%). Digital: edge counts, frequency, duty cycle, min/max pulse width.

Inputs: channel (required), capture_id (required), stop_s, start_s.

release_deviceA

Close the USB connection so Logic 2 or another program can use the MSO. Reopens on the next capture.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools target clearly distinct actions and resources, such as listing/deleting captures versus capturing or exporting data. The main overlap is between get_capture_summary and measure, both reporting measurements, though the descriptions distinguish whole-capture summary from windowed single-channel measurement.

    Naming Consistency4/5

    Names generally follow a verb_noun pattern like get_capture_summary, delete_capture, and export_csv. Minor deviations exist: measure is a bare verb, and capture_timed/capture_triggered use an adjective rather than a clear object noun.

    Tool Count5/5

    Eleven tools is well within a reasonable scope for a hardware capture/measurement server. Each tool covers a distinct operation in the capture workflow, with no obvious filler tools.

    Completeness4/5

    The set covers device discovery, capture creation, listing/deletion, measurement, waveform access, digital transitions, export, and device release. Minor gaps include no explicit trigger-configuration tool beyond analog edge triggering and no capture rename/metadata editing.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables remote control and automation of Saleae logic analyzers for capture, export, and protocol decoding.
      11
      -
    • A
      license
      C
      quality
      C
      maintenance
      Enables MCP clients like Cursor to control logic analyzers, open capture files, decode buses such as Intel 8080, and reconstruct display framebuffers like ST7789.
      19
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Exposes capture, protocol decode, timing measurement, trigger, and export workflows from Logic 2 as MCP tools. Enables AI-assisted embedded debugging, protocol validation, and repeatable firmware testing through MCP hosts.
      4
      Apache 2.0