Skip to main content

MHS-5200A MCP Server

License: MIT

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).

Requirements

  • Python >= 3.13
  • mcp[cli] 2.x (v0.2.0 and later; use mhs5200a-mcp 0.1.x if you are pinned to mcp 1.x)

Installation

Using uv (recommended):

uv pip install mhs5200a-mcp

Or via pip:

pip install mhs5200a-mcp

Or from source:

git clone https://github.com/NaoNaoMe/mhs5200a-mcp.git
cd mhs5200a-mcp
uv sync

Configuration

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

  1. Connect: Call mhs5200_connect with the serial port name (e.g., COM3).
  2. Check Status: Call mhs5200_get_status to read the current device settings.
  3. Configure: Use mhs5200_set_frequency, mhs5200_set_amplitude, etc. to set the desired output.
  4. Enable Output: Call mhs5200_set_output to turn on the signal.
  5. Disconnect: Call mhs5200_disconnect when finished.

License

This project is licensed under the MIT License — see the LICENSE file for details.

Metadata

Release files for mhs5200a-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mhs5200a-mcp 0.2.0
File Size Uploaded
mhs5200a_mcp-0.2.0.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mhs5200a-mcp 0.2.0
File Interpreter ABI Platform
mhs5200a_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / mhs5200a_mcp-0.2.0.tar.gz

Download URL mhs5200a_mcp-0.2.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3d89cd7756c24fe693eba0ede61f11525be49b8b8880cc243e09a5450c3360c3
BLAKE2b-256 checksum
How to use checksums
280daa77edc7ee317c44c9f93c2f25e290d11eb69630e8ff7e94404040c23f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / mhs5200a_mcp-0.2.0-py3-none-any.whl

Download URL mhs5200a_mcp-0.2.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecc77c9621a283487b76e2b3b53e03384b43fe8027909fffd44d8b2052cfc88e
BLAKE2b-256 checksum
How to use checksums
ba15b2dd5ad8711497bac0ca03a12de9b2f5aa705ab0accef1c578149f060159
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page