siglent-mcp
Control a Siglent SPD1305X (or SPD1000X series) programmable DC power supply from Claude Code over Ethernet using SCPI commands, with safety limits and monitoring tools.
README
Siglent SPD1305X MCP server
Drive a Siglent SPD1305X (or any SPD1000X series programmable DC power supply) from Claude Code over Ethernet. No EasyPower, no NI-VISA, no drivers. The supply is an LXI-style instrument that accepts plain SCPI on a raw TCP socket (port 5025); this server wraps that as MCP tools using only the Python standard library, so it runs anywhere Python does.
Tools
| Tool | What it does |
|---|---|
psu_info |
*IDN? + firmware, network config, setpoints, live V/I/P, output state, CV/CC mode, safe limits |
get_measurements |
live measured voltage / current / power at the terminals, plus output state and setpoints |
monitor |
sample V/I/P over a time window: min/max/mean, CV/CC transitions, decimated preview, optional CSV |
set_safety_limits |
declare the safe V/A envelope; required before output can be enabled, and it caps the setpoints |
set_voltage |
program the output voltage setpoint (with readback); guarded (see Safety model) |
set_current |
program the output current limit (with readback); guarded (see Safety model) |
set_output |
enable / disable the physical output (returns resulting state + live measurement) |
save_state |
store present settings into an instrument memory slot (1..5, *SAV) |
recall_state |
recall settings from an instrument memory slot (1..5, *RCL) |
scpi |
raw SCPI escape hatch for anything else |
Safety model (for agents driving the supply)
The control tools are gated so an autonomous agent cannot energize a circuit carelessly:
- Declare limits before energizing.
set_output(True)is refused untilset_safety_limits(max_voltage, max_current)has been called this session. There is no environment default; the agent must consciously commit to a ceiling each time the server starts. - Setpoints are capped. After limits are declared,
set_voltageandset_currentrefuse any value above them. To go higher you must raise the limit on purpose. Enabling the output also re-checks that the present setpoints are within the limits. - No silent live edits. While the output is ON,
set_voltageandset_currentare refused unless you passIKNOWTHEOUTPUTISONDOITANYWAYS=True. The flag is deliberately loud and hard to pass by accident, and it stands out in logs, so a live change to a powered load is always an explicit decision. monitornever changes anything. It only reads, so it is always safe to run.
Setup
Install the one dependency (the MCP SDK):
pip install "mcp[cli]"
...or install the package itself (adds a siglent-mcp console script):
pip install .
Find the supply's IP on the unit under System → LAN, or query it over the
network. This unit is at 192.168.178.209. Confirm the link with:
python -c "import socket; s=socket.create_connection(('192.168.178.209',5025),3); s.sendall(b'*IDN?\n'); print(s.recv(200))"
You should see Siglent Technologies,SPD1305X,....
Register with Claude Code
claude mcp add --env SIGLENT_HOST=192.168.178.209 --scope user siglent -- python D:/ryzzenDL/siglent-mcp/siglent_mcp.py
The
--envflag must have another option (here--scope user) between it and the server name, or the CLI mis-parses the name. Ifpythonisn't on PATH, use the fullpython.exepath or-- cmd /c python D:/....
If you pip installed the package, use the console script instead of a path:
claude mcp add --env SIGLENT_HOST=192.168.178.209 --scope user siglent -- siglent-mcp
Or add it to a .mcp.json (project scope), see .mcp.example.json:
{
"mcpServers": {
"siglent": {
"type": "stdio",
"command": "python",
"args": ["D:/ryzzenDL/siglent-mcp/siglent_mcp.py"],
"env": { "SIGLENT_HOST": "192.168.178.209" }
}
}
}
Then claude mcp list to confirm it connects, and ask Claude things like
"what is the supply outputting right now?", "set it to 5 volts, 0.5 amp limit
and turn the output on", or "read the current and power".
Environment variables
| Var | Default | Meaning |
|---|---|---|
SIGLENT_HOST |
192.168.178.209 |
supply IP |
SIGLENT_PORT |
5025 |
raw SCPI socket port |
SIGLENT_TIMEOUT |
5 |
socket timeout (seconds) |
SIGLENT_CHANNEL |
CH1 |
channel token (the SPD1305X is single channel) |
SIGLENT_VMAX |
30.0 |
hardware voltage ceiling (safe limits and setpoints cannot exceed it) |
SIGLENT_IMAX |
5.0 |
hardware current ceiling (safe limits and setpoints cannot exceed it) |
SIGLENT_OUT_DIR |
./captures |
where monitor writes CSV files |
To reuse this server for a different SPD1000X model, override SIGLENT_VMAX /
SIGLENT_IMAX (for example 16 / 8 for an SPD1168X).
SCPI reference (confirmed on this unit, firmware 2.1.1.9)
| Purpose | SCPI | Notes |
|---|---|---|
| Identity | *IDN? |
Siglent Technologies,SPD1305X,<serial>,<fw>,<hw> |
| Firmware | SYSTem:VERSion? |
|
| Set voltage | CH1:VOLTage 5.000 |
bare VOLTage 5.000 also works |
| Set current limit | CH1:CURRent 0.500 |
bare CURRent 0.500 also works |
| Read voltage setpoint | CH1:VOLTage? |
the programmed value |
| Read current limit | CH1:CURRent? |
|
| Measure output voltage | MEASure:VOLTage? CH1 |
live at the terminals; 0 while output off |
| Measure output current | MEASure:CURRent? CH1 |
|
| Measure output power | MEASure:POWEr? CH1 |
|
| Output on / off | OUTPut CH1,ON / OUTPut CH1,OFF |
write only, there is no OUTPut? query |
| Status register | SYSTem:STATus? |
hex; bit 4 = output ON, bit 0 = CV(0)/CC(1) |
| Error queue | SYSTem:ERRor? |
0 No Error when clean |
| Save / recall | *SAV n / *RCL n |
slot 1..5 |
| Network | IPaddr? MASKaddr? GATEaddr? DHCP? |
Notes / gotchas
- The output state is not queryable directly. There is no
OUTPut?query; readSYSTem:STATus?and test bit 4 (this server does that for you and reportsoutput_on). - CV vs CC comes from bit 0 of
SYSTem:STATus?(0 = constant voltage, 1 = constant current). Under no load the supply sits in CV. - The LAN service is single client and fragile. The port-5025 SCPI server tolerates one connection and can wedge if a client disconnects abruptly or reconnects in a rapid burst; both the raw socket and the VXI-11 service then reset every new client even though the unit still answers ping. This server avoids that by keeping one persistent, lock serialized connection, closing it gracefully, and pacing reconnects. Do not point multiple clients at the supply at once, and do not fire tools concurrently.
- If it does wedge (rare, usually only from an unclean kill), the fix is a power cycle of the unit; ping and the network stack stay up, but the instrument services need the reset. Toggling the output from the front panel is harmless meanwhile.
set_outputenergizes the terminals at the present voltage setpoint. It returns the live measured voltage/current so you can confirm what happened.- Setpoints are independent of output state. Changing voltage/current while the output is off just stages the value; it applies when you enable output.
- The unit powers on with the output off by default (a front panel setting).
Contributing
Issues and PRs welcome, see CONTRIBUTING.md. CI lints with ruff and runs an import smoke test on Python 3.10 to 3.13 (no supply required).
License
MIT © Valentino Saitz
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.