LabMCP: Let AI Assistants Run Your Lab Instruments
LabMCP lets an AI assistant such as Claude operate your laboratory instruments. You describe what you want in plain language, and the assistant weighs, heats, stirs, pumps, measures and logs for you. It stays inside safety limits you set, keeps a record of every command, and has a practice mode that needs no hardware.
It supports balances, hotplate stirrers, syringe pumps, spectrometers, mass spectrometers, potentiostats, lock-in amplifiers, temperature controllers, vacuum gauges, flow controllers, biosensors, clinical analyzers and more. You don't need to know how to program. Setup means installing one free helper program and pasting a few lines into your AI app's settings.
Free and open source, built by K-Dense.
You: Tare the balance, then heat the stirrer to 60 °C at 400 rpm and log the pH every
30 s until it's stable. Tell me when to add the reagent.
Assistant: [tares the balance → sets stirring to 400 rpm → sets heating to 60 °C → logs pH …]
"pH has been 7.41 ± 0.01 for 3 minutes. Ready for the reagent."
⭐ Help other scientists find this. If LabMCP is useful to you, please star the repo.
📋 Contents
- How it works
- Try it in 10 minutes (no instrument needed)
- Supported instruments
- Connect your real instrument
- Safety
- What every connector includes
- Example requests
- FAQ
- Contributing
- Roadmap
💡 How it works
You ──type──▶ AI app ──▶ LabMCP connector ──USB / serial / network cable──▶ Instrument
(Claude, (runs on the computer
Cursor, …) attached to the instrument)
- The AI app is where you type requests, e.g. Claude Desktop.
- A LabMCP connector is a small program that knows one family of instruments and its command language, so the AI never has to guess it. You add one connector per type of instrument. (Technically these are MCP servers, which is the term you'll see in the tables and docs.)
- MCP (Model Context Protocol) is the open standard that lets AI apps plug into tools like these. Think of it as USB for AI.
- The AI can only use the actions a connector offers, like "tare", "set temperature" or "read pH". In the docs these actions are called tools. The connector checks every request against your limits and refuses anything unsafe before it reaches the instrument.
🚀 Try it in 10 minutes (no instrument needed)
Each connector has a practice mode (a simulator) that behaves like the real instrument and gives realistic replies. Nothing is connected, so nothing can go wrong.
You need: a Mac, Windows or Linux computer, and an AI app that supports MCP. Claude Desktop is the easiest place to start.
Step 1: Install uv (once)
uv is a free tool that downloads and runs LabMCP for you. Open a terminal:
- Mac: press ⌘ Space, type Terminal, press Enter.
- Windows: open the Start menu, type PowerShell, press Enter.
Paste the line for your system and press Enter:
# Mac or Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Close the terminal and open it again so it finds the new program.
Step 2: Add a practice balance to your AI app
In Claude Desktop, go to Settings → Developer → Edit Config. This opens a file called claude_desktop_config.json. Paste the following into it and save. If the file already has an "mcpServers" section, add only the "balance" line inside it.
{
"mcpServers": {
"balance": { "command": "uvx", "args": ["labmcp-mettler-toledo", "--simulate"] }
}
}
Quit Claude Desktop completely, then reopen it.
Mac tip: if Claude reports that it can't find
uvx, runwhich uvxin Terminal and replace"uvx"in the file with the full path it prints (usually/Users/<your-name>/.local/bin/uvx).
Using a different app? For Claude Code, run claude mcp add balance -- uvx labmcp-mettler-toledo --simulate in a terminal. For Cursor, VS Code, Codex and Windsurf, see docs/clients.md.
Step 3: Ask
"What instrument is connected? Tare it, then log the weight every second for 10 seconds."
The first request can take a minute while the connector downloads. Your AI app will usually ask your permission before it takes an action. Say yes.
Want a whole lab? examples/ sets up six practice instruments at once (balance, stirrer, pH probe, syringe pump, potentiostat and spectrometer).
📦 Supported instruments
Find your instrument below and click its name. Each page covers the settings to change on the instrument itself, the safety limits you can set, and everything the AI can do with it.
Reading the tables:
- Interface is the cable or connection the instrument uses.
- Tools is how many different actions the AI can take.
- Install is the name to put in your AI app's settings (the part after
uvx). - Status: 🧪 simulated means built from the manufacturer's published manual and tested thoroughly in practice mode, but not yet confirmed on a real instrument by a user. ✅ hardware-verified means someone has confirmed it on the real instrument. If you own one of these instruments, you can help verify it. No coding needed.
🧬 Biology & Life Sciences
⚗️ Chemistry
🔭 Physics & Optics
🩺 Health & Biosignals
⚙️ Engineering & Data Acquisition
🔌 Universal Protocols (many instruments)
The Universal Protocols connectors work with many instruments from many brands, as long as the instrument speaks that standard (its manual will say, e.g., "SCPI commands" or "Modbus").
Don't see your instrument? Request it. Some manufacturers (for example Keysight and Rohde & Schwarz) publish their own AI connectors. We list those rather than duplicate them.
🔌 Connect your real instrument
Once practice mode works, switching to the real instrument is one change in the same settings file.
-
Plug the instrument into the computer that runs your AI app (by USB, serial cable or network) and switch it on. Click your instrument's name in the table above to check whether anything needs changing on the instrument, such as enabling remote control or setting its communication speed (baud rate).
-
Find its address, meaning where the computer sees it. In a terminal, run:
uvx labmcp portsIt lists what's connected. Tip: run it once with the instrument unplugged and once plugged in. The new entry is your instrument.
-
Test the connection (replace
COM3with your address):uvx labmcp-mettler-toledo --address COM3 --checkA working connection reports the instrument's model. If it doesn't, see troubleshooting.
-
Update your settings file: replace
"--simulate"with"--address", "COM3", save, and restart your AI app."balance": { "command": "uvx", "args": ["labmcp-mettler-toledo", "--address", "COM3"] }Or let LabMCP write the entry for you:
uvx labmcp config mettler-toledo --address COM3.
Several instruments? Add one entry per instrument, each with its own name ("balance", "stirrer", "pump", …). The assistant can then use them together.
🛡️ Safety
AI assistants operating physical equipment need guardrails. LabMCP has several layers of them, and you stay in charge:
- Practise first with
--simulate. - Start in read-only mode with
--read-only. The AI can read measurements but can't change anything. Stop and switch-off actions still work. - Set limits for your experiment, e.g.
--limit max_temperature_c=60to stay below your solvent's boiling point. Requests above a limit are refused before anything is sent to the instrument. Each instrument's page lists its limits and their defaults. - Approve risky actions yourself. Actions that heat, move, dispense or switch on power are marked as hazardous (⚠️), so your AI app asks before running them. Don't turn on "always allow" for these.
- Keep the instrument's own safety features on (interlocks, over-temperature cut-offs). LabMCP's limits are an extra layer, not a replacement.
Options go in the same list as the address in your settings file, for example:
"stirrer": { "command": "uvx", "args": ["labmcp-ika", "--address", "COM4", "--read-only", "--limit", "max_temperature_c=60"] }
Read SAFETY.md before connecting anything hazardous. LabMCP is a research tool, not a certified safety system or medical device.
🧰 What every connector includes
🧪 Example requests
Add several instruments and the assistant can coordinate them:
- Chemistry: "Weigh 250 mg ± 2 mg of salt into the vial: tell me how much to add, reading the balance every few seconds. Then set the stirrer to 500 rpm and 40 °C, and tell me when it's dissolved and at temperature."
- Electrochemistry: "Run cyclic voltammograms from −0.2 to 0.6 V at 25, 50, 100 and 200 mV/s, extract the anodic peak currents, and check whether they scale with the square root of scan rate."
- Physics: "Sweep the lock-in reference from 1 to 100 kHz in 40 log-spaced steps and fit the resonance. Then ramp the cryostat to 10 K at 2 K/min and repeat at 50 K and 100 K."
- Biology: "Infuse 2 mL of media at 0.5 mL/min, then log the bioreactor pH and dissolved oxygen every minute for an hour and flag any drift."
- Engineering: "Step the flow controller through 10, 20 and 50 sccm of N₂ and log the upstream pressure at each setpoint. Stop and close the valve if pressure goes above 30 psia."
- Clinical lab operations: "Summarise today's CBC results received from the analyzer and list any samples with flagged results."
❓ FAQ
Do I need to know how to program? No. You install uv once and paste a few lines into your AI app's settings. LabMCP downloads and runs everything else.
Which AI app should I use? Any app that supports MCP. Claude Desktop is the simplest to set up. Claude Code, Cursor, VS Code, Codex and Windsurf also work (setup for each).
Does it cost anything? LabMCP is free and open source. Your AI app may need its own subscription.
Which computer does it run on? The one physically connected to the instrument. To control an instrument from another computer, see remote instruments.
Does my data leave the lab? LabMCP runs on your computer and talks to the instruments directly. Your AI app sends the results to its AI provider, just like anything else you type into it, so follow your institution's data policies.
Why not just ask the AI to write its own code for the instrument? It can try, but it would start from scratch every time, with no safety limits, no command record, no practice mode, and no protection against a mistyped command. LabMCP encodes each instrument's manual once, carefully, for everyone.
Something isn't working. See the troubleshooting table. If that doesn't help, open an issue.
My instrument's manufacturer has its own AI connector. Great, use it. We only build connectors for instruments without one, and list the official ones.
Is this validated for GxP or clinical use? No. See SAFETY.md.
🤝 Contributing
No coding needed for the most valuable contribution: testing a connector on your real instrument. All connectors are currently 🧪 simulated: they stay that way until someone who owns the instrument confirms they work. Run the connection check, try a few requests, and file a short report. You can also request an instrument, or add 👍 to existing requests.
For developers
Each connector is a separate Python package (labmcp-<name>), so people install only what they need. All of them share the labmcp core, so they behave the same way: same options, same safety model, same built-in tools. See docs/architecture.md.
lab-instrument-mcps/
├── packages/labmcp/ # shared core: transports, simulator base, safety, audit, CLI
├── servers/
│ ├── biology/ # one folder = one installable server (labmcp-<name>)
│ ├── chemistry/
│ ├── physics/
│ ├── health/
│ ├── engineering/
│ └── protocols/ # generic: SCPI, Modbus, … (many instruments each)
├── docs/ # architecture, client setup, contributor guide, official servers
├── examples/ # ready-made client configs, e.g. a simulated "virtual lab"
├── scripts/ # new_server.py (scaffold), build_catalog.py (catalog & docs)
└── catalog.json # machine-readable index of every server and tool (generated)
To add an instrument:
git clone https://github.com/K-Dense-AI/lab-instrument-mcps && cd lab-instrument-mcps
uv sync --all-packages && uv run pytest
uv run python scripts/new_server.py --domain chemistry --slug my-instrument \
--package labmcp-my-instrument --name "My Instrument" --vendor "Vendor"
Then follow docs/writing-a-server.md and CONTRIBUTING.md.
🗺 Roadmap
Wanted next. Each needs a published protocol or SDK from the manufacturer, and someone to test it on real hardware:
- Liquid handling & lab robotics: PyLabRobot backends (Hamilton STAR, Tecan EVO, plate readers, centrifuges), Hamilton Microlab 600 pumps
- Spectroscopy & analytics: Zurich Instruments lock-ins, Avantes spectrometers, Knauer HPLC pumps, Anton Paar densitometers
- Motion & optics: Thorlabs Kinesis / APT motion controllers, Newport ESP/SMC controllers, Zaber stages
- Environment & process: Watlow/Eurotherm controllers (via the Modbus connector), Vaisala sensors, Binder/Memmert chambers, OPC UA LADS devices
- Health: Polar H10 raw ECG, BITalino / PLUX biosignals, Nonin pulse oximeters
- Protocol features: ASTM order download, EPICS PV Access, exposing LabMCP instruments as SiLA 2 servers
Request an instrument or vote with 👍 on existing requests.
📄 License & citation
Apache-2.0. If LabMCP helps your research, please cite it (CITATION.cff).
Made by K-Dense, with contributions from scientists and engineers everywhere.