
EPICS Channel Access
io.github.K-Dense-AI由 GitHub 帳號 K-Dense-AI 發布v0.1.2更新於 Oct 24, 2026
MCP server for EPICS Channel Access: read, monitor and guarded writes of process variables.
概覽
讓助理透過 Channel Access 讀取、監看並在明確授權時寫入實驗室控制系統中的 EPICS 製程變數。
- 可以做什麼
- 連接 EPICS IOC 或設施 CA 閘道,提供讀取單一或多個製程變數及其中介資料、警報等級與限值的工具,可訂閱某個 PV 一段時間並回傳統計結果,也可檢視 PV 的連線與存取權限。受保護的寫入工具可設定一個或多個 PV,並會驗證允許清單、IOC 存取權限、型別與控制限值。安全工具可執行由科學家設定的安全狀態,命令日誌會記錄已送出的內容。
- 適用情境
- 適用於加速器、光束線、望遠鏡、融合或物理實驗室情境,讓助理查看即時 EPICS 數值、監看訊號漂移,或執行範圍明確獲授權的設定值變更。建議先以唯讀方式執行;僅在負責科學家或控制室授權後才啟用寫入。
- 執行需求
- 以 Python 套件形式在本機執行(uvx labmcp-epics),使用 stdio,僅限桌面。需要能連線至 IOC 或 CA 閘道的網路:UDP 5064/5065 與 TCP 5064。位址來自一般 EPICS_CA_* 環境變數或 LABMCP_ADDRESS 設定。未宣告驗證機制。內建模擬器可在無硬體時測試。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 EPICS Channel Access,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
EPICS Channel Access — MCP Server
Let an AI agent read, monitor and, when you allow it, carefully write EPICS process variables (PVs) over Channel Access. EPICS is the control system behind most particle accelerators, synchrotron and neutron beamlines, large telescopes, fusion experiments and many physics labs. The server uses caproto, a pure-Python CA implementation, so there is nothing to compile and no libca to install.
⚠️ Facility control systems are safety-critical. Writing a PV can move motors and sample stages, open shutters, ramp magnets or high voltage, and change cryogenic or vacuum systems. Follow your facility's rules. Get authorisation from the responsible scientist or control-room staff before enabling writes, and run with
--read-onlyunless writes are explicitly authorised. This server is not an interlock or a personnel-protection system and never replaces them. Where possible, connect through the facility's CA gateway with its access-security rules, and limit writes with--option put_allowlist=.
Try it without hardware
The simulator is a real Channel Access server running in-process. It is bound to 127.0.0.1 on random free ports, and the client is pointed only at that address (auto address list off), so it neither broadcasts on nor answers your network. It serves SIM:TEMP (°C, with alarm limits, following SIM:TEMP:SP while SIM:HEATER is On), SIM:MTR (a motor whose put-callback completes only when the move is done, with SIM:MTR:RBV, :DMOV, :STOP and :VELO), SIM:DET:FRAMES, SIM:SAMPLE (string), SIM:SPECTRUM (a 512-point waveform), SIM:BEAM:CURRENT and SIM:STATUS.
Connect to your control system
- Network: your computer must reach the IOCs, or the facility's CA gateway: UDP 5064/5065 and TCP 5064 through any firewall. Most facilities put control networks behind a gateway, so ask your controls group for its address.
- Address list: Channel Access finds PVs by UDP search. Either use your usual EPICS environment (
EPICS_CA_ADDR_LIST,EPICS_CA_AUTO_ADDR_LIST), or pass it explicitly: Passing an address list switches the automatic (broadcast) list off unless you add--option auto_addr_list=yes. With--option check_pv=<a PV you know exists>,--checkreads that PV and prints its value, or the reason it can't be reached. Without it,--checkonly confirms that the CA client starts.
Add to your MCP client
Claude Code (read-only, recommended)
Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)
Authorised writes (example: a beamline scientist lets the agent move only the sample stage and the filter wheel, and configures an emergency safe state):
Tools
Safety limits
Override at launch, e.g. --limit max_put_batch=4. The main write guards are options, not numeric limits:
Example prompts
- "What is the storage-ring current, and are any of the BL7 vacuum gauges in alarm?"
- "Read BL7:MONO:ENERGY and its readback, and tell me the units and control limits."
- "Monitor the sample temperature for 30 s and tell me whether it is still drifting."
- "Move the sample stage X to 12.5 mm and confirm the readback when the move is done."
- "Record the detector spectrum waveform and tell me where the peak is."
- "Stop everything: apply the safe state."
Notes
- Setpoint versus readback: for motor records,
NAME(VAL) is the target andNAME.RBVis the actual position.put_pvreturns the value read back from the PV you wrote, so read the readback PV separately to confirm physical motion. - Control limits come from the CA
DBR_CTRLresponse. EPICS convention treats equal low and high limits (normally 0/0) as "not configured", and those PVs are only type-checked. - NaN and infinity: JSON has neither. A NaN or infinite scalar value comes back as the text
"nan","inf"or"-inf", array elements asnull, a limit that is NaN (EPICS 3.16+ reports unset alarm limits that way) asnull, and waveform and monitor statistics leave such values out and count them (non_finite,non_finite_updates). - Alarms: every reading includes severity (
NO_ALARM,MINOR_ALARM,MAJOR_ALARM,INVALID_ALARM), status (HIHI,LOLO,UDF,COMM, …) andage_s, the time since the IOC timestamp, so stale values stand out. - Waveforms are downsampled by block averaging to
max_elements, with min/max/mean/argmax statistics. CHAR waveforms are also decoded to text (as_string), the usual EPICS long-string convention. When writing, a text value is accepted for CHAR waveforms. - pvAccess: only Channel Access is supported. caproto 1.x implements CA only, and pvAccess would need p4p, a compiled EPICS Base binding that is deliberately not a dependency. EPICS 7 IOCs serve their records over both CA and PVA, so this covers normal records. PVA-only data (for example NTNDArray images from areaDetector's PVA plugin, or QSRV group PVs) can't be read.
- The CA client is configured through
EPICS_CA_*environment variables, as in EPICS Base. The server sets them for its own process from--address/--optionand restores them on disconnect. Ifput_allowlistholds a comma, pass it on the command line or giveLABMCP_OPTIONSin its JSON form ({"put_allowlist": "BL7:(A|B){1,2}"}), because thea=1,b=2form splits on commas. get_command_logrecords every write (caput -c NAME value) and its read-back.
Hardware verification
來源:servers/protocols/epics/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 分