
SRS Lock-in Amplifier
io.github.K-Dense-AIPublished by GitHub account K-Dense-AIv0.1.3Updated Oct 27, 2026
MCP server for Stanford Research Systems lock-in amplifiers (SR810/SR830, SR860/SR865A).
Overview
Local MCP server that lets an assistant read and configure Stanford Research Systems lock-in amplifiers (SR810/SR830, SR860/SR865A) and run frequency sweeps.
- What you can do
- Read outputs and settings: X/Y/R/θ snapshots, reference, sine output, sensitivity, time constant, connection info and raw command log
- Set the reference: source, internal frequency, harmonic and phase shift
- Set the signal input: A/A-B/current, AC or DC coupling, shield, voltage range
- Set sensitivity and output filter time constant, slope and synchronous filter
- Run auto phase, auto gain and auto range routines
- Sweep the internal reference over a frequency range and record X/Y/R/θ to a new CSV file
- When to use it
- Useful when an assistant should operate a physical SRS lock-in in a lab setup — for example setting up a measurement, reading demodulated outputs, or measuring a resonance or transfer function by frequency sweep. It can also be tried without hardware using the built-in simulator.
- Requirements
- Runs locally as a Python package (uvx labmcp-srs-lockin) over stdio. Needs a connection to the instrument via GPIB (VISA backend), RS-232, or for SR86x USB/Ethernet, given by LABMCP_ADDRESS or --address. Optional environment variables LABMCP_LIMITS, LABMCP_READ_ONLY and LABMCP_SIMULATE. Desktop only.
Installation
In SourceWeft
- Open SRS Lock-in Amplifier in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
SRS Lock-in Amplifier — MCP Server
Let an AI agent read X/Y/R/θ, set the reference frequency, harmonic and phase, drive level, sensitivity and time constant, run auto phase/gain, and record bounded frequency sweeps on Stanford Research Systems DSP lock-in amplifiers, both the classic SR810/SR830 and the current SR860/SR865A.
Try it without hardware
The simulated sample is a resonator (10 kHz, Q = 50) driven by the sine output, so a frequency_sweep from 9 to 11 kHz shows a resonance peak.
Connect your lock-in
The model is detected from *IDN? (override with --option model=sr830|sr810|sr860|sr865a).
- GPIB (all models): set the GPIB address in the setup menu (SR830 factory default 8). Install
labmcp[visa](included) and a VISA backend (pyvisa-py works with most USB-GPIB adapters; NI-VISA with?backend=@ivi). - RS-232: set baud rate and parity on the instrument (SR830 default 9600 baud, no parity; the word length is always 8 bits). The SR830 only answers on the interface selected by
OUTX; the server sendsOUTX 0automatically on serial connections andOUTX 1on GPIB. The SR830 ends RS-232 replies with CR. For an SR86x on RS-232, pass--option model=sr860(replies end with LF) or set the SR86x transmit terminator to CR. - SR86x USB / Ethernet: use the USBTMC or VXI-11 VISA resource (
TCPIP0::<ip>::inst0::INSTR; enable VXI-11 and add your PC to the trusted IP range in the system menu). - Test the connection:
Use
--option interface=gpibif you reach an SR830's GPIB port through a raw TCP adapter.
Add to your MCP client
Claude Code
Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)
Add --read-only to allow reading outputs and settings but block every setting change and the sine-output drive. For other clients, generate the snippet with uvx labmcp config srs-lockin --address GPIB0::8::INSTR --client vscode (also cursor, codex, claude-code).
Tools
get_connection_info, get_command_log and reconnect are built into every LabMCP server.
Safety limits
Override at launch: --limit max_amplitude_v=0.1 --limit max_sweep_duration_s=1800.
Example prompts
- "Set the lock-in to 13.7 Hz internal reference, 100 mV drive, 1 s time constant at 24 dB/oct, and tell me X and Y once it has settled."
- "Auto-phase, then read R and θ ten times and give me the mean and standard deviation of R."
- "Sweep the drive from 30 to 34 kHz in 201 log-spaced steps at 10 mV and find the resonance frequency and Q of my tuning fork."
- "Switch to the current input with 100 MΩ gain, DC coupling, and pick the sensitivity automatically."
- "We're done - turn the sine output down to the minimum."
Notes
- The sine output is the hazard. It drives your sample (heating, electromigration, piezo stress).
set_amplitudechecksmax_amplitude_v;set_amplitude_minimumis the closest thing to "output off": the SR810/SR830 cannot go below 4 mV rms, so disconnect the cable if the sample must see no drive. On the SR86x it sets 1 nV rms and a 0 V DC level (SOFF). The SR830 powers up and resets (*RST) to 1.000 V rms. - Every set command is followed by
*ESR?; if the lock-in flags an execution error (parameter out of range, e.g.FREQin external-reference mode) or an illegal command, the tool reports it instead of silently continuing. set_sensitivitypicks the smallest range that is at least the requested full scale (never a smaller one, which would overload).set_time_constantpicks the nearest available value; the SR830 may raise it to the minimum allowed for the slope/reserve, and the returned settings show the value actually used.read_outputsreturnsunit= V for voltage inputs and A for the current input (1 V ↔ 1 µA sensitivity mapping from the manuals). The SR830 manual (SR530-compatibilityQX/QYcommands, ch. 5) states that outputs are returned in amps when the current input is selected; the SR86x manual does not say explicitly — please report what your instrument returns.overloadscomes fromLIAS?, whose bits are latched since the last read; the first reading after a transient may show an overload that has already cleared.frequency_sweepwaits the manual's 99 % settling time at each point (5/7/9/10 time constants for 6/12/18/24 dB/oct) unlesssettle_time_constantsis given, and restores the starting frequency afterwards. Callingset_amplitude_minimumstops a running sweep at the next point (also one that is still reading its settings). One sweep can take at most 3640 s (the tool's timeout minus a margin) whatevermax_sweep_duration_sis: longer estimates are refused, and a sweep running slower than estimated stops early and returns the points measured so far (completed: false).save_pathmust end in.csvand must not exist yet (an existing file is never overwritten); it is checked before the sweep starts.set_amplitude_minimumtries both the amplitude and (SR86x) the DC level even if one of them fails, then reports every failure.auto_gainmaps toAGAN(SR830) orASCL(SR86x);auto_rangemaps toARSV(SR830 auto reserve) orARNG(SR86x auto input range). SR830AGANdoes nothing when the time constant is above 1 s.- Data-buffer, streaming and FFT functions are not exposed. The SR850, SR844 (RF) and SR865 (non-A) are not included because they were not verified; an explicit
--option model=...lets you try a compatible model at your own risk.
Hardware verification
Source: servers/physics/srs-lockin/README.md at commit 46545ea
Tools
0Version history
2- v0.1.3LatestSep 27, 2026
- v0.1.1Sep 26, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts