This repository contains a local stdio MCP server for the ALIENTEK / 正点原子 DP100 digital power supply. It exposes DP100 status and output-control operations as MCP tools so an AI agent can safely read telemetry and control bench power during hardware bring-up.
This README is written primarily for AI agents. Follow it as the source of truth when installing this MCP server on a Linux host.
The server talks to the DP100 over USB HID and registers the following MCP tools:
| Tool | Purpose |
|---|---|
dp100_get_device_info |
Read DP100 model, hardware/app/bootloader versions, serial metadata. |
dp100_get_status |
Read live telemetry: input voltage, output voltage/current, temperature, output state. |
dp100_get_active_settings |
Read active preset/setpoint: voltage, current, OVP, OCP. |
dp100_get_system_info |
Read system settings such as backlight and over-temperature threshold. |
dp100_set_output |
Set output enable state plus voltage/current/OVP/OCP in mV/mA. |
dp100_output_on |
Convenience tool: enable output with explicit target voltage/current. |
dp100_output_off |
Convenience tool: disable output while preserving the current setpoint. |
Safety behavior in the server:
- Uses a process-wide lock so concurrent MCP calls do not interleave HID transactions.
- Rejects negative voltage/current/protection values.
- Reads the device-reported max output voltage before applying a setpoint and rejects requests above that limit.
dp100_output_offturns output off without changing to an arbitrary high setpoint.
Known working environment:
- Linux host
- Python 3.10+
- DP100 connected over USB HID
- USB VID/PID:
2e3c:af01 - Python dependencies:
mcphidapicrcmod
The device may appear as /dev/hidrawN. Do not hard-code /dev/hidraw4; the number can change across machines and reconnects. The server opens the device by VID/PID.
Use these commands on the machine that has the DP100 physically connected:
cd ~/dev
git clone https://github.com/lymzzyh/dp100-mcp.git
cd dp100-mcp
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txtIf pip install hidapi fails, install the system HID/libusb development packages first, then retry:
sudo apt-get update
sudo apt-get install -y python3-venv python3-dev build-essential pkg-config libhidapi-dev libusb-1.0-0-dev
. .venv/bin/activate
pip install -r requirements.txtIf the AI agent is not running as root, install a udev rule so the agent user can open the DP100 HID device.
Create /etc/udev/rules.d/99-atk-dp100.rules:
sudo tee /etc/udev/rules.d/99-atk-dp100.rules >/dev/null <<'EOF'
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="af01", MODE="0660", GROUP="plugdev", TAG+="uaccess"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo usermod -aG plugdev "$USER"Then unplug/replug the DP100. If the user was just added to plugdev, log out and log back in, or restart the agent service/session.
Verify the device exists:
lsusb | grep -i '2e3c:af01' || true
ls -l /dev/hidraw*This server uses stdio transport. Configure the MCP client to run the repository-local Python interpreter and dp100_mcp.py.
Add this to ~/.hermes/config.yaml:
mcp_servers:
dp100:
command: /home/YOUR_USER/dev/dp100-mcp/.venv/bin/python
args:
- /home/YOUR_USER/dev/dp100-mcp/dp100_mcp.py
timeout: 30
connect_timeout: 15Replace /home/YOUR_USER/dev/dp100-mcp with the actual clone path.
Restart Hermes Agent after editing the config. Hermes should then expose tools with names similar to:
mcp_dp100_dp100_get_statusmcp_dp100_dp100_output_onmcp_dp100_dp100_output_off
Tool prefixes vary by client. The underlying MCP tool names are the names listed in What this MCP does.
For other MCP clients, use equivalent stdio configuration:
{
"mcpServers": {
"dp100": {
"command": "/home/YOUR_USER/dev/dp100-mcp/.venv/bin/python",
"args": ["/home/YOUR_USER/dev/dp100-mcp/dp100_mcp.py"]
}
}
}Before relying on the MCP tools, verify the server can start and talk to the hardware.
cd ~/dev/dp100-mcp
. .venv/bin/activate
python -m py_compile dp100_mcp.py
python - <<'PY'
import dp100_mcp
print('import-ok')
PYIf Node.js is available, use mcporter:
cd ~/dev/dp100-mcp
npx -y mcporter list \
--stdio "$PWD/.venv/bin/python $PWD/dp100_mcp.py" \
--name dp100 \
--schemaExpected result: the listed tools should include dp100_get_status, dp100_output_on, and dp100_output_off.
cd ~/dev/dp100-mcp
npx -y mcporter call \
--stdio "$PWD/.venv/bin/python $PWD/dp100_mcp.py" \
dp100_get_status \
--output jsonExpected result: JSON containing fields such as vin_mv, vout_mv, iout_ma, output_enabled, vin_v, vout_v, and iout_a.
Only run this if a safe load or no sensitive target is connected. Example: enable 1.0 V / 0.1 A with conservative OVP/OCP, then turn off:
cd ~/dev/dp100-mcp
npx -y mcporter call \
--stdio "$PWD/.venv/bin/python $PWD/dp100_mcp.py" \
dp100_output_on \
voltage_mv:1000 current_ma:100 ovp_mv:5000 ocp_ma:500 \
--output json
npx -y mcporter call \
--stdio "$PWD/.venv/bin/python $PWD/dp100_mcp.py" \
dp100_output_off \
--output jsonWhen using this MCP to control real hardware:
- Always read
dp100_get_statusanddp100_get_active_settingsbefore changing output. - Prefer
dp100_output_offfor emergency stop / power-down. - When enabling output, set explicit
voltage_mv,current_ma,ovp_mv, andocp_masuitable for the attached target. - Use millivolts and milliamps. Do not pass volts/amps as floats.
- Do not repeatedly toggle output in a tight loop; hardware targets may need discharge and boot timing margins.
- If the device disappears, replug the DP100 and re-check udev permissions.
- If multiple agents may access the same physical DP100, run only one MCP server instance or enforce external coordination.
Likely cause: the user cannot open /dev/hidrawN.
Fix:
- Install the udev rule from Linux USB permission setup.
- Replug the DP100.
- Ensure the agent process is running under a user in the
plugdevgroup or a desktop session withuaccesspermissions.
Check:
lsusb | grep -i '2e3c:af01'If not present, reconnect the DP100 USB cable and verify the cable supports data.
Check:
- The MCP config path is correct.
- The
commandpoints to.venv/bin/pythoninside this repo. - The
argspath points todp100_mcp.py. - The agent/client was restarted after config changes.
python -m py_compile dp100_mcp.pypasses.
The DP100 HID protocol is synchronous. Avoid concurrent calls from multiple processes. This server serializes calls within one process, but it cannot protect against another independent process opening the same HID device.
Run basic local checks:
cd ~/dev/dp100-mcp
. .venv/bin/activate
python -m py_compile dp100_mcp.pyThe server entry point is:
python dp100_mcp.pyIt runs an MCP stdio server and should normally be launched by an MCP client, not by a human terminal session.