pt4046-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
pt4046-mcp
An MCP server that lets AI assistants drive a PeakTech 4046 two-channel 160 MHz DDS arbitrary function generator over LAN. It is a sibling of mcp_msox2014a (oscilloscope) and mcp_ur (robot) and uses the same architecture: transport → driver → session → FastMCP tools, with a built-in simulator.
On the bench it replaces the MSO-X 2014A's built-in WaveGen, which needs a licence (DSOX2WAVEGEN) that the scope does not have.
Features
Area | What you get |
Connection | Raw SCPI socket or VXI-11 over LAN (USB VISA also works); static IP from |
Channels | Sine, square, ramp, pulse, noise and 145 built-in waveforms by number or name; frequency, amplitude + offset or high + low levels, phase, duty, symmetry, pulse width and edges, load, polarity, output on/off |
Modulation | AM, FM, PM, PWM, SUM, FSK, QFSK, 4FSK, PSK, QPSK, 4PSK, ASK, OSK; internal or external source |
Sweep / burst | Linear, log and list (up to 128 points) sweeps; triggered and gated bursts; |
Dual channel | Frequency coupling (ratio/offset), amplitude/offset coupling, waveform combine, phase sync |
Arbitrary | Upload samples in volts (16k points per channel, 1M on channel A) in the binary frame format from the Programmer's Guide |
Safety | Every setting is checked against the instrument limits for waveform, frequency and load before anything is sent; optional bench limit |
Escape hatch |
|
The command set follows the PeakTech P 4046 Programmer's Guide (05/2023, from the product
page downloads). It is Agilent 33xxx-style SCPI: SOURce1:/OUTPut1 address channel A and
SOURce2:/OUTPut2 channel B.
Related MCP server: SDG Function Generator MCP Server
Install
Requires Python 3.11+ and uv.
git clone https://github.com/SMEAC/mcp_pt4046.git
cd mcp_pt4046
uv sync
uv run pt4046-mcp --simulate # quick smoke run (stdio; Ctrl+C to exit)
uv run pytestNo VISA installation is needed for the raw-socket LAN connection. VXI-11 uses pyvisa-py (included), or Keysight IO Libraries / NI-VISA if installed.
Generator LAN setup
On the generator: Utility → Interface → Network. Set DHCP off, then the IP address, subnet mask and default gateway, and press Confirm.
Put the IP in
.mcp.jsonasPT4046_HOST. The PC needs an address in the same subnet.The PeakTech manuals do not say which TCP port the LAN interface listens on. Find it once:
fgen_device(operation='scan', host='192.168.1.30')This tries the common raw-SCPI ports (5025 first) with
SYST:ERR?and checks for a VXI-11 portmapper. Put the port it reports in.mcp.jsonasPT4046_PORT. WithoutPT4046_PORT, every connect repeats the probe; that works but is slower.
Configuration (.mcp.json)
{
"mcpServers": {
"pt4046": {
"command": "uv",
"args": ["run", "--directory", "C:\\dev\\mcp_stuff\\mcp_pt4046", "pt4046-mcp"],
"env": {
"PT4046_HOST": "192.168.1.30",
"PT4046_PORT": "5025"
}
}
}
}Variable | Meaning |
| Generator IP, |
| Raw-socket port. If unset, the port is probed on connect. |
| Optional bench limit, in volts, on the peak voltage at an unloaded output (|offset| + amplitude/2, doubled if the load setting is 50 Ω). Settings above it are refused. |
| I/O timeout (default 5 s). |
| Force a VISA backend ( |
| Logging level on stderr (default WARNING). |
Tools
Tool | Operations |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| raw write/query |
|
|
Resource: pt4046://status. Prompt: frequency_response, a gain/phase sweep with the
generator driving the circuit and the MSO-X 2014A measuring.
Every result that follows a write includes instrument_errors when the generator queued any.
SYSTem:ERRor? is also the synchronisation point, because the command set has no *OPC?.
fgen_channel(operation='set', channel=1, function='sine', frequency=1e3, amplitude=1, offset=0)
fgen_channel(operation='set', channel=2, function='square', frequency=10e3, low=0, high=3.3)
fgen_channel(operation='on', channel=1)
fgen_device(operation='all_off')Things to know
Load setting. The generator has a 50 Ω source impedance and scales its output so that the configured load sees the set amplitude. After
*RSTthe setting is High Z. If you set 50 Ω but connect a high-impedance circuit, the circuit sees twice the set voltage. The limit checks always use the unloaded (worst-case) voltage.Megahertz. In PeakTech SCPI,
MHzmeans millihertz andMAHzmeans megahertz. The tools send plain numbers in Hz and never use unit suffixes. Remember this when you usefgen_scpi.*IDN?is not in the PeakTech command list.identifyreports it if the instrument does not answer, and connecting does not depend on it.Mode exclusivity. Only one of modulation, sweep or burst can be active per channel.
Coupling order. Coupling parameters are only accepted while that coupling is on, and the trigger source only while sweep or burst is on. The tools send the commands in that order.
Not yet verified on hardware
The simulator and the localhost socket tests follow the Programmer's Guide. The following still need checking on the real instrument:
the LAN port number (
fgen_device(operation='scan'))the exact
*IDN?,SYST:ERR?,FUNC?andOUTP:LOAD?response formats (the parsers accept the likely variants)arbitrary upload (
ARB:SHRT<n>/ARB:DATA): the guide's frame format is implemented exactly, but which waveform slot the data lands in is not documented. Check the result on the scope.
Licence
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
IP intelligence, network diagnostics, and AI service availability tools for AI agents.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
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
- 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
- AlicenseNot gradedqualityDmaintenanceMCP server that lets an AI assistant drive a RIGOL DG800 Pro / DG900 Pro arbitrary waveform generator over LAN (raw SCPI on TCP 5555), with tools for setting waveforms, output loads, and reading status.MIT