MHS-5200A MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MHS-5200A MCP Server Set CH1 frequency to 1 kHz, amplitude to 5 V, waveform to sine."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MHS-5200A MCP Server
A Model Context Protocol (MCP) server for controlling MHS-5200A series signal generators (and compatible models such as MHS-5200P / MHS-5225A) via a serial connection.
Features
Full Channel Control: Set frequency, amplitude, duty cycle, DC offset, phase, and waveform for both channels independently.
Waveform Selection: Support for Sine, Square, Triangle, Sawtooth, and Arbitrary waveforms.
Frequency Sweep: Configure and run linear or logarithmic frequency sweeps.
Arbitrary Waveforms: Upload custom waveform data (2 048 points) to any of the 16 memory slots.
Advanced Features: Control channel tracking, output inversion, and the internal power amplifier (if equipped).
Related MCP server: dwf-mcp-server
Requirements
Python >= 3.13
mcp[cli]2.x (v0.2.0 and later; usemhs5200a-mcp0.1.x if you are pinned tomcp1.x)
Installation
Using uv (recommended):
uv pip install mhs5200a-mcpOr via pip:
pip install mhs5200a-mcpOr from source:
git clone https://github.com/NaoNaoMe/mhs5200a-mcp.git
cd mhs5200a-mcp
uv syncConfiguration
Claude Desktop Config
Add the server to your claude_desktop_config.json:
{
"mcpServers": {
"mhs5200a-mcp": {
"command": "uvx",
"args": [
"mhs5200a-mcp"
]
}
}
}Tools Overview
Connection
mhs5200_connect: Connect to the device via serial port (e.g.,COM3,/dev/ttyUSB0).mhs5200_disconnect: Disconnect from the device.mhs5200_get_status: Get current settings for all channels.
Channel Control
mhs5200_set_frequency: Set frequency in Hz (0.01 Hz – 25 MHz).mhs5200_set_amplitude: Set amplitude in volts peak-to-peak (0–15 V).mhs5200_set_waveform: Select waveform (SINE,SQUARE,TRIANGLE,SAWTOOTH_UP,SAWTOOTH_DOWN,ARB00–ARB15).mhs5200_set_duty_cycle: Set duty cycle percentage (0–99.9 %).mhs5200_set_offset: Set DC offset percentage.mhs5200_set_phase: Set phase offset between channels.mhs5200_set_invert: Invert waveform output.
Global Settings
mhs5200_set_output: Enable or disable all outputs.mhs5200_set_tracking: Enable channel tracking (CH2 follows CH1).mhs5200_set_power_amp: Enable the internal power amplifier (if supported).
Sweeps & Arbitrary Waveforms
mhs5200_configure_sweep: Configure frequency sweep parameters (start/stop frequency, time, mode).mhs5200_set_sweep: Start or stop the configured sweep.mhs5200_upload_arb_waveform: Upload custom waveform data from a file.
Example Workflow
Connect: Call
mhs5200_connectwith the serial port name (e.g.,COM3).Check Status: Call
mhs5200_get_statusto read the current device settings.Configure: Use
mhs5200_set_frequency,mhs5200_set_amplitude, etc. to set the desired output.Enable Output: Call
mhs5200_set_outputto turn on the signal.Disconnect: Call
mhs5200_disconnectwhen finished.
License
This project is licensed under the MIT License — see the LICENSE file for details.
Available Tools
16 toolsmhs5200_configure_sweepA
Set sweep parameters for a channel. Use mhs5200_set_sweep to start/stop the configured sweep.
Args: params: Sweep configuration containing: - start_hz (float): Start frequency in Hz - stop_hz (float): Stop frequency in Hz - time_sec (int): Sweep duration (1-600 seconds) - mode (str): "LINEAR" or "LOG" - channel (1 or 2): Target channel
Returns: JSON confirming sweep configuration and start.
Inputs: params (required). Returns: result
mhs5200_connectAIdempotent
Connect to MHS-5200A signal generator via serial port.
This must be called before using any other mhs5200_* tools. If already connected, the existing connection is closed first.
Args: params: Connection parameters containing: - port (str): Serial port name (e.g., 'COM3', '/dev/ttyUSB0')
Returns: JSON with connection status and device information: { "status": "ok", "model": "5225A", "serial": "1234567890" }
Inputs: params (required). Returns: result
mhs5200_disconnectAIdempotent
Disconnect from the MHS-5200A signal generator.
Safe to call even if not connected.
Returns: JSON with disconnection status: {"status": "disconnected"} or {"status": "not_connected"}
Inputs: no named parameters. Returns: result
mhs5200_get_statusARead-onlyIdempotent
Get complete status of all channels and device settings.
Returns: JSON with full device status including: - Channel 1 & 2: frequency, amplitude, waveform, duty cycle, offset, phase - Global: output state, tracking mode, power amp state
Inputs: no named parameters. Returns: result
mhs5200_set_amplitudeAIdempotent
Set the peak-to-peak voltage for a channel.
Automatically adjusts attenuation setting for optimal output.
Args: params: Amplitude parameters containing: - channel (1 or 2): Target channel - vpp (float): Peak-to-peak voltage (0.0 to 15.0 V)
Returns: JSON confirming the new amplitude setting.
Inputs: params (required). Returns: result
mhs5200_set_duty_cycleAIdempotent
Set the duty cycle for a channel (primarily affects square waves).
Args: params: Duty cycle parameters containing: - channel (1 or 2): Target channel - duty_percent (float): Duty cycle (0.0 to 99.9 %)
Returns: JSON confirming the new duty cycle setting.
Inputs: params (required). Returns: result
mhs5200_set_frequencyAIdempotent
Set the output frequency for a channel.
Args: params: Frequency parameters containing: - channel (1 or 2): Target channel - frequency_hz (float): Frequency in Hz (0.01 to max supported by model)
Returns: JSON confirming the new frequency setting.
Inputs: params (required). Returns: result
mhs5200_set_invertAIdempotent
Invert (flip vertically) the waveform output for a channel.
Args: params: Invert parameters containing: - channel (1 or 2): Target channel - inverted (bool): True to invert, False for normal
Returns: JSON confirming the inversion setting.
Inputs: params (required). Returns: result
mhs5200_set_offsetAIdempotent
Set the DC offset for a channel.
The offset is specified as a percentage of half the peak-to-peak amplitude (Vpp/2). For example, with a 5Vpp signal: - offset_percent = 100 shifts the signal by +2.5V - offset_percent = -120 shifts the signal by -3.0V
Formula: DC offset voltage = (Vpp / 2) × (offset_percent / 100)
Args: params: Offset parameters containing: - channel (1 or 2): Target channel - offset_percent (float): Offset as percentage of Vpp/2 (-120 to +120, 0 is center)
Returns: JSON confirming the new offset setting.
Inputs: params (required). Returns: result
mhs5200_set_outputAIdempotent
Enable or disable all signal outputs.
Args: params: Output control parameters containing: - enabled (bool): True to enable outputs, False to disable
Returns: JSON confirming the output state.
Inputs: params (required). Returns: result
mhs5200_set_phaseAIdempotent
Set the phase offset of CH2 relative to CH1.
Args: params: Phase parameters containing: - phase_deg (int): Phase offset (-180° to +180°) Positive = CH2 leads CH1 Negative = CH2 lags CH1
Returns: JSON confirming the new phase setting.
Inputs: params (required). Returns: result
mhs5200_set_power_ampAIdempotent
Enable or disable the internal power amplifier.
Note: Not all MHS-5200A models have this feature.
Args: params: Power amp parameters containing: - enabled (bool): True to enable power amplifier
Returns: JSON confirming the power amp state.
Inputs: params (required). Returns: result
mhs5200_set_sweepAIdempotent
Start or stop the frequency sweep.
Use mhs5200_configure_sweep first to set sweep parameters, then use this tool to start/stop the sweep.
Args: params: Sweep control parameters containing: - enabled (bool): True to start sweep, False to stop sweep
Returns: JSON confirming the sweep state.
Inputs: params (required). Returns: result
mhs5200_set_trackingAIdempotent
Enable or disable frequency tracking mode.
When enabled, CH2 automatically follows CH1's frequency.
Args: params: Tracking parameters containing: - enabled (bool): True to enable tracking
Returns: JSON confirming the tracking mode.
Inputs: params (required). Returns: result
mhs5200_set_waveformAIdempotent
Set the waveform type for a channel.
Args: params: Waveform parameters containing: - channel (1 or 2): Target channel - waveform (str): One of SINE, SQUARE, TRIANGLE, SAWTOOTH_UP, SAWTOOTH_DOWN, or ARB00-ARB15 for arbitrary
Returns: JSON confirming the new waveform setting.
Inputs: params (required). Returns: result
mhs5200_upload_arb_waveformADestructiveIdempotent
Upload custom arbitrary waveform data to device memory.
The waveform data must contain exactly 2048 samples, each an integer from 0 to 4095 (12-bit resolution). 2048 is the midpoint (zero crossing).
Args: params: Upload parameters containing: - arb_index (int): Memory slot (0-15, corresponds to ARB00-ARB15) - filepath (str): Path to data file JSON format: [0, 100, 200, ...] Text format: one integer per line
Returns: JSON confirming upload success with slot number and sample count.
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
All 16 tools have distinct, clearly defined purposes with no overlap. Each tool addresses a specific function (e.g., connect, set_frequency, upload_arb_waveform) with unique parameters.
Tool names consistently follow the 'mhs5200_verb_noun' pattern in snake_case. Variations like 'upload_arb_waveform' (verb_adj_noun) are minor and still predictable.
16 tools provide comprehensive coverage for a signal generator's typical operations without being excessive. The scope is well-scoped for the domain.
Covers most expected operations (connection, waveform, frequency, amplitude, etc.), but lacks per-channel output control (only global) and possibly impedance or reset functions.
Maintenance
Related MCP Connectors
Create RF signal projects from prompts, inspect graphs, and export IQ data.
Documentation for the Spektralwerk spectrometer SCPI API as a streamable HTTP MCP Server
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Build, run and analyse block-diagram simulations: PID, Bode, FFT, optimisation and code export.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that lets AI assistants control Siglent SDG waveform generators over a local network using natural language, supporting signal generation, modulation, sweep, burst, and arbitrary waveforms.20514 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables control of Digilent WaveForms instruments (oscilloscope, AWG, logic analyzer) over USB, supporting devices like Analog Discovery 2/3 and Digital Discovery.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables 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-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Siglent SDG-series signal generators, configure waveforms, and switch outputs via natural language.3MIT