Skip to main content

Logic Analyzer AI MCP

An MCP (Model Context Protocol) server for interfacing with Saleae Logic analyzers. This tool allows AI assistants (like Claude) to control hardware logic analyzers, capture signals, and export data for analysis.

Features

  • Device Management: List connected devices, configure sample rates and channels.
  • Automation: Start and stop captures programmatically.
  • Data Export: Export captures to CSV/binary formats.
  • Analysis: Perform basic signal analysis (frequency, duty cycle, analog stats) directly via MCP.
  • Logic 2 Integration: Leverages the Saleae Logic 2 automation API for modern device support (Logic 8/16, Pro 8/16).
  • Adaptive Configuration: Works with fixed-voltage devices (like Logic 8) by correctly handling threshold settings.

Prerequisites

  1. Saleae Logic 2 Software: Must be installed and running.
  2. Enable Automation:
    • Open Logic 2.
    • Go to Preferences > Salese Logic 2 (or "Automation").
    • Enable "Enable scripting socket server".
    • Keep the default port 10430.

Installation

From PyPI (Easiest)

pip install logic-analyzer-mcp

Or with uv:

uv pip install logic-analyzer-mcp

From Source (For development)

  1. Clone the repository:

    git clone https://github.com/michelebergo/logic-analyzer-ai-mcp.git
    cd logic-analyzer-ai-mcp
    
  2. Create a virtual environment and sync dependencies:

    uv venv
    uv sync
    
  3. (Optional) Install manually if not syncing:

    uv pip install -e .
    

Usage

Running the MCP Server manually

To run the server and see available tools:

# Activate virtual environment first
.venv\Scripts\activate

# Run the server with Logic 2 automation enabled
python -m src.logic_analyzer_mcp --logic2

Configuration for Claude Desktop

To use this with Claude Desktop, add the following to your config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "saleae_logic": {
      "command": "c:\\path\\to\\logic-analyzer-ai-mcp\\.venv\\Scripts\\python.exe",
      "args": [
        "c:\\path\\to\\logic-analyzer-ai-mcp\\src\\logic_analyzer_mcp.py",
        "--logic2"
      ]
    }
  }
}

Note: Replace c:\\path\\to\\... with the actual absolute path to your project folder.

Available Tools

Once connected, the AI assistant will have access to tools like:

  • logic2_reconnect: Connect to the running Saleae software.
  • get_available_devices: List connected hardware or simulation devices.
  • create_device_config: Set up channels and sample rates.
  • capture_and_analyze_digital: One-shot capture + frequency/duty cycle analysis.
  • capture_and_analyze_analog: One-shot capture + voltage statistics.
  • start_capture / wait_capture / save_capture: Granular control over the capture workflow.
  • start_capture_with_trigger: Wait for a digital event (e.g. Rising Edge) before capturing.
  • add_protocol_analyzer: Add decoders like Serial, I2C, SPI to the capture.
  • export_analyzer_data: Export decoded text data to CSV.

Advanced Usage Examples

Using Digital Triggers

To capture only when a specific event happens:

  1. Configure device (create_device_config).
  2. Start trigger capture:
    # Example: Wait for Rising Edge on Channel 0, then record 1 second
    start_capture_with_trigger(
        device_config_name="my_config",
        trigger_channel_index=0,
        trigger_type="RISING",
        after_trigger_seconds=1.0
    )
    

Protocol Decoding (e.g. Serial)

To decode UART/Serial data and export the text:

  1. Perform a capture (standard or triggered).
  2. Add an analyzer:
    add_protocol_analyzer(
        name="Async Serial",
        label="MySerial",
        settings={
            "Input Channel": 0,
            "Bit Rate": 115200
        }
    )
    
  3. Export the decoded table:
    export_analyzer_data(
        filepath="C:\\temp\\serial_data.csv",
        analyzer_label="MySerial"
    )
    

Troubleshooting

  • "Connection Refused": Ensure Logic 2 is running and the scripting server is enabled on port 10430.
  • "Threshold Error": If using Logic 8 (which doesn't support variable thresholds), ensure you don't pass a digital_threshold_volts value (the tool handles this automatically now).

License

MIT

Metadata

Release files for logic-analyzer-mcp 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 logic-analyzer-mcp 0.1.0
File Size Uploaded Provenance
logic_analyzer_mcp-0.1.0.tar.gz 29.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for logic-analyzer-mcp 0.1.0
File Interpreter ABI Platform
logic_analyzer_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.9 kB

Release files / logic_analyzer_mcp-0.1.0.tar.gz

Download URL logic_analyzer_mcp-0.1.0.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90fbdfcdeecf0e853dcaec618832fd9224d657634c5713d7f35d957379f36df2
BLAKE2b-256 checksum
How to use checksums
415fdd14f5d48ab71dd694f74a90b02721b4d34c9804c47382204b41aadf0fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL logic_analyzer_mcp-0.1.0-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5c95ca268599186456d22b9f8ab7fe393eab3da2477bc574f7775509c1768cc
BLAKE2b-256 checksum
How to use checksums
438e7e1c5483ad170da52ab895aa94271a6b89e9c73f8e287c8a4e10d6e90863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for logic-analyzer-mcp 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