
LC-MS Worklist Builder
io.github.K-Dense-AI由 GitHub 账号 K-Dense-AI 发布v0.1.1更新于 Oct 25, 2026
MCP server that builds and validates LC-MS worklists for MassLynx, SCIEX OS, MassHunter, Xcalibur.
概览
一个本地 MCP 服务器,让助手构建、校验并导出 LC-MS 样品工作列表,生成 MassLynx、SCIEX OS、MassHunter 和 Xcalibur 的导入文件。
- 可以做什么
- 创建并扩展内存中的工作列表草稿,设置方法、进样体积、托盘位置和数据文件命名规则,并向其中追加样品。插入空白样和 QC 进样,并按记录的随机种子打乱运行顺序。校验草稿:必填字段缺失、数据文件名重复、Windows 不允许的文件名字符、位置越界、进样体积上限和方法扩展名。将草稿导出为厂商导入文件到指定输出文件夹,并返回路径、预览、警告和导入说明。导入已有的厂商文件以校验、编辑或转换为其他厂商格式,并列出支持的格式、位置模式与已保存的工作列表。
- 适用场景
- 适合为 Waters MassLynx、SCIEX OS、Agilent MassHunter 或 Thermo Xcalibur 准备 LC-MS 批次时使用,让助手排布样品、添加空白样与 QC、随机化顺序,并在人工导入前发现错误。也适合在厂商之间转换已有批次文件。
- 运行要求
- 以 Python 包(uvx labmcp-ms-worklist)通过 stdio 在本机运行,仅限桌面。需要一个输出文件夹,由 LABMCP_ADDRESS 指定(默认 ./worklists),不存在时自动创建。可选 LABMCP_LIMITS 覆盖安全上限,LABMCP_READ_ONLY=1 隐藏会改变状态的工具,LABMCP_SIMULATE=1 使用内置模拟器和临时文件夹。无需认证或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 LC-MS Worklist Builder,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
LC-MS Worklist Builder (MassLynx, SCIEX OS, MassHunter, Xcalibur): MCP Server
Let an AI agent build LC-MS sample queues (worklists, sequences, batches) and export them as import files for Waters MassLynx, SCIEX OS, Agilent MassHunter Acquisition and Thermo Xcalibur. The agent can lay out samples on a tray, insert blanks and QCs, randomise the run order with a recorded seed, check the list for mistakes, convert an existing file from one vendor to another, and write the file for a person to import. It uses only documented import formats. It never starts an acquisition and doesn't talk to the mass spectrometer.
Try it without an instrument
--simulate uses a temporary output folder that is deleted when the server stops. Everything else is the same code.
Set up
The "instrument address" is the output folder where worklist files are written (default ./worklists, created if missing):
- The server only reads and writes inside this folder. It refuses
.., absolute paths elsewhere and symlinks that point outside it. It never overwrites an existing file unless the agent passesoverwrite=true. - To edit or convert an existing file, or to use a vendor template, copy it into the folder first.
- Point
--addressat a folder the acquisition software watches only if the vendor documents that behaviour for your setup. Otherwise import the file by hand (instructions below).
Add to your MCP client
Claude Code
Claude Desktop / Cursor / Windsurf
--read-only keeps only the tools that inspect things (list_formats, validate_worklist, import_worklist, get_worklist, list_worklists).
Tools
get_connection_info, get_command_log and reconnect are built into every LabMCP server. There are no HAZARD tools: nothing here moves, heats, injects or acquires. The server only writes files. The CONTROL tools change in-memory drafts or write a file, and --read-only hides them.
Typical flow: create_worklist → add_samples (optional) → insert_qc_blanks → validate_worklist → export_worklist, then import the file in the vendor software.
Formats
The table below separates what the vendor documents say (verified) from what the server assumes. list_formats returns the same information to the agent. To be sure of the header for your software version, export an empty batch, sequence or worklist from your own system, put it in the output folder, and pass it to export_worklist as template_path. The server then writes that header, and that delimiter, exactly.
Waters MassLynx: sample list worksheet (waters_masslynx)
- Import: Sample list > File > Import Worksheet, File of Type "Comma Delimited (*.CSV, *.TXT)".
- Verified:
- Row 1 holds the MassLynx FIELD IDs, which are case sensitive. Columns can be in any order, and an
Indexcolumn is added. Source: WKB63781. - The required columns are
FILE_NAME,INLET_FILE,MS_FILE,SAMPLE_LOCATIONandINJ_VOL. Source: MassLynx 4.2 Getting Started Guide 715009602, Table 5-1. The "Bottle" column's FIELD ID isSAMPLE_LOCATION, notBOTTLE. - The example files attached to WKB63781 use CRLF line endings and unquoted fields,
TYPEvaluesBlank/Standard/QC/Analyte, and method names without an extension.
- Row 1 holds the MassLynx FIELD IDs, which are case sensitive. Columns can be in any order, and an
- Mapping:
FILE_NAME= data file,FILE_TEXT= sample name,MS_FILE,MS_TUNE_FILE,INLET_FILE,SAMPLE_LOCATION,TYPE,ID,INJ_VOL,Index. You can add any other FIELD ID (for exampleCONC_AorQUAN_REF) per sample throughextra. - Assumed:
solventanddouble_blankare written asBlank.- Extension checks:
.expfor MS_FILE and.iprfor the tune file, applied only when an extension is given. - Files are UTF-8 without a BOM. Non-ASCII text is flagged.
- The
waters_plate_wellposition pattern (1:A,1) is a common convention. Its comma is CSV-quoted.
SCIEX OS: batch import (sciex_os)
- Import: Batch workspace > Open > Import from file, then Save As.
- Verified:
- Batches import from
.txtor.csv, and the column layout must come from a batch exported from SCIEX OS. Source: SCIEX KB. - Column names Sample Name (< 252 characters), MS Method, Sample Type, Data File and Processing Method. Source: SCIEX OS Feature Guide RUO-IDV-05-15796-C, Table 4-1.
- Rack Type, Rack Position, Plate Type, Plate Position and Vial Position columns. Source: SCIEX KB.
- Sample types Unknown, Blank, Standard, QualityControl, Solvent and Double blank.
- Several samples can share one data file.
- Batches import from
- Assumed:
- SCIEX doesn't publish the exact header text of an exported batch. The default header (
Sample Name,Sample ID,Sample Type,MS Method,LC Method,Rack Type,Rack Position,Plate Type,Plate Position,Vial Position,Injection Volume,Data File,Processing Method,Comment) is a best guess. Usetemplate_pathwith your own export.validate_worklistandexport_worklistwarn when no template was used. - Extensions
.msm,.lcmand.qmethodproduce warnings only. - Rack and plate columns are set with
vendor_columnsor per sample withextra.
- SCIEX doesn't publish the exact header text of an exported batch. The default header (
Agilent MassHunter Acquisition: worklist CSV import (agilent_masshunter)
- Import: Worklist, right-click > "Add/Append Samples from... (csv, xlsx)". Older versions call it "Import Worklist...". You don't need a map file because the headers match the worklist column names.
- Verified:
- The header
Sample Name,Barcode,Rack Code,Sample Position,Method,Data File,Sample Type,Level Name,Inj Vol (µL),Comment, positions likeP1-A1, and the typesCalibrationandSamplecome from the example file shipped inD:\MassHunter\Worklist_Import, as quoted on the Agilent Community. - Save as UTF-8 when the file contains µ. Source: Agilent Community.
Inj Vol=-1means "As method". Source: Agilent Known Problem Report.- Sample Position, Method and Data File must be filled in. Source: Study Manager Quick Start G3335-90140.
- The header
- Assumed:
- The file has a UTF-8 BOM and CRLF line endings.
- Data files get a
.dsuffix. - Methods should end in
.m. - The sample types Blank, QC and DoubleBlank don't appear in the example;
solventis written as Blank.
Thermo Xcalibur: sequence CSV import (thermo_xcalibur)
- Import: Sequence Setup > File > Import Sequence.
- Verified in the Xcalibur 2.2 Acquisition and Processing User Guide XCALI-97209 Rev. D, Appendix A:
- Only
.csvfiles are accepted. - The first cell must be
Bracket Type=n(1 Overlapped, 2 None, 3 Non-Overlapped, 4 Open). - The separator must match the Windows list separator. Use
delimiter=";"where that is;. - The sequence column names and the sample types Unknown, Blank, QC, Std Bracket, Std Clear and Std Update.
- Only
- Corroborated, not published by Thermo: the exact row-2 header strings (
Sample Type,File Name,Sample ID,Path,Instrument Method,Process Method,Calibration File,Position,Inj Vol,Level,Sample Wt,Sample Vol,ISTD Amt,Dil Factor,L1 Study,L2 Client,L3 Laboratory,L4 Company,L5 Phone,Comment,Sample Name). Open-source generators that target Xcalibur import use them: protti, fgcz/qg and lcms-sequencer. Native exports start with a bareBracket Type=4line (Rapid-QC-MS #83). Export one sequence from your Xcalibur as a template if you want certainty. - Assumed:
- Sample Wt 0, Sample Vol 0, ISTD Amt 0 and Dil Factor 1 are written as defaults.
standardis written asStd Bracket, which suits bracket type 4.- Extension checks:
.methfor the instrument method and.pmdfor the processing method.
Not implemented
- MassHunter Walkup Custom Sample Import (G2725-90026): the guide couldn't be retrieved (HTTP 403), so its format couldn't be verified.
- Native worklist and sequence files (MassHunter
.wklXML, Xcalibur.sld, MassLynx.spl): not implemented. We found no public specification for them, so the server uses the CSV import paths above.
Validation
validate_worklist, which export_worklist also runs, reports errors, which block export, and warnings:
- Required fields for the format are missing.
- Duplicate data-file names, compared case-insensitively. For SCIEX OS a shared data file is allowed, but a sample name repeated within one data file is an error.
- Characters Windows doesn't allow in file names (
< > : " / \ | ? *, control characters), a trailing dot or space, and reserved names (CON, NUL, COM1…). - The position doesn't match the chosen
position_pattern(vial_number,well,agilent_plate_well,waters_plate_well,tray_well) or falls outside theplate_size(24/48/54/96/384) ormax_vial. - The injection volume is ≤ 0, not a number, or above the
max_injection_volume_ullimit. This includes injection-volume columns set throughextraorvendor_columns. - A text field or
extravalue contains a line break or another control character, which would break the import file. - The method file has the wrong extension, for example an Analyst
.damin a SCIEX OS batch, or a MassHunter.min an Xcalibur sequence. - Fields the target format has no column for, and non-ASCII text in formats without a BOM.
Safety limits
Override at launch, for example --limit max_injection_volume_ul=20 for a 20 µL loop.
Example prompts
- "Make an Xcalibur sequence for the 40 plasma samples in this list: wells A1 onwards on the R tray, 2 µL, method C:\Xcalibur\methods\DIA_60min. Add a blank after every 10 samples from R:H12 and a pooled QC at the start and end from R:H11. Randomise the samples and tell me the seed."
- "Import
old_batch.csvfrom the worklist folder and convert it to a MassHunter worklist with method D:\MassHunter\methods\Panel.m." - "I put
blank_batch.txt(exported from our SCIEX OS) in the folder. Use it as the template for this batch." - "Check this MassLynx sample list for duplicate file names and bad vial positions before I import it."
Notes
- Drafts live in memory.
reconnect(or restarting the server) discards them. In--simulateit also deletes the temporary folder. Export files you want to keep. - By default,
export_worklistalso writes<file>.provenance.jsonnext to the worklist (for examplePlasma.csv.provenance.json). Like the worklist itself, it is never overwritten unlessoverwrite=true. It contains the operation history, the randomisation seed and the sample order before randomisation, so the run order can be reproduced. Passwrite_provenance=falseto skip it. blank_every_n/qc_every_nalso add a control after the last sample when the count divides evenly, unlessblank_at_end/qc_at_endalready adds one there.- When a draft is exported in another vendor's format, values kept verbatim from the original vendor for columns the new vendor maps itself (for example Xcalibur's
Std Clearsample type) are not copied; the export notes say so. - Randomisation shuffles only the types in
randomize_types(by default unknown samples) among their own slots, using Python'srandom.Random(seed). Standards, blanks and QCs stay where they are. - Method names must match methods that exist on the acquisition PC. The server can't check that.
Verification
来源:servers/chemistry/ms-worklist/README.md,提交 46545ea
工具
0版本历史
1- v0.1.1最新Sep 27, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分