
Ocean Insight Spectrometer
io.github.K-Dense-AI由 GitHub 账号 K-Dense-AI 发布v0.1.2更新于 Oct 27, 2026
MCP server for Ocean Insight / Ocean Optics spectrometers (python-seabreeze).
概览
本地 MCP 服务器,让 AI 助手驱动 Ocean Insight(Ocean Optics)光谱仪:采集光谱、调整积分时间,并测量吸光度与透射率。
- 可以做什么
- 采集强度光谱,支持多次平均、箱车平滑与校正,并返回峰位、FWHM 与饱和检查,可选保存为新的 CSV 文件
- 设置或自动调整积分时间,并存储暗光谱与参考光谱供后续测量使用
- 测量光路中样品的吸光度与透射率,并给出指定波长处的数值以及极大值或极小值
- 在最近一次光谱中查找峰或谷,并在支持的型号上读取探测器温度或开启、关闭热电制冷
- 查看仪器信息:列出可见光谱仪、设备详情、连接信息、安全限值与原始命令日志,断电重启后可重新连接
- 适用场景
- 适合实验室场景:受支持的 Ocean Optics 光谱仪连接在同一台电脑上,希望助手引导完成暗光谱、空白与样品步骤,报告峰位或峰宽,或记录吸光度与透射率测量。也可通过内置模拟器在没有硬件时先试用流程。
- 运行要求
- 以 Python 包形式本地运行(uvx labmcp-ocean-spectrometer),通过 stdio 通信,仅限桌面端。需要以 USB 连接受支持的光谱仪,首次需用 seabreeze_os_setup 安装驱动或 udev 规则,且不能有其他程序(如 OceanView)占用设备。可选环境变量:LABMCP_ADDRESS(序列号或地址)、LABMCP_LIMITS、LABMCP_READ_ONLY、LABMCP_SIMULATE。未声明认证。
安装
在 SourceWeft 中
- 打开 控制台中的 Ocean Insight Spectrometer,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Ocean Insight Spectrometer — MCP Server
Let an AI agent acquire spectra, set or auto-tune the integration time, store dark and reference spectra, and measure absorbance and transmittance with peak positions and FWHM on Ocean Insight (Ocean Optics) spectrometers. It works through the open-source python-seabreeze library.
Try it without hardware
The simulator models a USB2000+ (or QE Pro) looking at a tungsten-halogen lamp, a white LED or a Hg-Ar lamp. It includes shot and read noise, dark offset and dark current, electric-dark pixels, detector nonlinearity, saturation, and the stale first spectrum after an integration-time change. In simulation a "virtual user" blocks the beam before store_dark_reference, inserts a blank before store_reference, and inserts a dye sample (absorbance band at 520 nm, 0.8 AU) before measure_absorbance/measure_transmittance. With real hardware your scientist does these steps.
Connect your spectrometer
- Drivers / permissions (once per computer), as documented by python-seabreeze:
- Linux: this installs the udev rules (
/etc/udev/rules.d/10-oceanoptics.rules, needs sudo). Re-plug the spectrometer afterwards. - Windows: this installs the USB driver files. The
pyseabreezebackend also needslibusb-1.0.dll(see the seabreeze README). - macOS: works out of the box.
- Linux: this installs the udev rules (
- Close OceanView (or any other program using the spectrometer). Only one program can open it.
- Test the connection:
--addressis the spectrometer's serial number and is only needed when several are connected (list_spectrometersshows them). The default backend iscseabreeze(compiled libseabreeze); if it can't load, seabreeze falls back to the pure-Pythonpyseabreeze(pyusb).
On connect the server sets the integration time to 10 ms (--option integration_ms=…), clamped to the device range. It has to set it, because seabreeze cannot read the integration time back.
Add to your MCP client
Claude Code
Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)
Add --read-only to allow acquisitions and absorbance measurements with the present settings while blocking integration-time changes, reference storage and TEC control. For other clients, generate the snippet with uvx labmcp config ocean-spectrometer --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_integration_time_ms=60000. Whatever the limits say, one acquisition (scans × integration time, plus the spectrum discarded after an integration-time change) must fit in 540 s, the time one tool call may take; auto_integration_time stops early for the same reason and says so.
Example prompts
- "Auto-adjust the integration time on the lamp, then take a 20-scan averaged spectrum and tell me where the peak is and how wide it is."
- "I'm going to measure a Beer–Lambert series. Walk me through dark, blank and each of my five standards, and report the absorbance at 520 nm for each."
- "Here's the Hg-Ar lamp. Find the lines between 400 and 600 nm and tell me how far they are from 404.66, 435.83 and 546.07 nm."
- "Measure the transmittance of this filter from 400 to 700 nm and save it to ~/data/filter_T.csv."
- "Cool the QE Pro to −10 °C and tell me when the detector temperature has settled."
Notes
- Raw counts. Intensities are detector counts, not irradiance. Radiometric calibration is out of scope.
- Saturation is judged on the raw ADC counts of every averaged scan: a pixel is saturated at ≥ 98 % of
max_intensity. Saturated pixels are flagged, and they're excluded from absorbance/transmittance (with boxcar smoothing, so are the pixels within the boxcar half width of them). seabreeze notes that some detectors saturate belowmax_intensity, so keep peaks at 70–85 %. - Corrections.
correct_dark_countssubtracts the mean of the optically masked electric-dark pixels;correct_nonlinearityapplies the EEPROM polynomial. The driver reads raw spectra and applies both corrections with the same formula asseabreeze.spectrometers.Spectrometer.intensities, so saturation can still be detected on raw data. A stored dark (store_dark_reference) is still required for absorbance, because electric-dark correction doesn't remove fixed-pattern dark signal. - Absorbance is A = −log10((S − D)/(R − D)). Pixels where the reference has less than 0.5 % of its peak signal above dark, or where the reference or sample is saturated, are returned as
null. The dark, reference and sample must share integration time, boxcar and corrections; the server enforces this and asks you to re-take references when they differ. - First spectrum after an integration-time change is discarded. It may have been integrated partly with the old setting; the QE Pro manual notes that it returns the most recently completed spectrum.
- Boxcar follows OceanView's convention:
boxcar_half_width= pixels averaged on each side. Peaks are found on the full-resolution spectrum. The returned curve is bin-averaged down tomax_points. - TEC tools use seabreeze's
thermo_electricfeature (enable_tec,set_temperature_setpoint_degrees_celsius,read_temperature_degrees_celsius) and only work when the backend exposes it for your model. In pyseabreeze 2.11 that is only the NIRQuest512. For the QE Pro it depends on libseabreeze (cseabreeze); this is unverified on hardware. The QE Pro manual says the TEC cools only ~15–40 °C below ambient. - Not exposed: shutter and lamp (
light_source/strobe_lamp) control, trigger modes, and irradiance calibration. seabreeze documents these features, but device support isn't specified and several aren't implemented in pyseabreeze, so they could not be verified. - Peaks next to invalid pixels. Invalid (
null) pixels are treated as unknown: a pixel next to one is not reported as a peak, and prominence and FWHM do not extend across them. When invalid pixels lie inside the requested range (for example the centre of a band too strong to measure), absorbance/transmittance results carry a warning. - Dark and reference spectra live in the server's memory and are lost on
reconnector restart. Save data withsave_path: it must end in.csv, missing folders are created, and an existing file is never overwritten (choose a new name). The path is checked before the spectrum is acquired.
Hardware verification
来源:servers/chemistry/ocean-spectrometer/README.md,提交 46545ea
工具
0版本历史
2- v0.1.2最新Sep 27, 2026
- v0.1.0Sep 26, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分