Skip to main content
Glama
rigol-oscilloscope-mcp

rigol-oscilloscope-mcp

rigol-oscilloscope-mcp

An MCP (Model Context Protocol) server that lets LLMs (Claude, Codex, etc.) drive RIGOL oscilloscopes over SCPI (LAN / USB) — connect, configure channels/timebase/trigger, measure, capture waveforms and screenshots, decode serial protocols, run host-side FFT analysis, and control the built-in AFG, all through semantic tools with a four-tier safety policy. Verified on a real RIGOL MHO98; other RIGOL models work best-effort via device profiles. Documentation is currently in Japanese.

RIGOL製オシロスコープを LLMから操作する MCPサーバー。

「x10プローブで1kHz 3Vの波形を見えるようにして」「今の波形をスクショして保存して」といった自然言語の指示を、 LLM(Claude / Codex 等)がMCP Tool呼び出しへ変換し、本サーバーがSCPI(LAN / USB)で機器を制御する。 GUI自動操作は使わない。

  • RIGOL MHO98 で実機検証済み(→ docs/verification/mho98-mvp.md)

  • DHO800/900 系はガイドベースのベストエフォート対応(公式プログラミングガイドのみを根拠とする guide プロファイル。実機未検証で、デコード / AFG / LA / オプション照会は未対応 → docs/device-profiles.md 6章)

  • 他のRIGOL機種は機種プロファイルによるベストエフォート対応(未知の機種は generic プロファイルで動作し、その旨を明示する)

  • RIGOL以外のベンダーは対象外(接続時に警告を返すが拒否はしない)

なぜこのMCPが必要か

SCPIを直接叩けば、制御自体はできる。 LLMはSCPIを一般知識として知っているので、素朴なSCPIブリッジ(生コマンドを中継するだけのツール)でもオシロスコープは動く。それでも本サーバーが「意味的なToolだけを公開し、生SCPIを渡さない」設計を取るのは、実機検証で次の問題が確認されているからである。

  1. ドキュメントをコンテキストへ入れるコストが高すぎる。 MHO900のプログラミングガイドは500ページ超で、しかもテキスト抽出できない形式のPDF。会話のたびに読み込ませるのは非現実的で、入れなければLLMは記憶頼みになる。実際のコマンドは機種世代で分岐しており(例: オートセットアップは MHO/DHO系 :AUToset / 旧世代 :AUToscale、スクリーンショットはDHO系のみ PNG 引数必須、Resultビュークリアは :MEASure:DELete / :CLEar / :CLEar ITEMn|ALL の3方言)、記憶頼みの生成は高確率でどれかを踏み外す。本サーバーはこの差分を機種プロファイルとして吸収済みで、LLMには機種非依存の同一APIだけが見える

  2. 闇雲なSCPI実行は機材を意図しない動作へ導く。 50Ω入力切替(過大入力で機器を破損し得る)、AFG出力ON(接続先の回路へ実信号を注入する)、Auto Setup(利用者の設定を全て上書きする)などは、生SCPIなら1行で実行できてしまう。試行錯誤しながらコマンドを探るLLMに、この判断を委ねるべきではない

  3. 非対応コマンド1発でSCPIサーバーが沈黙する。 実測(MHO98)では、未定義ヘッダやリスト外のパラメータトークンを1つ送っただけでSCPIサーバー全体が無応答になり、再接続でも回復しない(空行送出という非自明な復旧手順が必要)。「動くまで試す」というLLMの自然な行動パターンとSCPIの相性は最悪で、本サーバーは実機またはガイドで検証済みのニモニックだけを送信し、未検証の機能は送信ゼロで UNSUPPORTED_FEATURE を返す(フェイルクローズ)

  4. ガードは安全側に振ってある。 全操作を4クラスに分類し、危険操作はホストUI非依存の2段階確認(confirmトークン。承認前はコマンド送信ゼロ、トークンは引数・接続世代・設定スナップショットに束縛)を必須とする。一方で出力OFFのような安全側への操作は確認でブロックしない。設定値は要求値と実機の適用値(read-back)を常に両方返し、書き込みは監査ログ(JSONL)に残る

つまり本サーバーの価値は「SCPIを叩けること」ではなく、方言知識の内蔵・沈黙の回避・危険操作の門番を、LLMの手前で機械的に保証することにある。

Related MCP server: pyMSO5000 MCP Server

特徴

  • 会話ベースの接続 — 接続先はユーザーが会話で指示するのが基本(connect(address="..."))。環境変数のデフォルトは任意のフォールバック

  • 28個のMCP Tool — 接続 / 識別 / 状態取得 / 測定(Resultビューのクリア含む)/ 波形 / 解析(統計・FFT)/ スクリーンショット / チャンネル・タイムベース・トリガ設定 / Run・Stop・Single・Autoset / シリアルデコード設定・結果取得 / 信号発生(AFG)設定(変調・ARBファイル選択含む)・状態取得・出力制御(出力ONは確認フロー付き)・位相同期。SCPI文字列をLLMに書かせず、意味的Toolのみを公開する

  • 4クラスの安全ポリシー + confirmトークン — 全操作を READ_ONLY / SAFE_WRITE / RESTRICTED_WRITE / DANGEROUS_WRITE に分類。50Ω入力やAuto SetupはホストUI非依存の2段階確認(confirmトークン)を必須とする

  • スクリーンショット保存 — png / jpg / bmp / webp で指定パスへ保存し、画像そのものもLLMへ返す(書き込み先は許可ルートで制限)

  • 機種プロファイル — SCPI方言・機能有無・パラメータ範囲を同梱YAMLで宣言し、モデル完全一致(verified) → ファミリ(family) → ガイドベース(guide) → 汎用RIGOL(generic) の順で解決する

  • requested / applied の両値返却 — 機器が設定値をスナップするかは機種依存のため、要求値とread-back値を両方返す

  • 監査ログ — 書き込み操作を Before / Action / After 付きでJSONLに記録する

インストール・起動

GitHubリポジトリからの uvx 起動を標準とする。

uvx --from git+https://github.com/zinntikumugai/rigol-oscilloscope-mcp@v0.1.4 rigol-oscilloscope-mcp

既定でタグ(@v0.1.4)にバージョンを固定している。最新の開発版(main)を使う場合は @v0.1.4 を外す。

Claude Code — プラグイン(推奨)

本リポジトリはClaudeプラグインを兼ねており、MCPサーバーに加えて測定ワークフロースキル (信号種別ごとの推奨設定・UART/未知信号の測定手順・安全プロンプト)が同時に導入される。 マーケットプレイスを追加してからインストールする(@ 以降はマーケットプレイス名):

/plugin marketplace add zinntikumugai/rigol-oscilloscope-mcp
/plugin install rigol-oscilloscope@rigol-oscilloscope-mcp

Claude Code(.mcp.json または claude mcp add)

{
  "mcpServers": {
    "rigol-oscilloscope": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/zinntikumugai/rigol-oscilloscope-mcp@v0.1.4", "rigol-oscilloscope-mcp"],
      "env": { "RIGOL_MCP_SCREENSHOT_DIR": "~/scope-captures" }
    }
  }
}

Codex — プラグイン

Codexプラグイン(.codex-plugin/ + マーケットプレイス定義)も同梱しており、MCPサーバーと測定ワークフロースキルを一括導入できる。

codex plugin marketplace add zinntikumugai/rigol-oscilloscope-mcp
codex plugin install rigol-oscilloscope

(プラグインを使わない場合、スキルだけなら skills/measurement-workflows を ~/.agents/skills/ へコピーしても認識される。MCPサーバーだけなら次の config.toml 設定で足りる)

Codex(~/.codex/config.toml)

[mcp_servers.rigol-oscilloscope]
command = "uvx"
args = ["--from", "git+https://github.com/zinntikumugai/rigol-oscilloscope-mcp@v0.1.4", "rigol-oscilloscope-mcp"]

[mcp_servers.rigol-oscilloscope.env]
RIGOL_MCP_SCREENSHOT_DIR = "~/scope-captures"

ローカルのcloneから起動する場合

リポジトリを手元にcloneして開発版を使うときは、uv run --directory で起動する。

{
  "mcpServers": {
    "rigol-oscilloscope": {
      "command": "/path/to/uv",
      "args": ["run", "--directory", "/path/to/rigol-oscilloscope-mcp", "rigol-oscilloscope-mcp"],
      "env": { "PYTHONDONTWRITEBYTECODE": "1" }
    }
  }
}
  • command は、GUIホスト(デスクトップアプリ)のPATHに uv が無い場合に絶対パスで書く。パスは which uv(mise管理なら mise which uv)で確認する

  • PYTHONDONTWRITEBYTECODE=1 は明示する。プロジェクト外から起動すると mise.toml の [env] が効かないため、__pycache__ がclone内に書かれるのを防ぐ

  • スクリーンショットのデフォルト保存先は、--directory で移動した先ではなくサーバーを起動した実行ディレクトリになる。固定したい場合は RIGOL_MCP_SCREENSHOT_DIR を指定する

  • path に相対パスを渡した場合もこのデフォルト保存先が基準になる。デフォルト保存先・RIGOL_MCP_ALLOWED_DIRS・一時ディレクトリの外へは保存できない(拒否される)

設定(環境変数)

すべての設定は環境変数で指定できる(TOML設定ファイルも任意で使える)。 優先順位は Tool引数(会話でのユーザー指示) > 環境変数 > 設定ファイル > 組み込みデフォルト。

環境変数

内容

デフォルト

RIGOL_MCP_ADDRESS

デフォルト接続先(IP / VISAリソース)

なし(会話指示を要求)

RIGOL_MCP_TRANSPORT

lan / usb

addressから推定

RIGOL_MCP_PORT

LAN SCPIポート

プロファイル既定(5555)

RIGOL_MCP_TIMEOUT_S

単一クエリのタイムアウト(秒)

5

RIGOL_MCP_SCREENSHOT_DIR

スクリーンショットの既定保存先

実行ディレクトリ(PWD。無効時はカレントディレクトリ)

RIGOL_MCP_ALLOWED_DIRS

書き込み許可ルート(パス区切りで複数)

既定保存先 + 一時ディレクトリ

RIGOL_MCP_WAVEFORM_MAX_POINTS

波形取得の既定上限

100000

RIGOL_MCP_RAW_SCPI

raw_scpi Toolの有効化(予約: Tool自体が未実装)

false

RIGOL_MCP_LOG_LEVEL

ログレベル(error / warn / info / debug)

info

RIGOL_MCP_AUDIT_LOG

監査ログの出力先

有効(~/.local/state/rigol-oscilloscope-mcp/audit.jsonl。XDG_STATE_HOME に従う)。off で無効

RIGOL_MCP_CONFIG

TOML設定ファイルのパス

なし

詳細は docs/Requirements.md 9章。

実機なしで試す

RIGOL_MCP_FAKE=1 を付けて起動すると、実機の代わりに内蔵のFakeScopeへ接続する。 ホスト側のMCP設定や会話フローを、オシロスコープを用意せずに確認できる。

RIGOL_MCP_FAKE=1 uvx --from git+https://github.com/zinntikumugai/rigol-oscilloscope-mcp@v0.1.4 rigol-oscilloscope-mcp

開発

Pythonバージョンは mise、依存と仮想環境は uv で管理する。

mise install          # Python + uv
uv sync               # 依存の解決
uv run pytest         # ユニットテスト(実機不要)
uv run rigol-oscilloscope-mcp   # stdioで起動

実機テストは接続先を環境変数で渡したときだけ実行される(未設定なら自動でskip)。 実機のIPアドレスはリポジトリへ絶対に書かないこと(tests/test_ip_guard.py が機械的に検査している)。

# read-only スイート(機器の設定を変更しない)
RIGOL_TEST_ADDRESS=<あなたのオシロのIP> uv run pytest -m device

# write スイート(設定変更 → read-back → 必ず復元)。二重ゲート
RIGOL_TEST_ADDRESS=<あなたのオシロのIP> RIGOL_TEST_ALLOW_WRITE=1 uv run pytest -m device_write

<あなたのオシロのIP> にはご自身の機器のアドレスを入れる(例示が必要な場合は ドキュメント用に予約された 192.0.2.x(TEST-NET-1)を使うこと)。

トラブルシューティング

症状

対処

spawn uv ENOENT(サーバーが起動しない)

GUIホストのPATHに uv が無い。MCP設定の command を絶対パス(which uv / mise which uv の出力)に書き換える

スクリーンショットが意図しない場所に保存される

既定はサーバーを起動した実行ディレクトリ。RIGOL_MCP_SCREENSHOT_DIR で保存先を明示指定する

安全上の注意

MHO98をはじめ多くのRIGOLオシロは非絶縁である(各入力のGNDが筐体・USB等のGNDと共通、測定カテゴリ Category I)。 本サーバーは危険な設定変更を防止するが、電気的安全性そのものを保証するものではない。

主体

責務

AI (LLM)

測定設定の判断と結果解析の支援

MCPサーバー

機器制御、パラメータ検証、安全ポリシーの担保、操作記録

人間

DUT・プローブ・グラウンド等の物理接続と電気的安全の担保

  • プローブの接続先・Ground Clipの接続先・DUTの実電圧・プローブ耐圧・絶縁状態は、MCPから確認できない

  • **商用電源(100V AC、コンセント、一次側、AC mains)の測定は対象外。**通常のパッシブプローブによる測定手順を自動実行しない。差動・絶縁プローブの使用を人間が確認することが前提

  • Firmware Update / Calibration / Factory Service操作 / ネットワーク設定変更は非対象

詳細は docs/Requirements.md 6章(安全要件)。

confirmフローの信頼モデル: 2段階確認(confirmトークン)は、LLMの誤操作・早とちりを防ぐための仕組みであり、悪意あるMCPホストへの防御ではない(トークンは同じ呼び出し元へ返るため、ホスト自身が悪意を持てば2回呼ぶだけで通過できる)。物理的な安全は「何が配線されているか」を管理する人間にのみ担保できる。なお enable_afg のトークンは発行時点のAFG設定にも束縛され、発行後に設定(振幅等)を変更するとトークンは無効になる。

免責: 本ソフトウェアは無保証で提供される(LICENSE)。本ソフトウェアの使用に起因する計測器・被測定物(DUT)・周辺機器の損傷、測定結果の誤り、およびそれらから生じるいかなる損害についても、作者は責任を負わない。

ライセンス

MIT License — Copyright (c) 2026 zinntikumugai

ドキュメント

docs/README.md に文書一覧と読む順序をまとめている。

Available Tools

38 tools
analyze_waveformA

Analyze a waveform on the host and return only the summary.

The raw samples are never returned; use capture_waveform when the data itself is needed. analyses is a subset of ["stats", "fft"] (all of them when omitted). stats gives min/max/mean/rms/std/vpp in volts; fft gives the dominant frequency and the strongest peaks. Frequency accuracy is limited by frequency_resolution_hz, so do not read more digits than that.

channel is "CH1"-"CH4" or a math trace "MATH1"-"MATH4". A math trace using the fft operator is rejected: its x axis is already frequency, so time-domain statistics and a host-side FFT are meaningless. Read the instrument's own peak table with get_math_state, or fetch the spectrum points with capture_waveform.

Inputs: channel, analyses, max_points.

autosetA

Run Auto Setup (autoscale).

This changes the current settings substantially (vertical scale, timebase and trigger are auto-adjusted and the previous settings are lost), so it needs the confirmation flow: the first call does not execute and returns a confirm_token, so ask the human user whether to proceed and then call again with that confirm_token. After execution the changed main settings are returned in state.

Inputs: confirm_token.

capture_screenshotA

Capture the screen, save it, and also return the image (for visual checks).

path is the destination directory or file (defaults to the configured default directory). A relative path is resolved against the invocation directory (the default save location). Saving outside the allowed roots is rejected (add roots with RIGOL_MCP_ALLOWED_DIRS). format is png / jpg / jpeg / bmp / webp. With return_image=false only the metadata is returned, without the image (saves tokens). For numeric readings use measure, not this image.

Inputs: path, format, return_image.

capture_waveformA

Capture waveform data and return it converted to volts (V).

channel is "CH1"-"CH4" or a math trace "MATH1"-"MATH4" (configure one with configure_math). A math trace is read as the data currently displayed on screen, so turn its display on first.

When there are many points the data is written to a CSV file and its path is returned in data_file. Screen data may be decimated, so read the effective sample rate as the reciprocal of sample_interval_s.

A math trace using the fft operator has a frequency x axis: it returns x_unit "Hz" (sample_interval_s is then the frequency step in hertz and time_origin_s the start frequency) and no effective_sample_rate_sa_per_s. Every other source keeps the time axis and the usual shape.

Inputs: channel (required), max_points.

clear_measurementsA

Remove all measurement items from the on-screen Result view.

Reading measurements (measure) also enables each item on the instrument's Result view, so items accumulate on screen over time. This clears them all; re-measuring restores any item.

Inputs: no named parameters.

configure_afgA

Configure the built-in function generator (AFG). Omitted items are left unchanged.

This never turns the generator output on or off. The output state is not touched at all, so nothing new reaches the wiring: a configured generator only emits a signal once its output is enabled with the separate, confirmation-gated tool enable_afg (and disable_afg turns it off again). Read the current output state with get_afg_state.

channel is the generator channel (1 or 2 on MHO98; see get_capabilities afg_channels). Specify at least one item to change.

waveform is sine / square / ramp / noise / dc / arb / exp_rise / exp_fall / ecg / gaussian / lorentz / haversine / sinc. amplitude_vpp is the peak-to-peak amplitude in volts (not the peak and not RMS), offset_v the DC offset in volts, frequency_hz the frequency in hertz, phase_deg the phase in degrees (0-360), duty_percent the duty cycle of the square wave (1-99) and symmetry_percent the symmetry of the ramp (0-100). Duty and symmetry are stored independently of the current waveform, so they can be set at any time.

impedance is "highz" or "50" and is the GENERATOR's own output impedance setting, i.e. the load the amplitude is calibrated for. It has nothing to do with the oscilloscope input impedance of configure_channel.

The frequency and amplitude limits depend on the installed options and on impedance, and the instrument clamps an out-of-range value silently (no error is reported): always compare applied (the read-back value) against requested. Writing a frequency while the waveform is dc or noise is rejected by the instrument.

arb_file selects an existing arbitrary waveform file already stored on the instrument (local C:/... or USB D:/...), e.g. arb_file="D:/my.csv" together with waveform="arb". This server never creates, uploads or deletes instrument files - it only selects one that is already there.

modulation configures AM/FM/PM (internal source only; there is no external modulation input). Give a dict with any of: enabled (bool), type ("am"/"fm"/"pm"), am_depth_percent (0-120), fm_deviation_hz (>0), pm_deviation_deg (0-360), frequency_hz (the MODULATING frequency, not the carrier - 2 mHz to 1 MHz), waveform (sine/square/triangle/upramp/ dnramp/noise, the modulating waveform). frequency_hz and waveform are routed to the type given in the same call, or otherwise to whatever type is currently set on the instrument. The instrument silently ignores modulation parameter writes while modulation is off, so pass enabled=true together with the parameters (the server sends the enable before the parameters); parameters alone are rejected while modulation is off. Enabling modulation does NOT turn the output on, but if the output is already on, modulation takes effect immediately.

Inputs: channel, arb_file, offset_v, waveform, +7 more.

configure_channelA

Configure the vertical axis (a channel). Omitted items are left unchanged.

channel is "CH1" to "CH4", coupling is DC / AC / GND, impedance is "1M" / "50". Specify at least one item to change. The device may snap values, so trust applied (the read-back value), not requested.

impedance="50" risks damaging the device and needs the confirmation flow: the first call does not execute and returns a confirm_token, so ask the human user whether to proceed and then call again with the same arguments plus that confirm_token.

Inputs: channel (required), enabled, coupling, offset_v, +5 more.

configure_cursorA

Configure the on-screen measurement cursors. Omitted items are left unchanged.

This only moves the cursors the instrument draws over the trace: the acquisition is untouched and no output is driven. Read what the cursors report with get_cursor_measurement.

mode is off / manual / track / xy. In manual mode both cursors are placed freely; in track mode they follow their source waveform. Positions and sources belong to the subtree of the ACTIVE mode: type and source are manual-only, source1 and source2 are track-only, and giving one to the other mode is rejected. When mode is omitted, the mode currently set on the instrument decides which subtree is written. While the mode is off or xy there is nowhere to write, so positions are rejected: mode="xy" is accepted as a mode (it is one the device supports) but its own position subtree is not exposed by this server.

type is time / amplitude and selects what the manual cursors measure. source, source1 and source2 are "CH1"-"CH4", "MATH1"-"MATH4" or "NONE" (reference waveforms and digital channels are not valid cursor sources).

ax and bx are the X positions of cursor A and B in seconds, ay and by their Y positions in volts.

Specify at least one item to change. The device may snap values, so trust applied (the read-back value), not requested.

Inputs: ax, ay, bx, by, +5 more.

configure_decodeA

Configure a serial protocol decode bus. Omitted items are left unchanged.

The bus count is model-dependent (get_capabilities decode_buses; 4 on MHO98).

protocol is uart / i2c / spi / can / lin / parallel (options such as I2S, FlexRay, MIL-STD-1553 and CAN-FD are not supported). data_format is hex / ascii / dec / bin. Source values are "CH1"-"CH4", "D0"-"D15" or "off".

settings keys per protocol (all optional):

  • uart: tx_source, rx_source, baud_bps, data_bits, parity (none/odd/even), stop_bits (1/1.5/2), endian (msb/lsb), polarity (positive/negative), tx_threshold_v, rx_threshold_v. Example: {"tx_source": "CH1", "baud_bps": 115200, "data_bits": 8, "parity": "none", "stop_bits": 1, "tx_threshold_v": 1.65}

  • i2c: scl_source, sda_source, swap_sda_scl, address_bits (7/8/10), scl_threshold_v, sda_threshold_v. Example: {"scl_source": "CH1", "sda_source": "CH2", "address_bits": 7}

  • spi: clk_source, clk_slope (rising/falling), mosi_source, miso_source, cs_source, cs_polarity (high/low), frame_mode (cs/timeout), timeout_s, data_bits (4-32), endian, polarity (high/low), clk_threshold_v, mosi_threshold_v, miso_threshold_v, cs_threshold_v. Example: {"clk_source": "CH1", "mosi_source": "CH2", "data_bits": 8}

  • can: source, signal_type (tx/rx/canh/canl/differential), baud_bps, sample_point_percent, threshold_v. Example: {"source": "CH1", "signal_type": "canh", "baud_bps": 500000}

  • lin: source, baud_bps, parity_enabled, standard (v1x/v2x/mixed), threshold_v. Example: {"source": "CH1", "baud_bps": 19200, "standard": "v2x"}

  • parallel: clk_source, clk_slope, bus (d7_d0/d15_d8/d15_d0/d0_d7/ d8_d15/d0_d15/ch1-ch4/user), bus_width (1-16), bit_sources, endian, polarity. bus is the data source; the digital groups list the MSB first. bus_width and bit_sources only work while bus is "user" (the device rejects them otherwise), so set bus in the same call. bit_sources is a list of "CH1"-"CH4" / "D0"-"D15", one per data bit starting at bit 0, and no longer than bus_width. Example: {"bus": "user", "bus_width": 2, "bit_sources": ["CH1", "CH2"]}

Set event_table=true (together with enabled=true) before reading the decoded results with get_decode_result. This only changes what the device displays and analyses: acquisition settings are untouched, so configure the channels and trigger separately.

Inputs: protocol (required), bus, enabled, settings, +2 more.

configure_histogramA

Configure the waveform histogram. Omitted items are left unchanged.

The histogram is a statistics display the instrument computes from the trace it is already acquiring: the acquisition is untouched and no output is driven. Read the statistics with get_histogram_result.

type is horizontal (a histogram over time) or vertical (over voltage). source is an analog channel "CH1"-"CH4". height is the display height in divisions (1-4).

left_s and right_s bound the histogram window in seconds, bottom_v and top_v in volts. left_s must be smaller than right_s, and bottom_v smaller than top_v. That is checked host-side only when both bounds of a pair are given in the same call; moving one bound alone past the current opposite bound is rejected by the instrument as an error, and the remedy is to send both bounds of the pair in one call.

reset=true restarts the statistics. It is sent after the settings, so a single call can change the source and start collecting again.

Specify at least one item to change. The device may snap values, so trust applied (the read-back value), not requested.

Inputs: type, reset, top_v, height, +5 more.

configure_mathA

Configure a math (waveform arithmetic) trace. Omitted items are left unchanged.

This computes a new trace inside the instrument from channels already being acquired; it changes nothing about the acquisition itself and drives no output. channel is the math trace 1-4 (see get_capabilities math_channels). Specify at least one item to change. Read the result back with get_math_state, and fetch the trace with capture_waveform(channel="MATH1").

operator is add / subtract / multiply / divide / and / or / xor / not / fft / integrate / differentiate / sqrt / log10 / ln / exp / abs / lowpass / highpass / bandpass / bandstop / axb.

source1 and source2 are the operands of the arithmetic operators: "CH1"-"CH4", "REF1"-"REF10", or another math trace "MATH1"-"MATH4". A math trace may only use a LOWER-numbered one (MATH2 can read MATH1, never MATH2 or MATH3), so cascade upwards. lsource1 and lsource2 are the operands of the logic operators (and / or / xor / not) and take "D0"-"D15" or "CH1"-"CH4" instead. scale is the vertical scale per division and offset_v the vertical offset in volts of the resulting trace; invert flips it vertically.

fft is a dict for the fft operator, with any of: source (the input channel of the FFT - this is what selects it, not source1), window (rectangle / blackman / hanning / hamming / flattop / triangle), unit (vrms / db), mode (normal / average / maxhold), average_count (2-1000), scale and offset (vertical, in the unit above), freq_start_hz and freq_end_hz (the displayed span in hertz), search_enabled (bool, turns the instrument's peak table on), search_num (how many peaks), search_threshold and search_excursion (in the vertical unit), and search_order (amplitude / frequency). Read the peaks themselves back with get_math_state.

filter is a dict for the lowpass / highpass / bandpass / bandstop operators, with any of: type (lowpass / highpass / bandpass / bandstop), w1_hz and w2_hz (the cut-off frequencies in hertz; w1 must be below w2 for bandpass and bandstop).

Which parameters are valid depends on the operator, and the instrument enforces that: scale and offset_v do not exist for the logic operators or for fft (fft has its own scale and offset inside the fft dict), and a rejected write is reported as an error. Set the operator in the same call as its parameters. The device may snap values, so trust applied (the read-back value), not requested.

Inputs: fft, scale, filter, invert, +8 more.

configure_meterA

Configure the frequency counter or the digital voltmeter. Omitted items are left unchanged.

kind selects which one: "counter" or "dvm". Both only add a reading to the display; the acquisition is untouched and no output is driven. Read the value itself with get_meter_value.

mode for the counter is frequency / period / totalize (totalize counts events instead of measuring a rate). mode for the dvm is ac_rms / dc / dc_rms (ac_rms is the RMS with the DC component removed, dc the average, dc_rms the RMS of the whole signal).

source for the counter is "CH1"-"CH4" or a digital channel "D0"-"D15"; the dvm accepts analog channels only. enabled turns the reading on.

digits (the counter resolution, 3-6 digits) and totalize_enabled (the counter's totalize statistics) exist for the counter only. How they couple to the mode is enforced by the instrument, not host-side: digits is rejected while the mode is totalize, and totalize_enabled is invalid in totalize mode (it applies to frequency and period). A rejected write comes back as an error, so set the mode in the same call as the parameters that depend on it.

clear_totalize=true clears the totalized count. It is sent after the settings, so a single call can switch to totalize and start counting from zero. It is a counter-only item and the instrument accepts it in totalize mode only.

Specify at least one item to change. The device may snap values, so trust applied (the read-back value), not requested.

Inputs: kind (required), mode, digits, source, +3 more.

configure_referenceA

Configure a reference waveform slot. Omitted items are left unchanged.

A reference waveform is a copy of a trace stored inside the instrument and drawn over the live one, so a signal can be compared against a known-good capture. This only changes what the instrument displays and computes: the acquisition is untouched and no output is driven. ref is the slot 1-10 (see get_capabilities ref_channels). Read the result back with get_reference_state.

source is what the slot shows and saves: "CH1"-"CH4", a math trace "MATH1"-"MATH4", or a digital channel "D0"-"D15". The programming guide says only a channel that is currently displayed may be selected, but this firmware accepts a channel whose display is off as well (measured), so the source is not restricted here.

scale is the vertical scale per division and offset_v the vertical offset in volts, both of the stored trace. color is gray / green / blue / red / orange. label is the text drawn next to the trace (letters, digits, '_', '.', '+' and '-'; no spaces).

label_display turns the labels on or off for EVERY reference waveform at once - it is a single global switch on the instrument, not a per-slot setting, so it is reported identically for every slot.

save=true stores the current waveform of the source into this slot. It is sent last, after the settings in the same call, so the source is already selected. IT IS IRREVERSIBLE: whatever that slot held before is overwritten and lost, there is no undo, and there is no way to check beforehand whether the slot already holds a capture. Ask the human user before overwriting a slot they may still need.

reset=true restores the slot's default vertical scale and offset. It is sent first, before the settings in the same call, so scale and offset_v given together with it survive. It does not erase a stored waveform.

Specify at least one item to change. The device may snap values, so trust applied (the read-back value), not requested.

Reference waveforms cannot be downloaded: :WAVeform:SOURce does not accept them. To compare numerically on the host, subtract with configure_math(operator="subtract", source1="CH1", source2="REF1") and fetch the result with capture_waveform(channel="MATH1").

Inputs: ref, save, color, label, +5 more.

configure_timebaseA

Configure the horizontal axis (timebase). Omitted items are left unchanged.

Specify at least one item to change. The device may snap values, so trust applied (the read-back value).

Inputs: position_s, scale_s_per_div.

configure_triggerA

Configure the edge trigger. Omitted items are left unchanged.

source is "CH1" to "CH4", slope is rising / falling / either, and sweep_mode is auto / normal / single. Specify at least one item to change.

Inputs: slope, source, level_v, sweep_mode.

connectA

Connect to the oscilloscope.

Pass the address the user gave you (IP address etc.) as address. If you do not know it, ask the user instead of guessing. When omitted, transport is inferred from the address format ("lan" / "usb") and port falls back to the profile default. Any existing connection is replaced.

Inputs: port, address, transport.

disable_afgA

Turn the function generator output off immediately (no signal comes out any more).

No confirmation is needed by design: stopping the output is always the safe direction, so it must never be blocked by the confirmation flow. Use it as soon as the measurement is done, and whenever the user asks for the signal to stop. The waveform settings are kept, so enable_afg drives the same signal again.

Returns the settings of the channel in state, with output false.

Inputs: channel.

disconnectA

Close the current connection (not an error if not connected).

Inputs: no named parameters.

enable_afgA

DANGEROUS: turn the function generator output on (a real signal starts coming out).

This is the only tool that makes the instrument drive a signal into whatever is wired to the generator output, so it needs the confirmation flow: the first call does not execute and returns a confirm_token, and only a second call carrying that confirm_token turns the output on. The token is bound to this channel, is single use, and expires.

Before asking for confirmation, read the settings back with get_afg_state and show the human user what is about to be driven (waveform, frequency_hz, amplitude_vpp, offset_v) - those values take effect the instant the output turns on. Then ask the human user what is connected to the generator output and whether it is safe to drive it. Never confirm on your own, and never drive a live or powered circuit.

Returns the settings of the channel in state, with output true. Turn the output off again with disable_afg.

Inputs: channel, confirm_token.

get_acquisition_stateA

Return the acquisition state (whether it is running, and the trigger status).

Inputs: no named parameters.

get_afg_stateA

Return the function generator settings, including whether the output is on.

With channel given, the settings of that channel are returned flat (channel, output, waveform, impedance, frequency_hz, amplitude_vpp, offset_v, phase_deg, duty_percent, symmetry_percent). With channel omitted, every generator channel is returned under channels, keyed by the channel number as a string: {"channels": {"1": {...}, "2": {...}}}.

output tells whether the generator is currently driving its connector. Reading never changes it. modulation reports the modulation settings (enabled, type, the effective type's depth/deviation, frequency_hz, waveform). This is read-only: it costs about 14 queries per channel.

Inputs: channel.

get_capabilitiesA

Return the features available on the connected device (channel count, supported features).

Profile confidence is verified, family, guide (decoded from the official programming guide only, not confirmed on real hardware), or generic. Below verified, unverified features are restricted. options reports the installed license options, and is null when this model does not support option queries.

Inputs: no named parameters.

get_channelB

Return the state of one channel ("CH1" to "CH4").

Inputs: channel (required).

get_cursor_measurementA

Read what the cursors currently measure (positions and deltas).

Returns mode and, from the active manual or track subtree, ax_s and bx_s (the X positions in seconds), ay_v and by_v (the Y positions in volts), xdelta_s and ydelta_v (cursor B minus cursor A) and ixdelta_hz (1/deltaX, the frequency that time difference corresponds to). A reading the instrument cannot produce (1/deltaX with deltaX = 0) is returned as null.

While the cursor mode is off or xy there is nothing to read and only mode is returned; place the cursors with configure_cursor first.

Inputs: no named parameters.

get_decode_resultA

Read the decoded event table of a decode bus (bus 1-4).

Call configure_decode with enabled=true and event_table=true first; otherwise no table is read and the reason is returned in warnings. Stop the acquisition (stop) before reading, or the table keeps changing between reads and is only a snapshot.

The column names depend on the protocol and on the device (for example time_s, tx_rx, data, error for UART/RS232); read columns instead of assuming a fixed layout. time_s is in seconds relative to the trigger, and the other cells are strings formatted as the data_format of configure_decode selects (hex / ascii / dec / bin).

max_events returns only the first N events; event_count is always the total number of events on the device before truncation.

Inputs: bus, max_events.

get_histogram_resultA

Read the histogram statistics.

raw is always present: the response line exactly as the instrument sent it, e.g. "[Sum:30.37khits, Max:1.562V, Min:-999.9mV, ...]". stats holds the same values parsed, keyed by the instrument's own labels in snake_case: sum, peaks, max, min, pk_pk, mean, median, mode, bin_width, sigma, mean_plus_sigma, mean_plus2_sigma, mean_plus3_sigma. Every value is a number in base units - SI prefixes are already applied, so "30.37khits" comes back as 30370.0 - and the unit of a value that has one is in the matching _unit key ("hits", "V"); the sigma-multiple values are unitless and have no _unit key. warnings says so when part of the response could not be interpreted, and when the histogram is disabled: nothing is read in that case and raw comes back empty.

Enable the histogram with configure_histogram first, and stop the acquisition (stop) before reading if you need a stable snapshot.

Inputs: no named parameters.

get_math_stateA

Return the math trace settings (channel, display, operator, sources).

With channel given (1-4), that trace's settings are returned flat. With channel omitted, every math trace is returned under channels, keyed by the trace number as a string: {"channels": {"1": {...}, ..., "4": {...}}}.

Only the keys that mean something for the current operator are read: scale and offset_v for the arithmetic operators, lsource1 and lsource2 for the logic ones, an fft dict for the fft operator and a filter dict for the filter ones. With the fft operator and search_enabled true, the instrument's own peak table is returned in peaks, each entry having index, frequency_hz, amplitude and amplitude_unit (lines that could not be parsed are returned raw and noted in peak_warnings).

This is read-only and never changes the display. It costs a few queries per trace (about 20 for an fft trace).

Inputs: channel.

get_meter_valueA

Read the current frequency counter or digital voltmeter value with its unit.

kind is "counter" or "dvm". The unit depends on the mode, so value is returned together with the mode that produced it and the matching unit: Hz for frequency, s for period, counts for totalize, and V for every dvm mode. A reading the instrument cannot produce is returned as null.

The meter's settings come back alongside the value: value is null while enabled is false, because a meter that is off has no reading to give, and source says what is being measured. Turn the meter on with configure_meter first.

The counter needs a few seconds to settle after it is enabled: it reads 0 or null for roughly the first three seconds even on a live signal, and only then starts returning the frequency. Wait about three seconds after enabling before trusting the reading, and treat a null or 0 right after configure_meter as "not settled yet" rather than as no signal.

Inputs: kind (required).

get_reference_stateA

Return the reference waveform settings (source, scale, offset, color, label).

With ref given (1-10), that slot's settings are returned flat. With ref omitted, every slot is returned under channels, keyed by the slot number as a string: {"channels": {"1": {...}, ..., "10": {...}}}.

label_display is the instrument's single global label switch, so it has the same value in every slot. Whether a slot actually holds a stored waveform cannot be read: the instrument has no query for it.

This is read-only and never changes the display. It costs six queries per slot.

Inputs: ref.

get_stateA

Get the main settings (channels / timebase / trigger / acquisition) in one call.

When you know what you need, narrowing with sections is much faster (a full read is about 39 queries and can take several seconds). Omitting sections returns every section.

Inputs: sections.

get_timebaseA

Return the horizontal (timebase) state.

Inputs: no named parameters.

get_triggerA

Return the trigger settings and status.

Inputs: no named parameters.

measureB

Measure the given channel.

Choose measurements from frequency / period / vpp / vmax / vmin / vavg / rms / duty / rise_time / fall_time. Returned values use SI-suffixed keys (frequency_hz, vpp_v, ...); do not trust a value whose quality is not valid.

Inputs: channel (required), measurements (required).

runA

Start waveform acquisition (continuous run).

Inputs: no named parameters.

scope_identifyA

Return the connection state and device identity (*IDN?, profile).

Not an error when disconnected; returns connected: false instead.

Inputs: no named parameters.

singleA

Perform a single-shot acquisition (triggers once, then stops).

Inputs: no named parameters.

stopA

Stop waveform acquisition (freezes the waveform on screen).

Inputs: no named parameters.

sync_afg_phaseA

Align the phase of both function generator channels to their preset settings.

This re-applies both AFG channels' preset frequency and phase so their phases line up; it only has a visible effect when the two channels' frequencies are identical or one is an integer multiple of the other. It does not touch amplitude or output state (no confirmation needed). channel selects which channel's SCPI prefix issues the command, but both generator channels are affected.

Inputs: channel.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 38 tools

    Disambiguation4/5

    Tools are mostly organized by subsystem with clear configure_*/get_* pairing, so a careful agent can usually tell them apart. The main overlaps are trigger status between get_trigger and get_acquisition_state, and summary statistics between measure and analyze_waveform, but the detailed descriptions resolve most ambiguity.

    Naming Consistency3/5

    The dominant configure_*/get_* pattern is consistent and readable, but it is broken by bare verbs like run, stop, single, autoset, and measure, plus odd forms like scope_identify and sync_afg_phase. The convention is recognizable but not applied uniformly enough for a 5.

    Tool Count3/5

    38 tools is a heavy surface, but the scope is genuinely broad: connection, acquisition, measurement, waveform capture, math, decode, AFG, cursors, meters, histograms, and references. The count is defensible because each tool maps to a distinct device function, though it is near the upper limit of what an agent can comfortably navigate.

    Completeness4/5

    The set gives thorough lifecycle coverage: connect/identify, acquire/control, configure and read the main axes, measure and capture waveforms, plus deep subsystems like math, decode, AFG, cursors, meters, histograms, and references. Minor gaps exist—no explicit acquisition-mode/memory-depth configuration and no digital-channel enable/threshold control—but core workflows have no dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables control and querying of Rigol DHO824 oscilloscopes, allowing users to capture waveforms, take screenshots, and interact with oscilloscope settings through natural language.
      62 PyPI
      7
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to control Rigol MSO5000 oscilloscopes through VISA, including acquisition, channels, trigger, timebase, waveform generator, display, and front-panel controls, with risk-based permission gating for direct SCPI operations.
      6
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      Enables Claude Code sessions to control a Rigol DS1054Z oscilloscope over USB, reading identity, settings, measurements, screenshots and waveforms, and applying undoable or destructive changes such as channel, timebase, trigger and acquisition configuration, run control, autoscale and reset. Tool calls come with read-only and destructive hints so safe operations can be auto-approved while risky ones stay behind user approval.
      17
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude or users to control SCPI-compatible oscilloscopes over Ethernet or USB, including measuring signals, changing settings, sending queries/writes, and capturing screenshots.
      MIT