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

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, ARB00ARB15).
  • 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mhs5200a_mcp-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mhs5200a_mcp-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file mhs5200a_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: mhs5200a_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mhs5200a_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 abd3314f18aef48537015cfb1082171d79f7362615c05a02421a07823a97f400
MD5 668a165dd150d4a5d6a624dd5328146c
BLAKE2b-256 d5a27d06615630f18826940272e9949db640db21723a9c4561be7a9c8f88a7c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mhs5200a_mcp-0.1.1.tar.gz:

Publisher: python-publish.yml on NaoNaoMe/mhs5200a-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mhs5200a_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mhs5200a_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mhs5200a_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d8b5aee9a8f11316d046d5e5584b958131af080fefa81dfa7e47c3915596d75
MD5 e938a4d1e82ca45198ce9ee2da2ef67c
BLAKE2b-256 f87ba7a6f926a9ed931b826a76998966859d0450b5b53b5318f808f67cb722a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mhs5200a_mcp-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on NaoNaoMe/mhs5200a-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 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