SRS Lock-in Amplifier — Claude Code MCP server for SRS instruments
Lets an agent drive Stanford Research Systems lock-ins: read X/Y/R/θ, set frequency, phase and sensitivity, run frequency sweeps.
claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio srs-lockin -- uvx labmcp-srs-lockinWhat SRS Lock-in Amplifier does
This server talks to Stanford Research Systems DSP lock-in amplifiers, covering the older SR810/SR830 and the newer SR860/SR865A. An agent can pull X, Y, R and θ as one snapshot, adjust the reference frequency, harmonic and phase, set the drive level, sensitivity and time constant, and fire off auto phase or auto range. A separate tool steps the reference from a start to a stop frequency, waits for the output filter to settle at each step, and writes X/Y/R/θ into a fresh CSV file.
Connections go over GPIB (VISA) or RS-232, and the SR86x adds USB (USBTMC) and Ethernet (VXI-11). The model is read from *IDN? and can be forced with --option model=. GPIB needs a VISA backend: pyvisa-py covers most USB-GPIB adapters, NI-VISA is selected with ?backend=@ivi. On RS-232 the SR830 terminates replies with CR while the SR86x uses LF, so an SR86x on that port wants --option model=sr860 or its transmit terminator switched to CR.
You can try it with no hardware at all: --simulate starts a simulator, and a sweep from 9 to 11 kHz there shows a resonance peak. The --read-only flag permits reading outputs and settings but blocks every change and the sine output. A drive level above the max_amplitude_v limit is refused, and set_amplitude_minimum only takes the SR810/SR830 down to 4 mV rms — it cannot reach zero, so unplug the cable when the sample must see no drive.
What it helps with
- capture X, Y, R and θ in one coherent snapshot
- set the reference frequency, harmonic and phase shift
- pick a sensitivity that fits the current signal
- log a frequency sweep to CSV and find a resonance
- switch the input to A-B or current mode with the right coupling
Example prompts for the agent
- Connect to the lock-in and show me the current X, Y, R and θ
- Set the reference to 10 kHz and run auto phase
- Sweep from 9 to 11 kHz and save the result to a new CSV
How to install SRS Lock-in Amplifier
Platform CLI
claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio srs-lockin -- uvx labmcp-srs-lockinReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-srs-lockin <command>
Platform CLI
codex mcp add srs-lockin --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> -- uvx labmcp-srs-lockinReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-srs-lockin <command>
Config file
{
"mcpServers": {
"srs-lockin": {
"command": "uvx",
"args": [
"labmcp-srs-lockin"
],
"env": {
"LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
"LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
"LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
"LABMCP_LIMITS": "<LABMCP_LIMITS>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-srs-lockin <command>
Config file
{
"servers": {
"srs-lockin": {
"type": "stdio",
"command": "uvx",
"args": [
"labmcp-srs-lockin"
],
"env": {
"LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
"LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
"LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
"LABMCP_LIMITS": "<LABMCP_LIMITS>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-srs-lockin <command>
Platform CLI
gemini mcp add -e LABMCP_ADDRESS=<LABMCP_ADDRESS> -e LABMCP_SIMULATE=<LABMCP_SIMULATE> -e LABMCP_READ_ONLY=<LABMCP_READ_ONLY> -e LABMCP_LIMITS=<LABMCP_LIMITS> srs-lockin uvx labmcp-srs-lockinReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-srs-lockin <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about SRS Lock-in Amplifier
How do I install SRS Lock-in Amplifier in Claude Code?
Add the server with claude mcp add labmcp-srs-lockin -- uvx labmcp-srs-lockin. To pass an address, simulation mode, read-only or limits, use the env variant: `claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio srs-lockin -- uvx labmcp-srs-lockin`.
What does SRS Lock-in Amplifier do?
It gives an agent control over the amplifier: reading outputs, changing reference, input and output settings, running auto routines and recording frequency sweeps. It supports SR810/SR830 and SR860/SR865A.
Can I try it without an instrument?
Yes, --simulate starts a simulator for both command sets. A sweep from 9 to 11 kHz there produces a resonance peak.