
SRS Residual Gas Analyzer
io.github.K-Dense-AIPublished by GitHub account K-Dense-AIv0.1.1Updated Oct 28, 2026
MCP server for SRS RGA100/200/300 residual gas analyzers.
Overview
MCP server for SRS RGA100/200/300 residual gas analyzers, letting an assistant read vacuum partial pressures, spectra and leak checks over serial or TCP.
- What you can do
- Read vacuum composition: partial pressures at chosen m/z, total pressure, analog and histogram spectra, and a first-pass gas identification
- Run a helium leak check on m/z 4 and report baseline, responses and time series
- Control the instrument: filament on/off, electron multiplier (CDEM) on/off, ionizer degas, detector calibration and scan parameters
- Put the RGA in a safe state with all_off, and reconnect after a power cycle
- Inspect connection info, status and error bytes, and the raw command log
- When to use it
- Useful when an assistant should operate a Stanford Research Systems RGA in a vacuum system: surveying residual gases after a bakeout, diagnosing an air leak or hydrocarbon contamination, monitoring known masses over time, or running a helium leak check on joints.
- Requirements
- Runs locally as a Python package (uvx labmcp-srs-rga) over stdio. Needs an SRS RGA100/200/300 reachable by RS-232 (28,800 baud, RTS/CTS) or TCP via a serial-to-Ethernet or SRS Ethernet adapter, set with LABMCP_ADDRESS or --address. Optional LABMCP_LIMITS, LABMCP_READ_ONLY and LABMCP_SIMULATE; a simulator mode works without hardware. The SRS Ethernet adapter may need a user and password option.
Installation
In SourceWeft
- Open SRS Residual Gas Analyzer 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 Residual Gas Analyzer: MCP Server
Let an AI agent read the residual gas composition of a vacuum system with a Stanford Research Systems RGA100, RGA200 or RGA300 quadrupole mass spectrometer: partial pressures at chosen m/z, analog and histogram spectra, total pressure, helium leak checks and a first-pass identification of the gases (water, hydrogen, nitrogen/CO, oxygen, argon, CO2, hydrocarbons). The filament, the electron multiplier (CDEM) and the ionizer degas are protected by server-side pressure interlocks.
Try it without hardware
The simulator is an RGA200 with a CDEM on an unbaked chamber at ~1e-7 Torr (mostly water, then H2, N2/CO, CO2).
Connect your RGA
- Cable: the RGA's electronics box (ECU) has a DB-9 RS-232 port wired as DCE with RTS/CTS hardware handshaking. Use a straight-through cable (or a USB-serial adapter) that carries RTS and CTS. The settings are fixed: 28,800 baud, 8 data bits, no parity, 1 stop bit. The server sets these for you.
- Close RGA Windows / RGA Com (only one program can use the port).
- Find the port:
uvx labmcp ports - Test the connection:
On connection the server sends
ID?andIN0(clear the RGA's buffers and run its hardware self-check). It does not switch anything on.
Add to your MCP client
Claude Code
Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, ...)
Add --read-only to allow measurements but block switching the filament/CDEM, degassing, calibration and settings changes (the off switches stay available). For other clients, generate the snippet with uvx labmcp config srs-rga --address /dev/ttyUSB0 --client vscode (also cursor, codex, claude-code).
Tools
get_connection_info, get_command_log and reconnect are built into every LabMCP server.
Safety limits
The RGA filament must only run below 1e-4 Torr, and a CDEM should never see voltage above 1e-4 Torr, with 5e-6 Torr or less recommended (manual: FL command warning p. 6-35, "CDEM Handling and Care" in the Maintenance chapter). The RGA only measures pressure while its filament emits, so switching on needs evidence:
set_filamentanddegas: the pressure must be at or belowmax_filament_pressure_torr.set_cdem: at or belowmax_cdem_pressure_torr, and the voltage at or belowmax_cdem_voltage_v(the hardware range of 10-2490 V is enforced as well).- Evidence for all three:
external_pressure_torr(a reading from another gauge that the user confirmed) and, when the filament is on and the CDEM off, a total-pressure measurement taken right then. If both are available, the higher one is checked, so a mistyped gauge value can't override what the RGA measures. With the CDEM on (the RGA can't measure), a reading from the lastmax_pressure_reading_age_sis accepted, but only while the filament is still on: once it is off (switched off or tripped) an older reading says nothing about the present pressure. - RGA readings used as evidence are scaled to 1 mA emission: the ion current is proportional to the emission current, so a reading at 0.1 mA would otherwise understate the pressure 10x.
- The instrument's own filament protection still applies: an overpressure shuts the emission and the CDEM down (error FL6), and
get_statusreports it. all_off,filament_offandcdem_offinterrupt a running scan, mass measurement or leak check (which then returns an error and no data) instead of waiting for it to finish.all_offattempts every step even if one fails, and reports what failed.
Override at launch, e.g. --limit max_cdem_voltage_v=2400 --limit max_filament_pressure_torr=1e-5.
Example prompts
- "The ion gauge reads 2e-7 Torr. Switch the RGA filament on and tell me what's in the chamber."
- "Take a 1-100 amu analog scan, save it to ~/data/rga/after_bake.csv, and compare water and hydrogen with this morning."
- "Is this an air leak? Check 28, 32 and 40 and the ratios."
- "Start a 3-minute helium leak check on m/z 4; I'll spray the flanges one by one after 20 seconds."
- "Switch the CDEM on at 1400 V, measure 2, 4, 18, 28, 44 every minute for 10 minutes, then switch everything off."
Notes
- Wire format. Commands are two letters plus a parameter, ending with CR; ASCII replies end with LF CR. Ion currents from
MR,TP?and every scan point are binary 4-byte little-endian two's complement integers in units of 1e-16 A. Hardware commands (IN,FL,HV,EE,IE,VF,CA,CL,DG) answer with the STATUS byte;NF,MI,MF,SA,TP0/1,MR0answer nothing. The server reads back every silent setting. - Rejected commands get no reply. The RGA only flashes its error LED and sets RS232_ERR; the server then reads
EC?and reports the reason (bad command, bad parameter, parameter conflict). - Partial pressures are N2-equivalent. The server divides the ion current by the partial-pressure sensitivity
SPstored in the head (factory value: N2 at default ionizer settings), and by the stored CDEM gainMGwhen the CDEM is on. Other gases have different sensitivities (H2 ~0.44, He ~0.14, Ar ~1.2 relative to N2);identify_residual_gasescorrects with typical values, the other tools do not. The stored factors are only valid at 70 eV / 12 eV / 90 V and 1 mA emission. - Total pressure (
TP?) is disabled by the RGA while the CDEM is on (it returns 0), and needs the filament on. - Degas runs inside the RGA and any command aborts it, so
degasreturns immediately and the server refuses other commands (exceptfilament_off,cdem_offandall_off, which abort it) until it ends. - Noise floor (
NF0-NF7) sets the speed and detection limit: from 2000 ms/amu and ~7e-15 A noise (NF0) to 15 ms/amu and ~5e-13 A (NF7). The factory default is NF4 (126 ms/amu). - SRS RGA Ethernet adapter login (
--option user=... --option password=..., port 818) follows SRS'ssrsinst.rgadriver and has not been tested on hardware. Generic raw-TCP serial servers need no login but must be set to 28,800 baud 8N1 with RTS/CTS. - After a scan or
measure_massesthe server switches the quadrupole RF off (MR0), as the manual recommends. save_path(scans andleak_check) must end in.csvand must not exist yet: existing files are never overwritten. Missing folders are created,~is expanded, and the path is checked before the measurement starts.- Link recovery. If a scan's binary data doesn't arrive in time (or a safety tool interrupts it), the server discards the partial data, halts the scan with
IN0and waits for its STATUS reply before the next command, so later replies stay in step.
Hardware verification
Source: servers/physics/srs-rga/README.md at commit 46545ea
Tools
0Version history
1- v0.1.1LatestSep 27, 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