Opentrons OT-2 / Flex — Claude Code MCP server: features & setup
Connects Opentrons Flex and OT-2 liquid-handling robots to AI agents via HTTP API. Uploads protocols, inspects deck layouts, and tracks runs safely.
claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio opentrons -- uvx labmcp-opentronsWhat Opentrons OT-2 / Flex does
The labmcp-opentrons package interacts with the robot-server API on port 31950 over Wi-Fi, Ethernet, or USB connections. It allows assistants to inspect mounted pipettes, read module states like temperature blocks or shakers, and transfer protocols directly to the robot for validation.
It omits single-move pipetting commands. Starting a run requires a closed door, released emergency stop, and clean protocol validation. You can also pass --read-only to monitor deck status safely without allowing motion commands, while cancel and pause tools remain available. The package was tested against an in-memory emulator rather than physical hardware.
What it helps with
- upload protocol scripts and verify expected deck slot layouts
- monitor active run stages and temperature module readouts
- halt or pause liquid handler operations during unexpected errors
- inspect attached pipettes and gripper configurations remotely
Example prompts for the agent
- Check the Opentrons robot connection and report attached hardware modules.
- Upload
pcr_prep.py, verify the slot setup, and inspect protocol warnings. - Pause the current run and confirm the emergency stop state.
How to install Opentrons OT-2 / Flex
Platform CLI
claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio opentrons -- uvx labmcp-opentronsReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-opentrons <command>
Platform CLI
codex mcp add opentrons --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> -- uvx labmcp-opentronsReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-opentrons <command>
Config file
{
"mcpServers": {
"opentrons": {
"command": "uvx",
"args": [
"labmcp-opentrons"
],
"env": {
"LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
"LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
"LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
"LABMCP_LIMITS": "<LABMCP_LIMITS>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-opentrons <command>
Config file
{
"servers": {
"opentrons": {
"type": "stdio",
"command": "uvx",
"args": [
"labmcp-opentrons"
],
"env": {
"LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
"LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
"LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
"LABMCP_LIMITS": "<LABMCP_LIMITS>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-opentrons <command>
Platform CLI
gemini mcp add -e LABMCP_ADDRESS=<LABMCP_ADDRESS> -e LABMCP_SIMULATE=<LABMCP_SIMULATE> -e LABMCP_READ_ONLY=<LABMCP_READ_ONLY> -e LABMCP_LIMITS=<LABMCP_LIMITS> opentrons uvx labmcp-opentronsReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-opentrons <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Opentrons OT-2 / Flex
How do I install Opentrons OT-2 / Flex in Claude Code?
Run this command in your terminal: claude mcp add labmcp-opentrons -- uvx labmcp-opentrons.
Can I try this server without a physical robot?
Yes, you can run the built-in emulator locally by executing uvx labmcp-opentrons --simulate --check.
Which hardware and software versions are supported?
It supports Opentrons Flex and OT-2 units running robot software 5.1 or newer.