MCP server exposing sigrok-cli functionality
Project description
mcp-sigrok — MCP server for sigrok-cli
MCP server that exposes all functionality of sigrok-cli as MCP tools. sigrok-cli is a cross-platform command-line utility for the sigrok software suite, used for hardware initialization, acquisition, protocol decoding, and saving logic analyzer sessions.
Install
pip install mcp-sigrok
Requirements
- sigrok-cli must be installed on the system
Installing sigrok-cli
Debian/Ubuntu:
sudo apt install sigrok-cli
macOS:
brew install sigrok-cli
From source:
git clone git://sigrok.org/sigrok-cli
cd sigrok-cli
./autogen.sh
./configure
make
sudo make install
Usage
As MCP Server
# Run as stdio MCP server
mcp-sigrok
Or configure in your MCP settings:
{
"mcpServers": {
"sigrok": {
"command": "mcp-sigrok"
}
}
}
Python API
from mcp_sigrok import (
check_sigrok_cli,
get_version,
list_drivers,
scan_devices,
capture_samples,
load_input_file,
)
# Check if sigrok-cli is available
if cli_path := check_sigrok_cli():
print(f"Found sigrok-cli at: {cli_path}")
# Get version info
info = get_version()
# List available drivers
drivers = list_drivers()
# Scan for devices
devices = scan_devices()
# Capture samples
result = capture_samples("fx2lafw", samples=1000)
MCP Tools
| Tool | Description |
|---|---|
version |
Get sigrok-cli version info |
list_supported |
List all supported features |
list_hardware_drivers |
List available hardware drivers |
list_input_file_formats |
List supported input formats |
list_output_file_formats |
List supported output formats |
list_protocol_decoders |
List available protocol decoders |
scan_for_devices |
Scan for detectable devices |
show_device_info |
Show device info for a driver |
capture |
Capture samples from hardware |
capture_for_time |
Capture data for duration |
load_file |
Load and process input file |
show_decoder_docs |
Show protocol decoder docs |
set_config |
Set driver configuration |
Examples
Capture from logic analyzer
# Capture 1000 samples from fx2lafw device
result = capture(
driver="fx2lafw",
samples=1000,
channels="0-7",
output_format="hex"
)
Decode I2C protocol
# Load capture file and decode I2C
result = load_file(
input_file="capture.sr",
protocol_decoders="i2c",
output_file="decoded.txt"
)
Scan for devices
# Find available devices
devices = scan_for_devices()
for device in devices.get("devices", []):
print(f"Found: {device}")
Development
git clone https://github.com/daedalus/mcp-sigrok.git
cd mcp-sigrok
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/
mcp-name: io.github.daedalus/mcp-sigrok
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_sigrok-0.1.0.tar.gz.
File metadata
- Download URL: mcp_sigrok-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbaa43e6e59d91286deaca92de0ef4fdeadf009a69935b3bfd9d4a40299d6c9
|
|
| MD5 |
3e0b2093af95073bf14d474539cff513
|
|
| BLAKE2b-256 |
6c2e5601105d3c36ec28c93d53c53204d36356c2f89234c88e63463460044234
|
Provenance
The following attestation bundles were made for mcp_sigrok-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on daedalus/mcp-sigrok
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_sigrok-0.1.0.tar.gz -
Subject digest:
3bbaa43e6e59d91286deaca92de0ef4fdeadf009a69935b3bfd9d4a40299d6c9 - Sigstore transparency entry: 1332829212
- Sigstore integration time:
-
Permalink:
daedalus/mcp-sigrok@4c58b69f4aa568e3655a289df5842ef0d3604c9d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4c58b69f4aa568e3655a289df5842ef0d3604c9d -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_sigrok-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_sigrok-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4749327d0061abb57e024539cd5e65b73fe220a0e69697ab898d1973c5ae4f9
|
|
| MD5 |
c7da275f682225d13caef6bd6b6f9595
|
|
| BLAKE2b-256 |
6db187ea555aaa6ef320edbc284dafa3e8e205f6c1dd44cc6c32014a58234f19
|
Provenance
The following attestation bundles were made for mcp_sigrok-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on daedalus/mcp-sigrok
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_sigrok-0.1.0-py3-none-any.whl -
Subject digest:
f4749327d0061abb57e024539cd5e65b73fe220a0e69697ab898d1973c5ae4f9 - Sigstore transparency entry: 1332829279
- Sigstore integration time:
-
Permalink:
daedalus/mcp-sigrok@4c58b69f4aa568e3655a289df5842ef0d3604c9d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4c58b69f4aa568e3655a289df5842ef0d3604c9d -
Trigger Event:
release
-
Statement type: