Rigol
БесплатноНе проверенAn MCP server for controlling Rigol DS1000Z series oscilloscopes over LAN using natural language. It enables users to take measurements, configure instrument se
Описание
An MCP server for controlling Rigol DS1000Z series oscilloscopes over LAN using natural language. It enables users to take measurements, configure instrument settings, and capture screenshots directly through an MCP client.
README
MCP server for controlling Rigol DS1000Z and DHO series oscilloscopes over LAN or USB. Exposes the scope as a set of tools that Claude (or any MCP client) can call to take measurements, configure the instrument, and capture screenshots — entirely through natural language.

Example: unknown signal characterisation in Claude
Unknown signal (square wave into LCR trap), wrong channel enabled, invalid timebase/voltage/trigger. Claude identifies the signal type, corrects the setup, and characterises the waveform.

Supported Hardware
Rigol DS1000Z / MSO1000Z series (8-bit):
| Model | Channels | Notes |
|---|---|---|
| DS1054Z | 4 analog | Most common, 50 MHz |
| DS1074Z | 4 analog | 70 MHz |
| DS1074Z-S | 4 analog + signal gen | |
| DS1104Z | 4 analog | 100 MHz |
| DS1104Z-S | 4 analog + signal gen | |
| MSO1054Z | 4 analog + 16 digital | MSO variant |
| MSO1074Z | 4 analog + 16 digital | |
| MSO1104Z | 4 analog + 16 digital |
Rigol DHO series (12-bit):
| Model | Channels | Notes |
|---|---|---|
| DHO924S | 4 analog + signal gen | 250 MHz |
Other DHO models (DHO900/1000/4000 families) likely work with the same SCPI dialect but are not verified.
The scope connects either over your local network via Ethernet (rear panel RJ45) or over USB (rear panel USB-B device port). LAN is the default; USB is used when RIGOL_USB is set (see Configuration). USB transport has been validated on DS1000Z; DHO support has so far been validated over LAN only.
Requirements
- Python 3.11+
- uv
- A Rigol DS1000Z (LAN or USB) or DHO series scope (LAN) connected to your computer
- For LAN: SCPI over TCP/IP enabled on the scope (on by default)
- For USB: a VISA driver on the scope's USB interface — either the native USBTMC driver (e.g. from Rigol UltraSigma / any NI-VISA runtime) or WinUSB via Zadig (see USB connection)
Installation
git clone https://github.com/erebusnz/rigol-mcp
cd rigol-mcp
uv sync
Scope Network Setup
On the scope, go to Utility → IO Setting → LAN and note the IP address (or assign a static one). The scope listens on port 5555 for raw SCPI commands — no additional configuration is needed.
Replace 192.168.1.123 with the IP address of your scope in all instructions below.
Verify in browser: http://192.168.1.123/DS1000Z_WelcomePage.html
Verify connectivity before using as MCP:
python -c "import pyvisa; rm = pyvisa.ResourceManager('@py'); s = rm.open_resource('TCPIP0::192.168.1.123::5555::SOCKET'); s.write_termination='\n'; s.read_termination='\n'; print(s.query('*IDN?'))"
You should see something like:
RIGOL TECHNOLOGIES,DS1054Z,DS1ZA123456789,00.04.04.SP4
Configuration
Set the scope IP for MCP via environment variable:
export RIGOL_IP=192.168.1.123
Or create a .env file (copy from .env.example):
RIGOL_IP=192.168.1.123
Optional:
| Variable | Default | Description |
|---|---|---|
RIGOL_IP |
(required for LAN) | Scope IP address |
RIGOL_USB |
(unset) | Set to 1 to connect over USB instead of LAN. The first Rigol USB scope is found automatically. |
RIGOL_USB_SERIAL |
(unset) | When several Rigol scopes are on USB, pin a specific one by serial number. |
RIGOL_ENABLE_SEND_RAW |
(unset) | Set to 1 to enable the send_raw tool (arbitrary SCPI). Off by default — see Tools. |
RIGOL_SCREENSHOT_DIR |
screenshots/ |
Directory for saved PNG screenshots |
USB connection
Set RIGOL_USB=1 to connect over USB instead of LAN. The server looks for a Rigol scope
on USB (vendor ID 0x1AB1) and connects to it. If more than one scope is connected, set
RIGOL_USB_SERIAL to choose which one by serial number.
RIGOL_USB=1
# RIGOL_USB_SERIAL=DS1ZA000000000 # only needed if more than one scope is on USB
Windows USB instructions
The scope's USB interface needs a VISA-compatible driver. The server auto-detects whichever you have installed — pick one:
Option A — install the WinUSB driver with Zadig. The server talks to the scope through
the bundled pure-Python pyvisa-py (@py) backend (pyusb + libusb); no extra Rigol
software needed. Do this once per scope:
- Connect the scope over USB and power it on.
- Download and run Zadig.
- Choose Options → List All Devices.
- Select "DS1000Z Series" in the device dropdown.
- Set the target driver to WinUSB and click Install Driver (or Replace Driver).
- Wait for "The driver was installed successfully", then set
RIGOL_USB=1.
Option B — install Rigol UltraSigma, which bundles the driver.
UltraSigma installs the standard "USB Test and Measurement
Device" (USBTMC) driver. Once it's installed, the server reaches the scope through the
NI-VISA (@ivi) backend — nothing else to configure.
Note: the two drivers are mutually exclusive on a given USB interface. Installing WinUSB (Option A) means UltraSigma can no longer see the scope over USB until you revert the driver in Device Manager, and vice versa. LAN access is unaffected either way.
Linux / macOS USB
Works without needing drivers using the pyvisa-py (@py) backend.
macOS: typically works as-is once
RIGOL_USB=1is set; no driver to install.Linux: give your user permission to claim the device with a udev rule, then replug it:
# /etc/udev/rules.d/60-rigol.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="1ab1", MODE="0660", GROUP="plugdev"sudo udevadm control --reload-rules && sudo udevadm trigger(Make sure your user is in the
plugdevgroup:sudo usermod -aG plugdev $USER, then log out and back in.)If the kernel's
usbtmcmodule has already claimed the scope, unbind or blacklist it solibusbcan take the interface — pyvisa-py does not detach it automatically.
USB is currently hardware-tested on Windows only; Linux/macOS use the standard
libusbsetup above.
Claude Desktop / Claude Code Setup
Add to your .mcp.json (or Claude Desktop MCP config):
{
"mcpServers": {
"rigol": {
"command": "uv",
"args": ["run", "rigol-mcp"],
"cwd": "/path/to/rigol-mcp",
"env": {
"RIGOL_IP": "192.168.1.123"
}
}
}
}
For USB, replace the RIGOL_IP entry in env with "RIGOL_USB": "1" (see USB connection).
Tools
Identification & State
| Tool | Description |
|---|---|
idn |
Identify the instrument — make, model, serial, firmware |
get_scope_state |
Snapshot of all channel configs, timebase, and trigger settings |
Acquisition Control
| Tool | Description |
|---|---|
run |
Start continuous acquisition |
stop |
Stop and freeze display |
single |
Arm for one trigger event, then stop |
autoscale |
Auto-configure timebase, vertical scale, and trigger |
Configuration
| Tool | Description |
|---|---|
set_channel |
Set scale (V/div), offset, coupling (AC/DC/GND), probe ratio, on/off |
set_timebase |
Set time/div and trigger offset |
set_trigger |
Configure edge trigger: source, slope (POS/NEG/RFAL), level |
Measurement
| Tool | Description |
|---|---|
measure |
Query any single-channel measurement: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, PVRMS, VUPPER, VMID, VLOWER, VARIANCE, FREQUENCY, PERIOD, PWIDTH, NWIDTH, PDUTY, NDUTY, RTIME, FTIME, OVERSHOOT, PRESHOOT, PSLEWRATE, NSLEWRATE, TVMAX, TVMIN, MAREA, MPAREA, PPULSES, NPULSES, PEDGES, NEDGES |
measure_between |
Query delay or phase between two channels. DS1000Z: RDELAY, FDELAY, RPHASE, FPHASE. DHO: RRDELAY/RFDELAY/FRDELAY/FFDELAY, RRPHASE/RFPHASE/FRPHASE/FFPHASE (DS1000Z names auto-map to the homogeneous-edge DHO equivalents) |
get_waveform |
Download and analyse waveform data (NORM screen buffer: up to 1200 pts on DS1000Z, 1000 on DHO); returns text analysis by default, raw time/voltage arrays with raw_data=true |
Cursors
| Tool | Description |
|---|---|
set_cursors |
Set cursor mode (MANUAL/TRACK/OFF) and time positions in seconds |
get_cursor_values |
Read cursor positions (in seconds) and all delta/amplitude readouts |
Utility
| Tool | Description |
|---|---|
screenshot |
Capture display as PNG — returns image inline and saves to disk |
send_raw |
Send any SCPI command directly (escape hatch). Disabled by default — set RIGOL_ENABLE_SEND_RAW=1 to expose it, since arbitrary SCPI can leave the scope in any state. |
check_error |
Query the SCPI error queue |
Example Prompts
Basic measurement session:
"Connect to the scope, check what's configured, then measure the frequency and Vpp on channel 1."
Signal characterisation:
"Stop the scope, download the waveform from channel 2, and tell me the rise time, overshoot percentage, and estimated fundamental frequency."
Setup from scratch:
"Set channel 1 to 2V/div DC coupling with a 10x probe, set the timebase to 1ms/div, trigger on channel 1 rising edge at 1V, then run and take a screenshot."
Cursor measurement:
"Put manual cursors on the first rising edge of the signal on channel 1 — cursor A at the 10% level and cursor B at the 90% level — and read the rise time from the delta."
Transient / ringing characterisation:
"There's a damped oscillation on channel 1 after a step edge. Stop the scope, measure Vpp, Vmax, Vmin, and Vrms, then estimate the ring frequency and how many cycles it takes to decay."
Iterative debugging:
"I'm verifying the gain of an amplifier. Channel 1 is the input, channel 2 is the output. The expected gain is 20 dB. Figure out whether it's within spec."
Unknown signal characterisation:
"There's an unfamiliar signal on channel 1. I don't know its frequency, amplitude, or shape. Keep adjusting the timebase and vertical scale until you have a stable, well-framed view of at least two full cycles, then give me a complete characterisation of what you see."
Architecture
Claude / MCP client
│ MCP protocol (stdio)
rigol_mcp.server ← tool definitions, request routing
│ Python function calls
rigol_mcp.scope ← VISA connection, SCPI command helpers
│ SCPI over TCP/IP (port 5555) or USBTMC
Rigol DS1000Z ← 192.168.1.123 / USB
The VISA connection is cached across tool calls (one connection per server session) and reconnects automatically on communication errors.
SCPI Transport
By default the server connects using raw socket VISA (TCPIP0::<ip>::5555::SOCKET), not VXI-11. This avoids the NI-VISA dependency and works with the pure-Python pyvisa-py backend. It also eliminates the VXI-11 handshake overhead, making individual commands faster.
When RIGOL_USB is set, the server instead connects over USBTMC (USB0::0x1AB1::<model>::<serial>::INSTR), discovering the scope automatically. It auto-selects whichever VISA backend can see the scope:
@py(pyvisa-py+pyusb+ bundledlibusb) — for a USB interface bound to WinUSB (no NI-VISA needed).@ivi(NI-VISA / IVI VISA) — for the native USBTMC driver (e.g. installed with Rigol UltraSigma).
The two backends frame USBTMC reads differently, so block reads (waveform/screenshot) are read by exact byte count on @py and via native message reads (read_raw) on @ivi. Transport and backend selection live in rigol_mcp.scope.get_scope / _open_usb_scope.
Testing
Unit tests are fully offline — the VISA layer is faked, so no instrument is required.
uv run --extra test pytest # or: uv sync --extra test && uv run pytest
Limitations
- USB driver setup is platform-specific: Windows needs WinUSB (via Zadig) or NI-VISA/UltraSigma; Linux needs
libusbaccess (a udev rule) or NI-VISA; macOS typically works throughlibusbwith no setup. The server auto-detects the backend — see USB connection. LAN needs no driver setup on any platform. - No support for math channels, digital channels (MSO), or protocol decode in the current tools yet — use
send_rawfor those - Waveform download uses NORMAL mode (screen buffer — up to 1200 points on DS1000Z, 1000 on DHO); full memory depth (RAW mode, up to 56M on DS1000Z / 50M on DHO) is not yet implemented
License
MIT — see LICENSE.
Установка Rigol
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/erebusnz/rigol-mcpFAQ
Rigol MCP бесплатный?
Да, Rigol MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Rigol?
Нет, Rigol работает без API-ключей и переменных окружения.
Rigol — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Rigol в Claude Desktop, Claude Code или Cursor?
Открой Rigol на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Rigol with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
