About
an mcp server for the ot2 and flex
README
A Model Context Protocol (MCP) server that provides 67 tools for controlling Opentrons OT-2 and Flex robots. This server enables AI assistants like Claude (via Cursor, Cline, or other MCP clients) to directly control your Opentrons robot through natural language commands.
Features
- 🤖 67 Opentrons Control Tools - Complete API coverage for robot control
- 💡 Protocol Management - Upload, run, pause, stop, and manage protocols
- 🏠 Robot Control - Home, move, control lights, check status
- 🧪 Labware Management - Manage tip racks, plates, reservoirs, and modules
- 📊 Real-time Monitoring - Check run status, commands, and robot health
- 🎯 Precision Control - Fine-grained control over robot movements
- 🔧 Calibration Tools - Labware offsets and calibration management
- 🌐 Network Discovery - Find and connect to robots on your network
Quick Start
Local Installation (Recommended for Personal Use)
- Clone the repository:
git clone https://github.com/global-mysterysnailrevolution/Opentrons-mcp-server.git
cd Opentrons-mcp-server
- Install dependencies:
npm install
- Configure your MCP client (e.g., Cursor, Cline):
Add to your MCP settings file:
For Cursor (~/.cursor/mcp_config.json or %APPDATA%\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json):
{
"mcpServers": {
"opentrons-robot": {
"command": "node",
"args": ["/full/path/to/Opentrons-mcp-server/index.js"],
"env": {
"ROBOT_IP": "192.168.16.38"
}
}
}
}
For Cline (VS Code extension settings):
{
"opentrons-robot": {
"command": "node",
"args": ["C:\\Users\\YourUsername\\Opentrons-mcp-server\\index.js"],
"env": {
"ROBOT_IP": "192.168.16.38"
}
}
}
Find your robot's IP address:
- Open the Opentrons app
- Go to Robot Settings → Networking
- Note the IP address (e.g.,
192.168.16.38)
Restart your MCP client (Cursor/VS Code) to load the server
Start using it! Ask Claude to:
- "Check if my Opentrons robot is connected"
- "Home the robot"
- "Turn on the lights"
- "Upload this protocol and run it"
- "Pick up tips from row 4 and transfer liquid"
Deployment Options
Option 1: Local MCP Server (Best for Security & Speed)
Pros:
- ✅ Direct connection to robot on local network
- ✅ No internet required
- ✅ Fastest response time
- ✅ Most secure (no external access)
Cons:
- ❌ Only works on local network
- ❌ Must be running when you want to use it
Setup: Follow the Quick Start instructions above.
Option 2: ngrok Tunnel (Remote Access)
Pros:
- ✅ Access robot from anywhere
- ✅ Easy setup
- ✅ Works with existing MCP server
Cons:
- ❌ Requires ngrok account
- ❌ Security risk (anyone with link can access)
- ❌ May have latency
Setup:
# Install ngrok
npm install -g ngrok
# Start the HTTP wrapper server
node http-server.js
# In another terminal, expose it
ngrok http 3000
# Use the ngrok URL in your MCP settings
Option 3: Railway Deployment (Web Interface)
Note: Railway deployment is for the web interface, not the MCP server. For AI assistant control, use Option 1 or 2.
Setup:
- Create a Railway account at https://railway.app
- Connect your GitHub repository
- Set environment variables:
ROBOT_IP: Your robot's IP addressROBOT_PORT: 31950
- Deploy!
This gives you a web interface but NOT MCP integration.
Option 4: VPN + Local MCP (Recommended for Remote Work)
Pros:
- ✅ Secure remote access
- ✅ Full MCP functionality
- ✅ Fast and reliable
Cons:
- ❌ Requires VPN setup (e.g., Tailscale, ZeroTier)
Setup:
- Install Tailscale/ZeroTier on computer with robot
- Connect remotely via VPN
- Use robot's VPN IP in MCP settings
- Use local MCP server (Option 1)
Using with Dedalus Labs AI
Dedalus Labs AI supports MCP servers for enhanced AI capabilities. Here's how to connect your Opentrons robot:
Method 1: Direct Integration (If Supported)
- Export your MCP configuration:
{
"opentrons-robot": {
"command": "node",
"args": ["/path/to/index.js"],
"env": {
"ROBOT_IP": "192.168.16.38"
}
}
}
- In Dedalus Labs AI:
- Go to Settings → Integrations → MCP Servers
- Add new MCP server
- Paste configuration
- Save and restart
Method 2: Via HTTP Wrapper (Remote Access)
- Start the HTTP wrapper:
node http-server.js
- Expose via ngrok:
ngrok http 3000
Configure Dedalus Labs AI:
- Add HTTP endpoint integration
- Use ngrok URL
- Set headers:
Content-Type: application/json
Available endpoints:
POST /tool/robot_health- Check robot healthPOST /tool/upload_protocol- Upload protocolPOST /tool/home_robot- Home robotPOST /tool/control_lights- Control lights- And 63 more tools!
Method 3: Custom API Integration
If Dedalus Labs AI supports custom APIs:
- Use the Railway deployment (web interface)
- Point Dedalus to your Railway URL
- Use REST API endpoints directly
Available MCP Tools (67 Total)
Core Robot Control
robot_health- Check robot connectivity and statushome_robot- Home robot axescontrol_lights- Turn lights on/offget_robot_position- Get current positionmove_robot- Move to specific position
Protocol Management
upload_protocol- Upload protocol filesget_protocols- List all protocolscreate_run- Create protocol runcontrol_run- Play/pause/stop runsget_run_status- Check run statusget_runs- List all runs
Labware & Calibration
list_labware- List deck labwareadd_labware- Add labware to deckremove_labware- Remove labwarelist_labware_offsets- Get calibration offsetscreate_labware_offset- Set calibration offsetsdelete_labware_offset- Remove offsets
Instruments & Modules
list_instruments- List attached pipettesget_instrument- Get pipette detailslist_modules- List attached modulesget_module- Get module detailsget_module_data- Get module sensor data
Advanced Features
execute_command- Execute direct commandslist_commands- View command historyget_command- Get command detailsanalyze_protocol- Analyze protocol requirementsget_system_info- Get system information
Data Management
upload_data_file- Upload CSV data fileslist_data_files- List data filesdelete_data_file- Delete data files
OT-2 Specific
create_session- Create calibration sessionexecute_session_command- Run calibration commandsget_calibration_status- Check calibrationstart_calibration- Begin calibration process
Flex Specific
get_flex_deck_configuration- Get Flex deck setupset_flex_deck_configuration- Configure Flex deckget_error_recovery_settings- Error recovery configset_error_recovery_policy- Set error handlinglist_maintenance_runs- Maintenance operationslist_subsystems- Subsystem control
And 30+ more tools for complete robot control!
Environment Variables
ROBOT_IP- Your robot's IP address (required)ROBOT_PORT- Robot's HTTP API port (default: 31950)
Example Protocols
This repository includes example protocols:
complete_liquid_transfer_dispense_top.py- Full liquid transfer with calibration offsetshold_above_4th_row_tips.py- Position verification protocol- And many more examples!
Troubleshooting
Robot Not Responding
- Check robot IP address is correct
- Ensure robot is on same network (or VPN)
- Verify robot's HTTP API is running (check Opentrons app)
- Ping the robot:
ping 192.168.16.38
MCP Server Not Loading
- Check MCP config file path is correct
- Verify Node.js is installed:
node --version - Check file permissions on index.js
- Restart your MCP client (Cursor/VS Code)
Protocol Upload Fails
- Ensure protocol syntax is correct
- Check robot has available storage
- Verify file is .py or .json format
- Try uploading via Opentrons app first
Connection Issues from Remote
- Check ngrok tunnel is running
- Verify firewall allows connections
- Test with curl:
curl http://your-ngrok-url.ngrok.io/health
Security Considerations
⚠️ IMPORTANT: This server provides full control over your robot.
For Local Use:
- ✅ Safe - only accessible on local network
- ✅ No external exposure
For Remote Use:
- ⚠️ Use authentication (add auth middleware)
- ⚠️ Use HTTPS/TLS encryption
- ⚠️ Restrict IP access if possible
- ⚠️ Monitor access logs
- ⚠️ Use VPN when possible instead of public exposure
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
Support
- Issues: Open a GitHub issue
- Discussions: Use GitHub Discussions
- Documentation: See Opentrons API docs
License
MIT License - Feel free to modify and use for your projects!
Acknowledgments
- Built on the Model Context Protocol
- Uses Opentrons HTTP API
- Inspired by the need for AI-controlled lab automation
Made with ❤️ for the lab automation community
from github.com/global-mysterysnailrevolution/Opentrons-mcp-server
Installing Opentrons
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/global-mysterysnailrevolution/Opentrons-mcp-serverFAQ
Is Opentrons MCP free?
Yes, Opentrons MCP is free — one-click install via Unyly at no cost.
Does Opentrons need an API key?
No, Opentrons runs without API keys or environment variables.
Is Opentrons hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Opentrons in Claude Desktop, Claude Code or Cursor?
Open Opentrons on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Opentrons with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
