# Opentrons OT-2 / Flex

Connects Opentrons Flex and OT-2 liquid-handling robots to AI agents via HTTP API. Uploads protocols, inspects deck layouts, and tracks runs safely.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 23
- Author: K-Dense-AI
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/K-Dense-AI/lab-instrument-mcps/tree/HEAD/servers/biology/opentrons
- Updated: 2026-09-26
- HTML: https://affpapa.org/en/nevibecode/mcp/opentrons-ot-2-flex

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LABMCP_ADDRESS`, `LABMCP_SIMULATE`, `LABMCP_READ_ONLY`, `LABMCP_LIMITS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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-opentrons
```
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>

### Codex

**Platform CLI**
```bash
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-opentrons
```
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>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
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-opentrons
```
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>

## When to use it
- 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
- 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.

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5585
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3235
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2418
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1723
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 584
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

From the same set: [k-dense-ai/lab-instrument-mcps](https://affpapa.org/en/nevibecode/by/k-dense-ai/lab-instrument-mcps.md) — 28 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
