sigrok MCP Server

v0.2.0
io.github.KenosInc/sigrok-mcp-server Checked 2 hours ago Published 9 months ago

Wraps sigrok-cli for signal analysis: capture data, decode protocols, and query instruments.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

capture_data

Capture communication data from a connected device and save to file. Either 'samples' or 'time' must be specified.

ParameterTypeDescription
driver *stringHardware driver ID (e.g. 'fx2lafw', 'demo')
channelsstringChannels to use (e.g. 'D0,D1,D2')
configstringDevice configuration (e.g. 'samplerate=1M')
connstringConnection string for serial/network devices (e.g. '/dev/ttyUSB0:serialcomm=115200/8n1')
output_filestringOutput filename (auto-generated if omitted)
samplesnumberNumber of samples to acquire
timenumberHow long to sample in milliseconds
triggersstringTrigger configuration (e.g. 'D0=r')
wait_triggerbooleanWait for trigger before capturing

check_firmware_status

Check firmware file availability in standard sigrok firmware directories. Returns which directories exist and what firmware files are present. Use this to diagnose device detection issues caused by missing firmware.

decode_protocol

Decode protocol data from a captured file using sigrok protocol decoders.

ParameterTypeDescription
input_file *stringInput filename
protocol_decoders *stringProtocol decoders to apply (e.g. 'uart:baudrate=9600')
annotationsstringDecoder annotation filter (e.g. 'uart=rx-data')
input_formatstringInput format (e.g. 'vcd', 'binary')
json_tracebooleanOutput in Google Trace Event JSON format
meta_outputstringDecoder meta output filter (e.g. 'uart=baud')
show_sample_numbersbooleanInclude sample numbers in output

get_device_profile

Look up a device profile by name, model, manufacturer, or *IDN? response string. Returns connection settings (baudrate, parity, etc.), supported commands with examples, and device-specific notes. Use this before serial_query to get the correct settings for a device.

ParameterTypeDescription
query *stringDevice name, model, manufacturer, or *IDN? response string to match against

list_input_formats

List all supported input file formats. Returns an array of {id, description} objects.

list_output_formats

List all supported output file formats. Returns an array of {id, description} objects.

list_supported_decoders

List all supported protocol decoders. Returns an array of {id, description} objects.

list_supported_hardware

List all supported hardware drivers. Returns an array of {id, description} objects.

scan_devices

Scan for connected hardware devices. Returns {devices, warnings, hint} where devices is an array of {driver, description} objects. Warnings indicate firmware-related issues for devices that could not be initialized. When driver and conn are provided, performs a targeted scan for a specific serial/network device (e.g. SCPI instruments). SCPI driver categories: 'scpi-dmm' (multimeters), 'scpi-pps' (power supplies), or vendor-specific drivers like 'rigol-ds' (oscilloscopes). Example: driver='scpi-dmm', conn='/dev/ttyUSB0:serialcomm=115200/8n1'.

ParameterTypeDescription
connstringConnection string for targeted scanning (e.g. '/dev/ttyUSB0:serialcomm=115200/8n1', 'tcp-raw/192.168.1.100/5555')
driverstringHardware driver ID for targeted scanning (e.g. 'scpi-dmm', 'scpi-pps', 'rigol-ds')

serial_query

Send a command string over a serial port and return the device response. Works with any serial-attached instrument that accepts text commands (e.g. SCPI). Independent of sigrok-cli.

ParameterTypeDescription
command *stringCommand to send (e.g. '*IDN?', 'MEAS:VOLT:DC?')
port *stringSerial device path (e.g. '/dev/ttyUSB0')
baudratenumberBaud rate (default 9600)
databitsnumberData bits: 5, 6, 7, or 8 (default 8)
paritystringParity: none, odd, even, mark, space (default 'none')
stopbitsstringStop bits: 1, 1.5, 2 (default '1')
timeout_msnumberRead timeout in milliseconds (default 1000)

show_decoder_details

Show detailed information about a specific protocol decoder, including options, channels, annotation classes, and documentation.

ParameterTypeDescription
decoder *stringProtocol decoder ID (e.g. 'uart', 'spi', 'i2c')

show_driver_details

Show detailed information about a specific hardware driver, including supported functions, scan options, and connected devices.

ParameterTypeDescription
driver *stringHardware driver ID (e.g. 'demo', 'fx2lafw', 'rigol-ds')

show_version

Show sigrok-cli version information, including library versions.