SRS Lock-in Amplifier

io.github.K-Dense-AI由 GitHub 账号 K-Dense-AI 发布v0.1.3更新于 Oct 27, 2026

MCP server for Stanford Research Systems lock-in amplifiers (SR810/SR830, SR860/SR865A).

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

本地 MCP 服务器,让助手读取和配置 Stanford Research Systems 锁相放大器(SR810/SR830、SR860/SR865A)并执行频率扫描。

可以做什么
  • 读取输出与设置:X/Y/R/θ 快照、参考、正弦输出、灵敏度、时间常数、连接信息与原始命令日志
  • 设置参考:来源、内部频率、谐波与相位偏移
  • 设置信号输入:A/A-B/电流、AC 或 DC 耦合、屏蔽、电压量程
  • 设置灵敏度与输出滤波时间常数、斜率及同步滤波器
  • 运行自动相位、自动增益与自动量程
  • 在频率范围内扫描内部参考,并把 X/Y/R/θ 记录到新的 CSV 文件
适用场景
适合需要助手操作实验室中实体 SRS 锁相放大器的场景,例如搭建测量、读取解调输出,或通过频率扫描测量谐振与传递函数。也可用内置模拟器在没有硬件时试用。
运行要求
以 Python 包(uvx labmcp-srs-lockin)在本地通过 stdio 运行。需要通过 GPIB(VISA 后端)、RS-232,或 SR86x 的 USB/以太网连接仪器,由 LABMCP_ADDRESS 或 --address 指定。可选环境变量 LABMCP_LIMITS、LABMCP_READ_ONLY、LABMCP_SIMULATE。仅限桌面。
安装前请注意
正弦输出会驱动实际样品(发热、电迁移、压电应力);set_amplitude 受 max_amplitude_v(默认 1.0 V)限制,SR810/SR830 最低只能到 4 mV rms,必要时需断开线缆。SR830 复位后为 1.000 V rms。频率扫描会在 save_path 写入新的 CSV 文件。目前仅在模拟器上测试,尚未在硬件上验证;可用 LABMCP_READ_ONLY=1 禁止所有改状态操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 SRS Lock-in Amplifier,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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.

Packagelabmcp-srs-lockin
InstrumentsSR830, SR810 (SR8x0 command set); SR860, SR865A (SR86x command set)
InterfacesGPIB (VISA), RS-232; SR86x also USB (USBTMC) and Ethernet (VXI-11)
ProtocolSRS ASCII remote commands, IEEE-488.2 style (SR830 manual ch. 5, SR810 manual, SR860 manual ch. 4, SR865A manual)
Status🧪 simulated: tested against a wire-level simulator of both command sets, not yet verified on hardware. Report a hardware test

Try it without hardware

bash
uvx labmcp-srs-lockin --simulate --check                       # SR830 simulatoruvx labmcp-srs-lockin --simulate --option model=sr860 --check  # SR860 simulator

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).

  1. 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).
  2. 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 sends OUTX 0 automatically on serial connections and OUTX 1 on 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.
  3. 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).
  4. Test the connection:
    bash
    uvx labmcp-srs-lockin --address GPIB0::8::INSTR --checkuvx labmcp-srs-lockin --address /dev/ttyUSB0 --check                      # SR830 RS-232uvx labmcp-srs-lockin --address "serial://COM3?baudrate=19200" --check    # non-default bauduvx labmcp-srs-lockin --address TCPIP0::192.168.1.20::inst0::INSTR --check  # SR86x LAN
    Use --option interface=gpib if you reach an SR830's GPIB port through a raw TCP adapter.

Add to your MCP client

Claude Code

bash
claude mcp add lockin -- uvx labmcp-srs-lockin --address GPIB0::8::INSTR

Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)

json
{  "mcpServers": {    "lockin": {      "command": "uvx",      "args": ["labmcp-srs-lockin", "--address", "GPIB0::8::INSTR"]    }  }}

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

ToolKindDescription
auto_gain🎛 controlPick the sensitivity automatically for the present signal (SR830 AGAN / SR86x ASCL). On the SR830 AGAN does nothing when the time constant is longer than 1 s.
auto_phase🎛 controlRun Auto Phase (APHS): shift the reference phase so that Y ≈ 0 and X ≈ R. The outputs then need several time constants to settle. Does nothing if the phase is unstable.
auto_range🎛 controlOptimise the input stage for the present signal: SR830 Auto Reserve (ARSV) or SR86x Auto Range of the voltage input range (ARNG).
frequency_sweep⚠️ hazardStep the internal reference (and SINE OUT drive) from start_hz to stop_hz, waiting for the output filter to settle at each point, and record X/Y/R/θ vs frequency - e.g. a resonance or transfer-function measurement. The drive amplitude stays at its present value. Needs the internal reference. The estimated duration must be within max_sweep_duration_s; set_amplitude_minimum stops a running sweep. save_path must be a new .csv file.
get_command_log👁 readReturn the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.
get_connection_info👁 readReport which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.
get_settings👁 readReport the reference (source, frequency, harmonic, phase), sine output, sensitivity, time constant/slope (with the 99 % settling time), and input configuration.
read_outputs👁 readRead X, Y, R and θ as one coherent snapshot (SNAP?), with the reference frequency, sensitivity, fraction of full scale and any overloads latched since the last reading.
reconnect🛑 safetyClose and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).
set_amplitude⚠️ hazardSet the SINE OUT amplitude (V rms), which drives the sample or excitation circuit. Refused above the max_amplitude_v safety limit. Tell the user the new drive level first.
set_amplitude_minimum🛑 safetyTurn the sine output down to the instrument minimum (the lock-in's closest thing to 'output off') and stop any running frequency sweep. SR810/SR830: 4 mV rms (it cannot go to zero - disconnect the cable if the sample must see no drive). SR86x: 1 nV rms and DC level 0 V.
set_input🎛 controlConfigure the signal input: A / A-B / current, AC or DC coupling, shield float/ground and (SR86x) the voltage input range. Use DC coupling below ~160 mHz. Omitted parameters are left unchanged.
set_reference🎛 controlSet the reference: source (internal/external), internal frequency, detection harmonic and phase shift. Omitted parameters are left unchanged. Changing the frequency also changes the frequency of the SINE OUT drive (at the current amplitude).
set_sensitivity🎛 controlSet the sensitivity (full-scale range). The smallest available range that is at least full_scale is chosen, so a signal of that size does not overload. On SR810/SR830 the dynamic reserve can be set at the same time.
set_time_constant🎛 controlSet the output filter time constant (nearest available value), and optionally the filter slope and synchronous filter. The SR830 may raise a too-short time constant to its minimum for the current slope/reserve; the returned settings show the value actually used.

get_connection_info, get_command_log and reconnect are built into every LabMCP server.

Safety limits

LimitDefaultMeaning
max_amplitude_v1.0 VLargest sine-output amplitude (V rms) set_amplitude may set; a sweep also refuses to run if the present amplitude is above it
max_sweep_duration_s600 sLongest estimated frequency sweep (points × settle time) an agent may start

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_amplitude checks max_amplitude_v; set_amplitude_minimum is 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. FREQ in external-reference mode) or an illegal command, the tool reports it instead of silently continuing.
  • set_sensitivity picks the smallest range that is at least the requested full scale (never a smaller one, which would overload). set_time_constant picks 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_outputs returns unit = V for voltage inputs and A for the current input (1 V ↔ 1 µA sensitivity mapping from the manuals). The SR830 manual (SR530-compatibility QX/QY commands, 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.
  • overloads comes from LIAS?, whose bits are latched since the last read; the first reading after a transient may show an overload that has already cleared.
  • frequency_sweep waits the manual's 99 % settling time at each point (5/7/9/10 time constants for 6/12/18/24 dB/oct) unless settle_time_constants is given, and restores the starting frequency afterwards. Calling set_amplitude_minimum stops 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) whatever max_sweep_duration_s is: longer estimates are refused, and a sweep running slower than estimated stops early and returns the points measured so far (completed: false). save_path must end in .csv and must not exist yet (an existing file is never overwritten); it is checked before the sweep starts.
  • set_amplitude_minimum tries both the amplitude and (SR86x) the DC level even if one of them fails, then reports every failure.
  • auto_gain maps to AGAN (SR830) or ASCL (SR86x); auto_range maps to ARSV (SR830 auto reserve) or ARNG (SR86x auto input range). SR830 AGAN does 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

ModelFirmwareInterfaceVerified byDate
none yet: be the first

来源:servers/physics/srs-lockin/README.md,提交 46545ea

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.1.3最新Sep 27, 2026
  2. v0.1.1Sep 26, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分