Skip to main content
Glama
mcp-rs-cmw500
by RFingAdam

CI License Python 3.10+ MCP eng-mcp-suite

Drive the Rohde & Schwarz CMW500 Wideband Radio Communication Tester from any MCP-compatible AI client. Direct TCP/IP SCPI (port 5025): 84 tools across LTE signaling, WLAN, Bluetooth/BLE, and GPRF. No CMWrun dependency.

Quick start · Tools · Workflows · Documentation


IMPORTANT

Hardware required for real measurements. This MCP server controls a real R&S CMW500 Wideband Radio Communication Tester over TCP/IP SCPI. The relevant CMW500 application licenses (LTE / WLAN / Bluetooth / GPRF) must be enabled on the unit for the matching tool surface to do anything.

A simulator is included (cmw-simulator) so the server can be evaluated and its logic exercised without an instrument. It produces synthetic values only: its *IDN? says CMW500-SIMULATOR, and every result it produces is marked simulated. Never report its numbers as measurements.

What is mcp-rs-cmw500?

mcp-rs-cmw500 is a Model Context Protocol server that automates the R&S CMW500 Wideband Radio Communication Tester over direct TCP/IP SCPI (port 5025). No CMWrun dependency, no proprietary middleware: your AI agent talks to the CMW500 the same way a Python script would, only in natural language.

The server covers five RF technology domains: LTE signaling (cell config, NAS/bearer, C-DRX, full TX measurements), WLAN non-signaling (802.11a/b/g/n/ac/ax with 20/40/80/160 MHz channels), Bluetooth/BLE non-signaling (Classic DH1-DH5 + LE 1M/2M/Coded), GPRF generator/analyzer (CW/ARB output, power/spectrum measurements), and shared signal-path control.

What mcp-rs-cmw500 does well:

  • AI-native via MCP. First-class Model Context Protocol server with 84 tools across 5 RF technology domains. Any Claude / LLM agent can drive it.

  • Python + MCP surfaces. Import rs_cmw500_mcp for direct driver access, or run as an MCP server for AI-agent automation.

  • Direct SCPI. TCP/IP straight to the CMW500. No CMWrun, no NI-VISA install, no vendor middleware.

  • yes Pre-built templates. lte_tx_power, gprf_power, nonsig_rx, wlan_tx, wlan_rx, ble_tx, ble_rx, bt_classic_tx.

  • AGPL-3.0-or-later. Safety system (power / frequency clamps), SCPI-injection-guarded, raw-SCPI disable flag.


Related MCP server: 5G-MAG M1 Interface MCP Server

Quick start

Install

git clone https://github.com/RFingAdam/mcp-rs-cmw500.git
cd mcp-rs-cmw500
uv pip install -e ".[dev]"

Configure

cp .env.example .env   # edit with your CMW500 IP + safety limits

Variable

Default

Description

CMW_DEFAULT_HOST

127.0.0.1

CMW500 IP address

CMW_DEFAULT_PORT

5025

SCPI TCP port

CMW_MAX_GENERATOR_POWER_DBM

0

Max generator output

CMW_MAX_EXPECTED_POWER_DBM

33

Max analyzer input

CMW_MAX_FREQUENCY_HZ

6e9

Upper frequency bound

CMW_ALLOW_RAW_SCPI

false

Enable raw SCPI commands

Two surfaces, same answer

Python

import asyncio
from rs_cmw500_mcp.driver import CMW500Driver
from rs_cmw500_mcp.models.cmw_types import CellConfig

async def main():
    async with CMW500Driver("192.168.1.100", 5025) as cmw:
        await cmw.lte_configure_cell(
            CellConfig(
                band=7,
                bandwidth_mhz=20,
                dl_earfcn=3100,
                dl_level_dbm=-70,
            )
        )
        await cmw.lte_cell_on()
        # ... wait for UE attach ...
        await cmw.lte_meas_configure(stat_count=10)
        await cmw.lte_meas_trigger()
        results = await cmw.lte_meas_fetch_all()
        # Each view is an envelope: check the verdict before the numbers.
        power = results["power"]
        if power["trustworthy"]:
            print(power["values"])
        else:
            print("no measurement:", power["error"])

asyncio.run(main())

MCP (Claude Desktop, Claude Code, any MCP client)

{
  "mcpServers": {
    "rs-cmw500": {
      "command": "uv",
      "args": [
        "--directory", "/path/to/mcp-rs-cmw500",
        "run", "rs-cmw500-mcp"
      ]
    }
  }
}

Then ask your assistant:

"Bring up a 20 MHz LTE cell on band 7 EARFCN 3100, wait for the UE to attach, then trigger TX power, EVM, ACLR, SEM, and frequency-error measurements."

The agent walks the LTE measurement workflow tool-by-tool and returns the result set.

Run

rs-cmw500-mcp        # MCP server over stdio

Try it without a CMW500

cmw-simulator --port 5125 --time-scale 0.01   # in one terminal
CMW_DEFAULT_PORT=5125 rs-cmw500-mcp           # in another

The simulator parses a real SCPI command tree, keeps a real error queue, and can inject the failures that matter: dropped responses, surplus responses, and specific reliability codes:

cmw-simulator --port 5125 --drop-responses 1   # exercise desync recovery

It binds loopback only unless you pass --allow-remote.


Tools

84 MCP tools, grouped:

Group

Count

Examples

Connection

8

cmw_discover, cmw_connect, cmw_identify, cmw_get_status, cmw_query_options, cmw_get_errors, cmw_get_capabilities

GPRF Generator

7

cmw_gen_set_frequency, cmw_gen_set_level, cmw_gen_output_on/off, cmw_gen_load_arb, cmw_gen_configure_arb

GPRF Analyzer

11

cmw_meas_configure_power, cmw_meas_configure_spectrum, cmw_meas_trigger, cmw_meas_fetch_power, cmw_measure

GPRF Signal Path

4

cmw_set_signal_path, cmw_get_signal_path, cmw_set_port, cmw_system_all_off

RF de-embedding

2

cmw_set_external_attenuation, cmw_get_external_attenuation

LTE Signaling

16

cmw_lte_configure_cell, cmw_lte_cell_on/off, cmw_lte_configure_nas/bearer/cdrx, cmw_lte_meas_*

WLAN Non-Signaling

11

cmw_wlan_configure, cmw_wlan_set_standard/bandwidth/frequency, cmw_wlan_fetch_*

Bluetooth/BLE Non-Signaling

11

cmw_bt_configure, cmw_bt_set_technology/ble_mode/packet_type, cmw_bt_fetch_*

SCPI

4

cmw_scpi_send, cmw_scpi_query, cmw_reset, cmw_preset

Templates

3

cmw_list_templates, cmw_load_template, cmw_apply_template

State

3

cmw_save_state, cmw_load_state, cmw_get_full_state

Limits

4

cmw_define_limit, cmw_check_limits, cmw_list_limits, cmw_clear_limits

Available templates: lte_tx_power, gprf_power, nonsig_rx, wlan_tx, wlan_rx, ble_tx, ble_rx, bt_classic_tx. Full tool reference in docs/tools.md.


What it solves

Domain

Measurements

Standards

LTE signaling

Cell setup, NAS attach, bearer, C-DRX, TX power, EVM, ACLR, SEM, frequency error

3GPP TS 36.521

WLAN non-signaling

802.11a/b/g/n/ac/ax @ 20/40/80/160 MHz: TX power, EVM, spectrum flatness, frequency error

IEEE 802.11

Bluetooth Classic

DH1-DH5 packet types: TX power, modulation (DEVM), frequency offset/drift

Bluetooth Core 5.x

BLE

1M / 2M / Coded S2 / S8: TX power, modulation, frequency

Bluetooth Core 5.x

GPRF

CW/ARB output, power, spectrum: for vendor-specific test sequences

n/a


Safety

The server enforces configurable safety limits to protect your equipment:

  • Generator power: bounded between CMW_MIN_GENERATOR_POWER_DBM and CMW_MAX_GENERATOR_POWER_DBM.

  • Analyzer expected power: bounded by CMW_MAX_EXPECTED_POWER_DBM.

  • Frequency range: bounded between CMW_MIN_FREQUENCY_HZ and CMW_MAX_FREQUENCY_HZ.

  • SCPI sanitization. All parameters validated against injection patterns.

  • Raw SCPI off by default: must explicitly set CMW_ALLOW_RAW_SCPI=true.

  • Path traversal: state-file paths validated against directory traversal.


Workflows

mcp-rs-cmw500 fits in the following eng-mcp-suite workflow bundles:

  • lab-automation: pair with copper-mountain-vna-mcp, mcp-rs-spectrum-analyzer, and mcp-rs-siggen for end-to-end RF bench-test workflows driven from a single agent session.

  • cellular-compliance: drive 3GPP TS 36.521 LTE test cases under AI control with mcp-emc-regulations supplying market-specific limits.

eng-mcp-suite install --workflow lab-automation

Documentation


Part of eng-mcp-suite

This MCP server is part of

eng-mcp-suite

Part of eng-mcp-suite. An open umbrella of MCP servers for RF / EMC / PCB / signal-integrity engineering. Drop into the lab-automation workflow bundle with eng-mcp-suite install --workflow lab-automation.

Domain

Sibling MCPs

RF / Transmission lines

lineforge

EMC regulatory

mcp-emc-regulations

EM simulation

mcp-openems, mcp-nec2-antenna

Diagrams

drawio-engineering-mcp

Lab gear

copper-mountain-vna-mcp · mcp-rs-spectrum-analyzer · mcp-rs-siggen · mcp-rs-cmw500


Contributing

See CONTRIBUTING.md for development guidelines.

uv run pytest tests/ -q                # all unit tests (no hardware)
uv run pytest tests/ -m "not integration" -q
ruff check src/ tests/ && ruff format src/ tests/
mypy src/rs_cmw500_mcp/

License

AGPL-3.0-or-later. Relicensed from Apache-2.0 in v0.3.0 to align with the eng-mcp-suite toolkit-wide AGPL move.

Trademarks and brand assets

This project is not affiliated with, endorsed by, or sponsored by Rohde & Schwarz GmbH & Co. KG. "Rohde & Schwarz" and "CMW500" are trademarks of Rohde & Schwarz GmbH & Co. KG. They are used here only to identify the instruments this project interoperates with.

The project name and the logo files in this repository are not part of the licensed work. The licence above grants no permission to use them, except as needed to describe the origin of the work.

Acknowledgments

  • Rohde & Schwarz: for the published CMW500 SCPI command reference.

  • The MCP working group: for the Model Context Protocol specification.

Part of eng-mcp-suite: built for RF engineers, PCB designers, EMC labs, and AI agents.

Available Tools

90 tools
cmw_apply_templateC

Apply currently loaded template to CMW500

Inputs: host, port.

cmw_bt_configureC

Configure Bluetooth/BLE non-signaling measurement

Inputs: host, port, ble_mode, technology, +4 more.

cmw_bt_fetch_allB

Fetch all Bluetooth measurement results (power, modulation, frequency)

Inputs: host, port, meas_instance.

cmw_bt_fetch_frequencyC

Fetch Bluetooth frequency measurement results

Inputs: host, port, meas_instance.

cmw_bt_fetch_modulationC

Fetch Bluetooth modulation (DEVM) measurement results

Inputs: host, port, meas_instance.

cmw_bt_fetch_powerC

Fetch Bluetooth TX power measurement results

Inputs: host, port, meas_instance.

cmw_bt_set_ble_modeB

Set BLE PHY mode (1M, 2M, Coded S2/S8)

Inputs: ble_mode (required), host, port, meas_instance.

cmw_bt_set_expected_powerB

Set Bluetooth expected input power in dBm

Inputs: power_dbm (required), host, port, meas_instance.

cmw_bt_set_frequencyC

Set Bluetooth measurement frequency in Hz

Inputs: frequency_hz (required), host, port, meas_instance.

cmw_bt_set_packet_typeB

Set Bluetooth Classic packet type (DH1/DH3/DH5/etc.)

Inputs: packet_type (required), host, port, meas_instance.

cmw_bt_set_technologyC

Set Bluetooth technology (Classic or Low Energy)

Inputs: technology (required), host, port, meas_instance.

cmw_bt_triggerC

Trigger Bluetooth multi-evaluation measurement

Inputs: host, port, meas_instance.

cmw_check_limitsC

Check measurement values against defined limits

Inputs: measurements (required).

cmw_clear_limitsA

Clear all defined limits

Inputs: no named parameters.

cmw_connectA

Connect to CMW500 at specified host:port

Inputs: host, port.

cmw_define_limitC

Define a pass/fail limit for measurement checking

Inputs: name (required), parameter (required), unit, max_value, +1 more.

cmw_disconnectC

Disconnect from CMW500

Inputs: host, port.

cmw_discoverA

Scan for CMW500 instruments on the network (port 5025)

Inputs: host, end_port, start_port.

cmw_gen_configure_arbC

Configure ARB waveform playback mode (continuous/single)

Inputs: host, port, repetition.

cmw_gen_load_arbB

Load ARB waveform file on CMW500 generator

Inputs: file_path (required), host, port.

cmw_gen_output_offA

Disable GPRF generator RF output (safe state)

Inputs: host, port.

cmw_gen_output_onB

Enable GPRF generator RF output

Inputs: host, port.

cmw_gen_set_baseband_modeB

Set GPRF generator baseband mode (CW, ARB, etc.)

Inputs: host, mode, port.

cmw_gen_set_frequencyB

Set GPRF generator output frequency in Hz

Inputs: frequency_hz (required), host, port.

cmw_gen_set_levelB

Set GPRF generator output level in dBm

Inputs: level_dbm (required), host, port.

cmw_get_capabilitiesA

Report which technology families this instrument can actually be asked to use, based on its installed options. Call this before planning a campaign: a CMW500 is a chassis, and WLAN, Bluetooth, LTE measurement and LTE signaling are each separately licensed. Without it, an unlicensed application answers '-113 Undefined header', which reads like a client bug rather than a missing licence.

Inputs: host, port, refresh.

cmw_get_errorsA

Drain the instrument's SCPI error queue and report what it rejected. A write command returns no response, so this is the only way to learn that a setting silently failed to apply. Reading the queue clears it.

Inputs: host, port.

cmw_get_external_attenuationA

Report the external attenuation declared for the generator and analyser paths. Check this before trusting any absolute power measurement.

Inputs: host, port.

cmw_get_full_stateC

Get current CMW500 full configuration state

Inputs: host, port.

cmw_get_signal_pathC

Get current GPRF signal path scenario

Inputs: host, port.

cmw_get_statusC

Get CMW500 connection and configuration status

Inputs: host, port.

cmw_identifyB

Get CMW500 identification (*IDN?): manufacturer, model, serial, firmware

Inputs: host, port.

cmw_list_limitsA

List all defined limits

Inputs: no named parameters.

cmw_list_templatesA

List available measurement templates

Inputs: no named parameters.

cmw_load_stateB

Load and restore CMW500 state from file

Inputs: filename (required), host, port.

cmw_load_templateA

Load a measurement template by name, optionally one of its named presets. Call cmw_list_templates to see each template's presets and its valid parameter names.

Inputs: template_name (required), preset, parameters.

cmw_lte_cell_offC

Turn off LTE cell

Inputs: host, port.

cmw_lte_cell_onB

Turn on LTE cell (start base station emulation)

Inputs: host, port.

cmw_lte_configure_bearerB

Configure default EPS bearer (APN and IP version)

Inputs: apn, host, port, ip_version.

cmw_lte_configure_cdrxB

Configure Connected DRX (C-DRX) enable/disable

Inputs: host, port, enabled.

cmw_lte_configure_cellB

Configure LTE cell parameters (band, BW, EARFCN, DL level)

Inputs: band (required), dl_earfcn (required), bandwidth_mhz (required), host, +2 more.

cmw_lte_configure_nasC

Configure LTE NAS parameters (MCC, MNC)

Inputs: mcc, mnc, host, port.

cmw_lte_get_connection_stateC

Get LTE UE connection state (ATT, CONN, IDLE, etc.)

Inputs: host, port.

cmw_lte_get_ue_infoC

Get UE (User Equipment) information including connection state

Inputs: host, port.

cmw_lte_meas_configureC

Configure LTE multi-evaluation measurement (subframe count, repetition)

Inputs: host, port, repetition, stat_count.

cmw_lte_meas_fetch_aclrC

Fetch LTE ACLR (Adjacent Channel Leakage Ratio) measurement results

Inputs: host, port.

cmw_lte_meas_fetch_allB

Fetch all LTE measurement results (power, EVM, ACLR, SEM)

Inputs: host, port.

cmw_lte_meas_fetch_evmC

Fetch LTE EVM (Error Vector Magnitude) measurement results

Inputs: host, port.

cmw_lte_meas_fetch_frequency_errorC

Fetch LTE frequency error measurement results

Inputs: host, port.

cmw_lte_meas_fetch_powerC

Fetch LTE TX power measurement results

Inputs: host, port.

cmw_lte_meas_fetch_semC

Fetch LTE SEM (Spectrum Emission Mask) measurement results

Inputs: host, port.

cmw_lte_meas_triggerC

Trigger LTE multi-evaluation measurement

Inputs: host, port.

cmw_meas_configure_powerC

Configure GPRF power measurement parameters

Inputs: host, port, repetition, meas_length_s, +1 more.

cmw_meas_configure_spectrumA

Configure GPRF spectrum measurement: centre frequency, span, resolution and video bandwidth

Inputs: host, port, rbw_hz, vbw_hz, +2 more.

cmw_meas_fetch_powerC

Fetch GPRF power measurement results (current, average, max, min)

Inputs: host, port, statistic, all_statistics.

cmw_meas_fetch_spectrumC

Fetch GPRF spectrum measurement results

Inputs: host, port.

cmw_meas_set_expected_powerB

Set expected input power for GPRF analyzer in dBm

Inputs: power_dbm (required), host, port.

cmw_meas_set_frequencyC

Set GPRF analyzer measurement frequency in Hz

Inputs: frequency_hz (required), host, port.

cmw_meas_set_power_filterB

Set GPRF power measurement filter type and bandwidth

Inputs: host, port, filter_type, bandwidth_hz.

cmw_meas_set_triggerC

Set GPRF measurement trigger source and threshold

Inputs: host, port, source, threshold_dbm.

cmw_meas_set_user_marginC

Set GPRF analyzer user margin in dB

Inputs: margin_db (required), host, port.

cmw_meas_triggerC

Trigger GPRF power measurement

Inputs: host, port.

cmw_measureA

Run a complete measurement: arm it, wait for the instrument to report the acquisition finished, then fetch the results. Prefer this over separate trigger and fetch calls -- INITiate returns as soon as the measurement is armed, so a separate fetch cannot tell whether it is reading this acquisition or the previous one. Results are marked stale if a setting changed after the trigger.

Inputs: technology (required), host, port, statistic, +3 more.

cmw_presetD

Full system preset of CMW500

Inputs: host, port.

cmw_query_optionsC

Query installed hardware and software options

Inputs: host, port.

cmw_resetC

Reset CMW500 to default state (*RST)

Inputs: host, port.

cmw_rf_route_getA

Report an application's routing scenario and the path this server last applied to it. The connector and converter are not readable from the instrument, so the path is only known if it was set here.

Inputs: application (required), host, port, meas_instance.

cmw_rf_route_setA

Route a measurement or generator application to a front-panel connector and internal converter, e.g. 'RF1C,RX1'. Routing is per-application: setting it for GPRF does nothing for WLAN, Bluetooth or LTE. A converter serves one application at a time, which is what produces resource conflicts when two technologies run at once.

Inputs: application (required), host, path, port, +1 more.

cmw_save_stateB

Save current CMW500 state to file

Inputs: filename (required), host, port, notes.

cmw_scpi_queryC

Send SCPI query and return response

Inputs: command (required), host, port.

cmw_scpi_sendA

Send raw SCPI command to CMW500 (no response)

Inputs: command (required), host, port.

cmw_set_external_attenuationA

Declare the cable and fixture loss between the CMW connector and the DUT, so levels and measured powers refer to the DUT rather than the instrument. Without this every absolute power reading is wrong by the path loss. Attenuation is PER-APPLICATION -- pass the applications you are measuring with, because declaring it for GPRF does nothing for a WLAN or Bluetooth measurement. Setting it also tightens the safety clamps, which check both the DUT plane and the instrument connector.

Inputs: attenuation_db (required), host, port, applications, +1 more.

cmw_set_portC

Set GPRF generator/analyzer RF port connector

Inputs: host, port, analyzer_port, generator_port.

cmw_set_signal_pathC

Set GPRF measurement signal path scenario (standalone or combined)

Inputs: scenario (required), host, port.

cmw_system_all_offC

Turn off all generators and measurements (safe state)

Inputs: host, port.

cmw_wlan_abortA

Stop a running WLAN measurement and release its RF converter. A measurement left in RDY still owns its converter, which causes a resource conflict for the next application that needs it.

Inputs: host, port, meas_instance.

cmw_wlan_configureC

Configure WLAN non-signaling measurement (standard, BW, freq, power)

Inputs: host, port, standard, bandwidth, +3 more.

cmw_wlan_fetch_allA

Fetch all WLAN results (power, EVM, spectrum flatness, freq error)

Inputs: host, port, meas_instance.

cmw_wlan_fetch_evmC

Fetch WLAN EVM (Error Vector Magnitude) measurement results

Inputs: host, port, meas_instance.

cmw_wlan_fetch_frequency_errorC

Fetch WLAN frequency error measurement results

Inputs: host, port, meas_instance.

cmw_wlan_fetch_powerC

Fetch WLAN TX power measurement results

Inputs: host, port, meas_instance.

cmw_wlan_fetch_spectrum_flatnessC

Fetch WLAN spectrum flatness measurement results

Inputs: host, port, meas_instance.

cmw_wlan_set_bandwidthB

Set WLAN channel bandwidth (20/40/80/160 MHz)

Inputs: bandwidth (required), host, port, meas_instance.

cmw_wlan_set_expected_powerB

Set WLAN expected input power in dBm

Inputs: power_dbm (required), host, port, meas_instance.

cmw_wlan_set_frequencyB

Set WLAN measurement frequency in Hz

Inputs: frequency_hz (required), host, port, meas_instance.

cmw_wlan_set_repetitionA

Set WLAN repetition to SINGleshot or CONTinuous. The application defaults to CONTinuous, in which it never reports a finished state, so a synchronised measurement requires SINGleshot.

Inputs: repetition (required), host, port, meas_instance.

cmw_wlan_set_standardB

Set WLAN 802.11 standard (A/B/G/N/AC/AX)

Inputs: standard (required), host, port, meas_instance.

cmw_wlan_set_triggerA

Set the WLAN measurement trigger source. The instrument defaults to 'IF Power', which waits for the input to cross a threshold and will time out on infrequent bursts such as a beacon. Use 'Free Run' to sample continuously, or 'IF Power' to catch the burst itself. Call cmw_wlan_trigger_catalog for the sources this instrument supports.

Inputs: source (required), host, port, meas_instance.

cmw_wlan_triggerC

Trigger WLAN multi-evaluation measurement

Inputs: host, port, meas_instance.

cmw_wlan_trigger_catalogA

List the WLAN trigger sources this instrument supports

Inputs: host, port, meas_instance.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 90 tools

    Disambiguation3/5

    The technology prefixes (gen, meas, bt, lte, wlan) and consistent verb_noun pattern help differentiate tools, but with 90 tools there is some overlap, e.g., cmw_get_full_state vs cmw_get_status and cmw_set_signal_path vs cmw_rf_route_set. Most tools are clearly distinct, but a few pairs could cause misselection.

    Naming Consistency5/5

    All tool names follow a strict cmw_<domain>_<verb>_<noun> pattern, with minor exceptions like cmw_connect and cmw_discover, but these are still clear and predictable. The naming is extremely consistent across the entire set.

    Tool Count2/5

    90 tools is far above the 25+ threshold and feels excessive even for a complex instrument like the CMW500. While each tool has a purpose, the sheer volume makes the server unwieldy and likely contains functions that could be consolidated or parameterized.

    Completeness5/5

    The tool set covers connection management, identification, error handling, capabilities, system operations, templates, GPRF generation and measurements, Bluetooth, LTE (including signaling), WLAN, RF routing, external attenuation, limits, and raw SCPI access. This is a thorough and near-complete surface for the instrument's capabilities.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers