Opentrons OT-2 / Flex

io.github.K-Dense-AI由 GitHub 帳號 K-Dense-AI 發布v0.1.3更新於 Oct 25, 2026

MCP server for Opentrons OT-2 and Flex liquid-handling robots (HTTP API).

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

此 MCP 伺服器讓 AI 助理透過機器人的 HTTP API,在 Opentrons OT-2 與 Flex 液體處理機器人上傳、審查並執行實驗流程。

可以做什麼
上傳實驗流程,並在執行前讀取分析結果、甲板配置、耗材、微量分注器與液體資訊,其中甲板配置需要使用者確認。啟動、暫停、恢復與停止執行,並追蹤執行狀態、進度、最近步驟與錯誤。查看機器人資訊:名稱、型號、軟體與韌體版本、燈光、艙門與緊急停止狀態。列出已安裝的微量分注器、夾爪與模組,含即時溫度、目標值與震盪速度。關閉模組、讓機器人歸位、開關甲板燈、重新連線,並讀取原始命令紀錄。
適用情境
適合讓助理協助準備與監控 Opentrons 機器人上的液體處理執行:檢查流程分析是否通過、確認甲板、啟動或暫停執行、排查錯誤。內建模擬器可在沒有硬體時試用。
執行需求
透過 uvx 執行的本機 Python 套件(stdio)。機器人須與執行伺服器的電腦位於同一網路,位址由 LABMCP_ADDRESS(序列埠或 tcp 形式)或 address 選項提供;機器人軟體需 5.1 或更新。Flex 啟用存取控制時可能需要存取權杖選項。設定 LABMCP_SIMULATE=1 可改用記憶體模擬器而非硬體。
安裝前請注意
啟動、恢復與歸位會讓機器人移動並進行液體分注;stop_run 無法復原且會丟棄吸頭。上傳會將流程寫入機器人。唯讀模式會阻擋上傳、執行、歸位與燈光,但暫停、停止與關閉模組仍可使用。不會套用 Labware Position Check 偏移,執行參數使用預設值。此伺服器僅在模擬器上測試,尚未在硬體上驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Opentrons OT-2 / Flex,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Opentrons OT-2 / Flex — MCP Server

Let an AI agent upload and check protocols, review the deck layout with you, start, pause, stop and resume runs, follow their progress, and read pipettes and modules on Opentrons Flex and OT-2 liquid-handling robots through the robot's documented HTTP API.

Packagelabmcp-opentrons
InstrumentsOpentrons Flex, Opentrons OT-2 (robot software 5.1 or newer)
InterfacesEthernet, Wi-Fi, USB (network over USB)
ProtocolOpentrons robot-server HTTP API on port 31950, Opentrons-Version: 3 (HTTP API guide, robot-server source; every robot also serves its spec at http://<robot-ip>:31950/openapi.json and /redoc)
Status🧪 simulated: tested against an in-memory robot-server simulator, not yet verified on hardware. Report a hardware test

Why this server rather than a generic HTTP wrapper: it refuses to start a run unless the robot's own protocol analysis passed, the user has confirmed the deck, the door is closed, the E-stop is released and module setpoints are within your limits. It exposes no single-move pipetting commands, keeps pause and stop available even in read-only mode, and records every HTTP request in the command log.

Try it without hardware

bash
uvx labmcp-opentrons --simulate --checkuvx labmcp-opentrons --simulate --option sim_model=ot2 --check   # simulate an OT-2

The simulator runs protocols in memory: Python protocols are compiled and scanned for labware, pipettes, modules and steps, runs go through the real status lifecycle, and module temperatures respond to the protocol.

Connect your robot

  1. Find the IP address: Opentrons App > Devices > your robot > Robot settings > Networking (or on the Flex touchscreen: Settings > Network). The robot must be on the same network as the computer running the MCP server. USB-connected robots also get an IP address (OT-2: 169.254.x.x).
  2. Test the connection:
    bash
    uvx labmcp-opentrons --address 192.168.1.20 --checkuvx labmcp-opentrons --address http://ot2-lab.local:31950 --check
    --check prints the robot's name, model, software and firmware versions.
  3. Access control (Flex only, rarely needed): if your Flex has access control enabled and requests fail with HTTP 401, pass a token with --option access_token=<token>.

Add to your MCP client

Claude Code

bash
claude mcp add opentrons -- uvx labmcp-opentrons --address 192.168.1.20

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

json
{  "mcpServers": {    "opentrons": {      "command": "uvx",      "args": ["labmcp-opentrons", "--address", "192.168.1.20"]    }  }}

Add --read-only to let the agent monitor the robot (status, runs, protocols, modules) while blocking uploads, runs, homing and lights. pause_run, stop_run and deactivate_modules stay available. For other clients, generate the snippet with uvx labmcp config opentrons --address 192.168.1.20 --client vscode (also cursor, codex, claude-code).

Tools

ToolKindDescription
deactivate_modules🛑 safetySwitch attached modules off: stop heating/cooling (Temperature Module, Thermocycler block and lid, Heater-Shaker heater), stop shaking, and lower Magnetic Module magnets. Only possible when no run is in progress: stop the run first.
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_protocol👁 readShow a stored protocol's analysis: whether it is ready to run, analysis errors, the deck layout it expects (labware and modules per slot, pipettes per mount, liquids), the number of steps and the highest module temperature / shake speed it requests. Review this with the user before start_run.
get_robot_status👁 readReport the robot's name, model (Flex/OT-2), software and firmware versions, lights, door and E-stop state, and the current run. Call this first to check the robot is ready.
get_run_status👁 readReport a run's status, the step it is on, progress, recent steps and any errors, plus advice on what to do next (e.g. when the run is waiting for error recovery).
home_robot⚠️ hazardHome all axes of the robot (the gantry and pipettes move to their home positions). Refused while a run is active. Make sure nothing is in the robot's path and the door is closed.
list_instruments👁 readList attached pipettes (and the Flex gripper): mount, name, channels, volume range, and whether a tip is detected and calibration data exists.
list_modules👁 readList attached modules (Temperature Module, Heater-Shaker, Thermocycler, Magnetic Module, Absorbance Plate Reader, ...) with live temperatures, targets, shake speed and status.
list_protocols👁 readList protocols stored on the robot (newest last) with their analysis status and result.
list_runs👁 readList recent protocol runs, newest first, with their status.
pause_run🛑 safetyPause a running protocol. The robot finishes its current step and then holds; resume_run continues it.
reconnect🛑 safetyClose and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).
resume_run⚠️ hazardResume a paused run (the robot starts moving again), or leave error recovery. Refused while the door is open. For a run awaiting recovery, error_recovery must be given.
set_lights🎛 controlTurn the robot's deck (rail) lights on or off.
start_run⚠️ hazardCreate a run of an analyzed protocol and start it: the robot begins moving and pipetting. Refused unless the protocol's analysis completed without errors, its module setpoints are within the safety limits, no other run is active, the door is closed and the E-stop is released.
stop_run🛑 safetyStop (cancel) a run immediately. A stopped run cannot be resumed; the robot homes and drops any attached tips into the trash. Use this whenever something looks wrong.
upload_protocol🎛 controlUpload a protocol file (plus optional custom labware) to the robot. The robot analyzes it (simulates it) and this tool returns the analysis: errors, deck layout and whether it is ready to run. Uploading does not move the robot. Uploading identical files returns the existing protocol.

get_connection_info, get_command_log and reconnect are built into every LabMCP server. get_command_log shows every HTTP request sent to the robot and its reply.

Safety limits

LimitDefaultMeaning
max_module_temperature_c110 °CHighest temperature (Temperature Module, Thermocycler block or lid, Heater-Shaker) a protocol may request; start_run refuses protocols above it
max_shake_speed_rpm3000 rpmFastest Heater-Shaker speed a protocol may request

The defaults are the hardware maxima. Tighten them for heat-sensitive plastics or samples: --limit max_module_temperature_c=70 --limit max_shake_speed_rpm=1500. The check reads the setpoints from the robot's analysis of the protocol (every celsius and rpm value in module commands, including thermocycler profiles).

Other safety interlocks built into start_run:

  • the robot's analysis must have completed with result ok (pending, failed or parameter-required analyses are refused, and the errors are shown);
  • deck_confirmed=true is required, which the agent should only pass after you confirmed the deck matches the layout from get_protocol;
  • no other run may be active, the Flex door must be closed and the E-stop released.

Example prompts

  • "Upload ~/protocols/serial_dilution.py to the Flex and tell me whether the analysis passed. What labware do I need where?"
  • "The deck is set up as you listed. Start the serial dilution run and tell me when it's halfway."
  • "What is the robot doing right now? How many steps are left?"
  • "Pause the run — I need to top up the reservoir." … "OK, resume."
  • "The run says a tip is missing. I've refilled the tip rack in slot C2; continue the run."
  • "The PCR finished. Turn off the thermocycler and the heater-shaker, then switch the lights off."

Notes

  • Protocols, not single moves. This server runs complete protocols that the robot has analyzed. It deliberately has no tools for individual pipetting or gantry moves (POST /runs/{id}/commands), because without full deck state these can crash pipettes into labware. That may come later behind stricter checks.
  • Labware Position Check offsets are not applied. Runs created through the HTTP API do not include the offsets the Opentrons App applies from Labware Position Check. If your setup depends on them, start the run from the App, or set offsets in the protocol (labware.set_offset(...)).
  • Run-time parameters use their default values. Protocols that need a value this server cannot give (e.g. a CSV file parameter) are reported as not ready.
  • Stopping a run is final: the robot homes and drops tips in the trash. Pausing waits for the current step to finish.
  • Error recovery (recent robot software, mainly Flex): when a step fails (e.g. no tip detected), the run waits in awaiting-recovery. resume_run(error_recovery="continue") continues from the robot's actual state and skips the failed step; "assume_false_positive" treats the failure as a false alarm. Only use either after someone has checked the robot.
  • Modules stay on after a protocol ends unless the protocol switches them off. deactivate_modules sends the robot's stateless deactivate commands (POST /commands), which the robot only accepts when no run is in progress.
  • list_instruments uses GET /instruments, which the robot fully supports on Flex; on an OT-2 it returns pipettes with less detail (no calibration data).
  • The HTTP API version is pinned with the Opentrons-Version: 3 header, as in Opentrons' integration examples. Override with --option api_version=4 if needed.

Hardware verification

ModelRobot softwareInterfaceVerified byDate
none yet: be the first

來源:servers/biology/opentrons/README.md,提交 46545ea

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

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

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分