Skip to main content
Glama
E4433B MCP Server

E4433B MCP Server

by ikatkov

E4433B MCP server

Control an HP/Agilent E4433B ESG signal generator from an MCP client through an AR488 USB–GPIB adapter. Includes RF settings, analog AM, arbitrary waveform playback, verified WAV upload, expert SCPI query/write tools, and searchable original documentation converted to Markdown locally. No VISA runtime is needed.

Bench-tested with an E4433B identifying as ESG-D4000B, firmware B.03.86, options 1E5/UN8/UN9/UND, and AR488 0.55.22. Supports macOS and POSIX Linux; the process lock currently uses fcntl, so native Windows is not supported.

Install

Install uv, then:

git clone https://github.com/ikatkov/e4433b-mcp.git
cd e4433b-mcp
./setup

setup installs Python into .python/ and dependencies into .venv/, both inside this checkout. It copies dependencies instead of linking to another project's files. The stable MCP entry point is run-mcp; clients need not know the virtual environment path. Nothing opens the instrument during startup/discovery. After relocating the checkout, rerun setup to regenerate environment paths.

The server has no network listener. Once installed, hardware control and manual search work offline. Hardware serial access and operating-system libraries remain normal external system interfaces.

Related MCP server: Instrument MCP Server

Connect a client

From the project directory, register the absolute launcher path.

Claude Code:

claude mcp add --scope user --transport stdio e4433b --env E4433B_ADDRESS=30 -- "$(pwd)/run-mcp"

Codex:

codex mcp add e4433b --env E4433B_ADDRESS=30 -- "$(pwd)/run-mcp"

Configure the client's tool-call timeout to 900 seconds for waveform transfers. For Codex this is tool_timeout_sec = 900 in [mcp_servers.e4433b]. See the official Codex MCP documentation. Reload the MCP connection or start a new client session after changing registration.

Any stdio MCP client can use this configuration, with its own timeout setting:

{
  "mcpServers": {
    "e4433b": {
      "command": "/absolute/path/to/e4433b-mcp/run-mcp",
      "env": {"E4433B_ADDRESS": "30"}
    }
  }
}

Environment variable

Default

Purpose

E4433B_PORT

automatic

Select the only CH340 adapter; set explicitly for other adapters or ambiguity.

E4433B_ADDRESS

30

Generator GPIB primary address.

E4433B_SERIAL

unset

Optional check against your generator's serial number.

The adapter link is 115200 baud. Start with get_status. Only one client may own an adapter at a time; call disconnect before using it from another session.

Original documentation as Markdown

The catalog covers four original Agilent manuals, 1,205 source pages: base SCPI, front-panel operation, UND Dual ARB and UN8 real-time I/Q.

To build the local Markdown library, install curl and Poppler (pdftotext and pdfinfo), then run:

uv run python scripts/fetch_manuals.py

Source PDFs are temporary inputs and are removed after conversion. No PDFs are stored in the project. The full manufacturer text retains its original copyright and is not redistributed on GitHub or in package builds; see third-party notices. Your generated .md files remain inside src/e4433b_mcp/manuals/, usable with ordinary grep/rg and MCP search.

The server works without the manual download; the catalog reports availability and text tools explain how to install missing manuals. Once imported, no network is needed. Sources, editions, page numbering and conversion limitations are in the manual index.

Tools

Tool

Purpose

list_adapters

Enumerate USB adapters without connecting.

get_status

Read identity, options and the full signal-path configuration.

read_errors

Return and consume the error queue without silently clearing it.

set_rf

Set carrier/level; preserve modulation and RF state.

set_rf_output

Explicit RF output enable/disable.

list_waveforms

List volatile ARB waveforms.

play_waveform

Restore continuous I/Q playback of an existing waveform.

configure_am_tone

Configure ordinary analog sine AM.

set_am_depth

Change active analog AM depth.

upload_am_wav

Convert mono 16-bit PCM WAV, upload separate I/Q planes and verify bytes.

inspect_waveform

Read I/Q hashes and sample ranges.

disconnect

Release the adapter and optionally return front-panel control.

list_manuals

List manual editions, sources, coverage and local availability.

search_manuals

Search Markdown and return page references.

read_manual_pages

Read 1–5 source pages as Markdown.

scpi_query

Send one expert ASCII query and read exactly one response.

scpi_write

Send one expert ASCII non-query without extra commands.

Static resources: e4433b://guide, e4433b://commands, e4433b://manuals. Templates expose complete manuals and individual pages. Prefer typed controls for supported tasks; use expert SCPI after checking model and option applicability. ASCII commands must be shorter than 128 bytes and cannot contain batches/newlines. Binary transfers use the dedicated block transport.

RF and transfer behavior

  • Configuration/playback tools leave RF off unless rf_on=true is explicit. set_rf preserves the existing RF state. disconnect does not change RF state.

  • Expert tools execute exactly the requested command. They add no RF mute, reset, error drain or retry. Verify writes using the documented query and read_errors.

  • One persistent serial connection avoids resetting the Nano per query. Whole operations are serialized; a process lease prevents competing clients.

  • ++auto 0 plus explicit query/read pairs avoids extra reads. On the verified firmware, options are read with DIAG:INFO:OPT?, not *OPT?.

  • E443xB UND uploads use separate ARBI/ARBQ planes, offset-14-bit big-endian samples, escaped 96-byte chunks and final-only EOI. This differs from newer interleaved waveform formats. Interrupted uploads can leave partial files.

  • Typed configuration failures attempt RF off. A lost connection cannot guarantee physical output state. Writes are never automatically retried.

  • Uploaded voice AM depth is encoded in its I/Q samples; the analog AM depth menu does not change it. Instrument readback is distinct from a scope measurement.

See operating notes, command provenance, bench validation, and source-level comparisons.

Development

./setup
uv run pytest
uv run ruff check .
uv run python scripts/check_mcp.py

Tests run without hardware or original manual downloads. An additional integration test checks full manuals when installed. For a read-only live check, release any other client and use uv run python scripts/check_mcp.py --hardware; it reads status/catalog and disconnects without enabling RF or clearing errors.

MIT licensed code. Manufacturer documentation is separately owned.

Available Tools

17 tools
configure_am_toneA
Idempotent

Configure ordinary sine-tone AM with adjustable front-panel depth.

Uses analog AM path 1 and disables ARB/IQ and competing modulation. Rate 0.1–50000 Hz, depth 0.1–100%. RF stays OFF unless rf_on=True. This replaces voice playback with a tone; it does not alter the stored voice waveform.

Inputs: level_dbm (required), frequency_hz (required), rf_on, rate_hz, +1 more.

disconnectA
Idempotent

Release the adapter so another client can use it; preserve RF settings.

By default also return front-panel control. The next status/control call reconnects automatically. Server exit closes the port without turning RF off.

Inputs: return_local.

get_statusA
Read-only

Connect lazily and read E4433B identity, installed options, and live settings.

full=True also checks I/Q source, both analog modulation paths, ALC, high-crest mode, clocks, trigger, offsets, and blanking. Does not reset, clear errors, or change generator settings. Returns diagnostic notes.

Inputs: full.

inspect_waveformA
Read-only

Read stored I/Q samples and report hashes/ranges without modifying them.

This can take minutes and may interrupt playback while the instrument services the read. Marker/sequencer bits can change raw hashes without changing the lower 14-bit audio samples. This does not measure RF output.

Inputs: name (required).

list_adaptersA
Read-only

List USB serial adapters without opening ports or changing the instrument.

Inputs: no named parameters.

list_manualsA
Read-only

List local original-manual Markdown conversions, sources, coverage and page counts.

Inputs: no named parameters.

list_waveformsA
Read-only

List existing volatile ARB waveforms. Requires installed UND option.

Volatile waveforms can disappear after power-off. Check this before restoring playback; never assume yesterday's voice waveform still exists.

Inputs: no named parameters.

play_waveformA
Idempotent

Restore a complete continuous I/Q playback setup using an existing waveform.

For our voice: name='VOICE_T12', sample_rate_hz=16000, frequency_hz=750000, level_dbm=-10. Specify rf_on=True only when output is requested. Restores internal I/Q and clock, master modulation, continuous trigger, normal crest mode, no gating/blanking or competing analog modulation, ALC off, and runs fixed-reference power search. Does not upload or modify samples. Voice modulation depth is encoded in the waveform, not the AM menu.

Inputs: name (required), level_dbm (required), frequency_hz (required), sample_rate_hz (required), +1 more.

read_errorsA
Idempotent

Read and consume the instrument's error queue, returning every recorded error.

This is separate from status because reading removes the errors. No *CLS or preset is sent. Old errors are also returned by configuration tools.

Inputs: no named parameters.

read_manual_pagesA
Read-only

Read 1–5 source pages of original documentation as Markdown.

Page numbers are 1-based source-document pages, not printed chapter labels. Text preserves syntax and tables; diagrams are not reproduced. Check model, installed option and firmware applicability before issuing an exotic command.

Inputs: page (required), manual_id (required), page_count.

scpi_queryA
Destructive

Expert escape hatch: send ONE ASCII query and read ONE ASCII response.

Look up the command in the Markdown manuals first. Queries can consume state or start tests, so this is not universally read-only. No extra error query, preset, retry or RF change is added. For binary responses use the driver's block transport, not this ASCII tool. One printable command under 128 bytes; no semicolon batches, newlines or AR488 ++ commands. Unsupported queries may time out or cause -420. Query errors separately with read_errors.

Inputs: command (required).

scpi_writeA
Destructive

Expert escape hatch: send ONE ASCII non-query exactly as requested.

May change RF, erase data, reset or calibrate depending on the command; use only within the user's requested work after checking the manual. No automatic RF mute, preset, error drain or retry is added. Success confirms transport completion only: follow with the documented query and read_errors. Under 128 printable ASCII bytes; no semicolon batches, newlines, AR488 ++ commands or binary blocks. Prefer typed tools for supported procedures.

Inputs: command (required).

search_manualsA
Read-only

Search original manual text offline; return page references and short excerpts.

Literal, case-insensitive matching; whitespace is normalized. Search full command spellings (e.g. HICRest) or keywords, not only abbreviated SCPI. Use next_offset for more matches, read_manual_pages for complete context.

Inputs: query (required), offset, manual_id, max_results.

set_am_depthA
Idempotent

Change active analog AM path 1 depth (0.1–100%). Preserves RF on/off.

Rejects I/Q voice playback: its depth must be changed by generating a new waveform with upload_am_wav. Does not silently switch modulation modes.

Inputs: depth_percent (required).

set_rfA
Idempotent

Set a fixed carrier (250 kHz–4 GHz) and level setting (−135 to +20 dBm).

Preserves RF on/off and modulation. Clears frequency/power display offsets and reference modes, disables sweeps, and enables automatic attenuation. RF is temporarily muted while settings change. With scaled I/Q, level_dbm is a generator setting, not a calibrated carrier-power measurement.

Inputs: level_dbm (required), frequency_hz (required).

set_rf_outputA
Idempotent

Explicitly turn RF OUTPUT on or off and verify the enable state.

Enabling uses the current frequency, level, and modulation. Read status first when these are unknown. Disabling does not discard the waveform.

Inputs: enabled (required).

upload_am_wavA
Destructive

Upload a local mono 16-bit PCM WAV as conventional AM using separate I/Q files.

Depth is a fraction (0.5 means 50% peak), range 0.001–0.99. Input must be 8–48 kHz, 16–131072 samples. Files stay local; no cloud service is involved. Uses E443xB offset-14-bit big-endian format and verifies every uploaded byte. Turns RF and ARB OFF and leaves them off. Call play_waveform separately. Existing names require overwrite=True. May take several minutes; configure the MCP client's tool timeout to 900 seconds. Partial files may remain on failure; no automatic upload retry or deletion is performed.

Inputs: name (required), path (required), depth, overwrite.

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 17 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, but set_rf and set_rf_output share similar names and both affect RF, creating potential misselection. The modulation-related tools (configure_am_tone, set_am_depth, upload_am_wav, play_waveform) are well differentiated by their detailed descriptions.

    Naming Consistency4/5

    15 of 17 tools follow a consistent verb_noun pattern (e.g., list_manuals, set_rf, play_waveform), but scpi_query and scpi_write invert to noun_verb, and disconnect is verb-only. These are minor deviations from an otherwise predictable schema.

    Tool Count3/5

    17 tools is borderline heavy for this server's apparent scope; the manual search (3 tools) and waveform/AM tools (6 tools) add up, though each has a distinct purpose. The count feels slightly over what is ideal.

    Completeness3/5

    The typed surface lacks a generic I/Q waveform upload or delete tool, and FM/PM/sweep modulation types are absent, relying on SCPI escape hatches. SCPI cannot perform binary uploads, so creating new voice waveforms is impossible through this server.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables control of MHS-5200A series signal generators via serial connection, including frequency, amplitude, waveform, and sweep settings.
      16
      16 PyPI
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Enables natural language control of test instruments like spectrum analyzers and power supplies via SCPI commands, with auto-discovery and multi-instrument session support.
      100
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables control of Digilent WaveForms instruments (oscilloscope, AWG, logic analyzer) over USB, supporting devices like Analog Discovery 2/3 and Digital Discovery.
      3
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables remote control of Siglent SDG series function/arbitrary waveform generators via SCPI over TCP/IP. Provides tools for configuring waveforms, modulation, sweep, burst, and other instrument functions.
      1
      -