Rigol DP832 MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Rigol DP832 MCP ServerSet channel 1 to 5V and 1A"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Rigol DP832 MCP Server
A Python library and Model Context Protocol (MCP) server for controlling Rigol DP832 programmable power supplies via Ethernet connection using VISA TCP/IP.
Features
Ethernet-only: Focused on Ethernet connections, no USB/USBTMC dependencies
VISA TCP/IP: Uses industry-standard VISA TCP/IP for reliable communication
Full DP832 Support: Complete control of all DP832 channels and features
Network Discovery: Automatic discovery tools to find your DP832 on the network
Easy to Use: Simple Python API for power supply control
MCP Server: Model Context Protocol server for AI agent integration
AI-Ready: Direct integration with AI assistants and automation workflows
Related MCP server: copper-mountain-vna-mcp
Supported Models
DP832: 3-channel programmable power supply (primary focus)
DP821: 2-channel programmable power supply
DP712: 1-channel programmable power supply
Installation
Option 1: Install via pip (Recommended)
Install directly from GitHub:
pip install git+https://github.com/amahpour/rigol_dp832_mcp_server.gitOption 2: Clone and Install
Clone this repository:
git clone https://github.com/amahpour/rigol_dp832_mcp_server.git
cd rigol_dp832_mcp_serverInstall the package:
pip install .Option 3: Development Install
For development with editable mode:
git clone https://github.com/amahpour/rigol_dp832_mcp_server.git
cd rigol_dp832_mcp_server
pip install -e .Quick Start
1. Connect Your DP832
Connect your DP832 to your network via Ethernet cable and configure its IP address.
2. Find Your Device
Use the automatic discovery tool to find your DP832:
python rigol_dp832/find_dp832.pyThis will scan your network and provide the exact connection string to use.
3. Use the Library
from rigol_dp832.rigol_dp import DP832
# Connect to your DP832
ps = DP832(
conn_type="VISA",
visa_resource_string="TCPIP0::192.168.1.100::5555::SOCKET"
)
# Get device information
device_id = ps.id()
print(f"Connected to: {device_id['model']}")
# Set channel 1 to 5V, 1A and turn it on
ps.set_channel_settings(channel=1, voltage=5.0, current=1.0)
ps.set_output_state(channel=1, state=True)
# Read measurements
voltage = ps.measure_voltage(1)
current = ps.measure_current(1)
print(f"Voltage: {voltage:.3f}V, Current: {current:.3f}A")
# Turn off the output
ps.set_output_state(channel=1, state=False)
# Close connection
ps.close()MCP Server Usage
This repository includes a Model Context Protocol (MCP) server that allows AI agents to directly control your Rigol power supply. The MCP server provides a comprehensive set of tools for device discovery, connection management, channel control, measurements, and protection settings.
1. Install Dependencies
Before running the MCP server, install the required Python packages:
pip install pyvisa fastmcpOr install from the requirements file:
pip install -r requirements.txtOr install the package itself (which pulls in all dependencies):
pip install git+https://github.com/amahpour/rigol_dp832_mcp_server.git2. Add the MCP Server to Your Client
Add the following to your MCP client configuration. Replace /path/to/rigol_dp832_mcp_server with the actual path where you cloned the repository.
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"rigol-dp832": {
"command": "python3",
"args": ["/path/to/rigol_dp832_mcp_server/mcp_rigol_dp832.py"],
"env": {}
}
}
}Claude Code (run this command):
claude mcp add --transport stdio rigol-dp832 -s user -- python3 /path/to/rigol_dp832_mcp_server/mcp_rigol_dp832.pyYou can optionally set a static IP address and port via environment variables instead of relying on auto-discovery:
{
"mcpServers": {
"rigol-dp832": {
"command": "python3",
"args": ["/path/to/rigol_dp832_mcp_server/mcp_rigol_dp832.py"],
"env": {
"RIGOL_DP832_IP": "192.168.1.100",
"RIGOL_DP832_PORT": "5555"
}
}
}
}Configuration Options:
RIGOL_DP832_IP: IP address of your power supply (optional — uses auto-discovery if not set)RIGOL_DP832_PORT: Port number (default: 5555)
3. Restart Your Client
Restart Cursor or Claude Code for the new MCP server to be picked up.
Once configured, you can interact with your power supply through natural language commands such as:
"Connect to the power supply"
"Set channel 1 to 5V and 1A"
"Enable output on channel 1"
"Measure the voltage and current on channel 1"
"Discover available power supplies on the network"
Available MCP Tools
The MCP server provides the following tools:
Device Discovery & Connection
discover_devices()- Find all Rigol power supplies on the network (auto-discovery)test_connection(ip_address=None)- Test connection to configured device or specific IPconnect(ip_address=None, port=None)- Connect to configured device or specific IP/portdisconnect()- Disconnect from current deviceget_device_info()- Get information about connected device
Channel Control
set_channel_settings(channel, voltage, current)- Set voltage and currentget_channel_settings(channel)- Get current settingsset_output_state(channel, state)- Enable/disable outputget_output_state(channel)- Get output state
Measurements
measure_voltage(channel)- Measure voltagemeasure_current(channel)- Measure currentmeasure_all(channel)- Measure voltage, current, and power
Protection Settings
set_ocp_enabled(channel, state)- Enable/disable overcurrent protectionget_ocp_enabled(channel)- Get OCP stateset_ocp_value(channel, current_limit)- Set OCP current limitget_ocp_value(channel)- Get OCP current limitset_ovp_enabled(channel, state)- Enable/disable overvoltage protectionget_ovp_enabled(channel)- Get OVP stateset_ovp_value(channel, voltage_limit)- Set OVP voltage limitget_ovp_value(channel)- Get OVP voltage limit
Status & Diagnostics
get_output_mode(channel)- Get output mode (CV/CC/UR)get_ocp_alarm(channel)- Check OCP alarm statusget_ovp_alarm(channel)- Check OVP alarm statusclear_ocp_alarm(channel)- Clear OCP alarmclear_ovp_alarm(channel)- Clear OVP alarmping()- Health check
Network Discovery Tools
Automatic Discovery
python rigol_dp832/find_dp832.pyScans your network and finds DP832 devices automatically.
Test Specific IP
python rigol_dp832/test_ip.py 192.168.1.100Tests a specific IP address for DP832 connectivity.
Comprehensive Network Scan
python rigol_dp832/network_discovery.pyPerforms a detailed network scan with multiple discovery methods.
API Reference
Connection
from rigol_dp832.rigol_dp import DP832
ps = DP832(
conn_type="VISA",
visa_resource_string="TCPIP0::<IP_ADDRESS>::5555::SOCKET"
)Device Information
device_id = ps.id()
# Returns: {'manufacturer': 'RIGOL TECHNOLOGIES', 'model': 'DP832', ...}Channel Control
# Set voltage and current
ps.set_channel_settings(channel=1, voltage=5.0, current=1.0)
# Enable/disable output
ps.set_output_state(channel=1, state=True)
# Get current settings
settings = ps.get_channel_settings(channel=1)
# Returns: {'voltage': 5.0, 'current': 1.0}Measurements
# Individual measurements
voltage = ps.measure_voltage(channel=1)
current = ps.measure_current(channel=1)
# All measurements at once
measurements = ps.measure_all(channel=1)
# Returns: {'voltage': 5.0, 'current': 0.5, 'power': 2.5}Protection Settings
# Overcurrent Protection (OCP)
ps.set_ocp_enabled(channel=1, state=True)
ps.set_ocp_value(channel=1, setting=1.5)
ocp_enabled = ps.get_ocp_enabled(channel=1)
ocp_value = ps.get_ocp_value(channel=1)
# Overvoltage Protection (OVP)
ps.set_ovp_enabled(channel=1, state=True)
ps.set_ovp_value(channel=1, setting=6.0)
ovp_enabled = ps.get_ovp_enabled(channel=1)
ovp_value = ps.get_ovp_value(channel=1)Examples
See rigol_dp832/ethernet_example.py for a complete working example.
Troubleshooting
Connection Issues
Check IP Address: Verify the IP address is correct
Network Connectivity: Ping the device:
ping 192.168.1.100SCPI Interface: Ensure SCPI over Ethernet is enabled on the DP832
Firewall: Check that no firewall is blocking port 5555
PyVISA: Ensure PyVISA is installed and working
Common Error Codes
-1073807339: Connection timeout (device not found or not responding)-1073807343: Invalid resource string format-1073807346: Device busy or locked
Requirements
Python 3.6+
PyVISA >= 1.11.0
Network connection to DP832
What's Excluded
This library focuses on Ethernet connections only. The following have been intentionally excluded:
USB/USBTMC connections
Custom socket implementations
Web server functionality
OpenAI integration
License
This project is based on the original instrument-controllables library and maintains compatibility with the DP832 instrument control functionality.
Contributing
Feel free to submit issues and enhancement requests!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/amahpour/rigol_dp832_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server