lecroy-mcp
MCP server for controlling LeCroy oscilloscopes via SCPI over LAN (VXI-11) or USB.
Requirements
- uv installed
- A LeCroy oscilloscope connected over LAN or USB
MCP configuration
Add to your MCP client config (e.g. Claude Code's .mcp.json):
{
"mcpServers": {
"lecroy-scope": {
"type": "stdio",
"command": "uvx",
"args": ["lecroy-mcp"]
}
}
}
uvx will automatically download and run the server — no manual installation needed.
Connection options
Option 1 — Pre-configure the IP address (recommended for LAN)
Set LECROY_HOST in the env block and the server auto-connects on startup:
"env": {
"LECROY_HOST": "192.168.1.111"
}
Option 2 — Pre-configure a full resource string (LAN or USB)
Use LECROY_RESOURCE for full control, including USB connections:
"env": {
"LECROY_RESOURCE": "USB0::0x05FF::0x1023::12345::INSTR"
}
Option 3 — Manual connection
Leave out the env block and connect from within the MCP session:
scope_scan— auto-detect LeCroy scopes on the local networkscope_list_resources— list all VISA resources (LAN + USB)scope_connect("TCPIP0::192.168.1.111::inst0::INSTR")— connect directly
Optionally set LECROY_SUBNET to hint the scan range:
"env": {
"LECROY_SUBNET": "192.168.1.0/24"
}
Usage
Once connected, you have tools for:
- Channel setup (scale, offset, coupling, bandwidth limit)
- Trigger configuration (mode, source, level, edge)
- Timebase and memory depth
- Automated measurements (PKPK, FREQ, RMS, RISE, DUTY, etc.)
- Waveform capture (JSON or CSV)
- Screenshots
- Math functions (FFT, INTG, DIFF, etc.)
- WaveSource built-in generator (WaveSurfer 3000Z and similar)
Supported models
The server detects the connected model and adjusts commands accordingly. Profiles are included for:
- WaveSurfer 3000Z / 4000HD
- HDO4000A / HDO6000B / HDO8000A
- WaveRunner 6000 / 8000
- WavePro HD
- MDA800A, SDA
Unknown models fall back to conservative defaults.
Updating
With uvx, use the @latest tag to force the newest version:
uvx lecroy-mcp@latest
Or update the args in your .mcp.json to always pull the latest:
"args": ["lecroy-mcp@latest"]
With pip:
pip install --upgrade lecroy-mcp
Manual installation
If you prefer not to use uvx:
pip install lecroy-mcp
Then use lecroy-mcp as the command in your MCP config instead of uvx lecroy-mcp.
Notes
- Requires
pyvisa-pybackend — NI-VISA is currently not supported (breaks screenshot capture) - All VISA access is serialized via a threading lock; parallel MCP tool calls are safe
Troubleshooting
Diagnostic messages not appearing in MCP logs
If you are not seeing server log output (e.g. auto-connect status or errors) in your MCP client's log viewer, add PYTHONUNBUFFERED to the env block:
"env": {
"PYTHONUNBUFFERED": "1"
}
This disables Python's output buffering so log messages are flushed immediately. It is not required for normal operation.