arduino-mcp
Enables compiling, uploading, testing, and debugging Arduino sketches on real boards via arduino-cli, with tools for board and library management, library API lookup, serial communication, and automated PASS/FAIL testing.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
arduino-mcp
Let Claude write, compile, upload, test and debug Arduino code on your real board.
An MCP server that wraps the official
arduino-cli. Plug in your Arduino,
add this server to Claude Code (or Claude Desktop / VS Code), and ask:
Write a sketch that blinks the LED and prints "TEST ok" every second, then test it on my board.
Claude will compile it, read the errors, fix them, upload it, read the Serial output and tell you PASS or FAIL, looping until it works.
It runs on your own computer, because it needs the USB port.
What it does
The test and debug loop
check_sketchcompiles the code with no board needed. It returns each error with the file, the line, the code on that line and a plain-English hint. It also runs extra checks the compiler doesn't do: a missingSerial.begin, long blockingdelay()s,while(!Serial)freezing on battery, and a missingcontroller.begin()/controller.ping()for the Arduino Motor Carrier.library_apifact-checks a library. It reads the real function names and parameters from the installed library's.hfiles, so Claude doesn't invent functions that don't exist.test_on_boarddoes compile, upload, open Serial, send test lines, read the output and answer PASS / FAIL, all in one call. You give it what must appear (expect), what means failure (fail_on) and what to send (send).
You can paste code straight in (the code input), or point at a .ino file
or sketch folder. Sketches whose folder name doesn't match the .ino name
work too. Re-compiles are faster because each sketch keeps its build folder.
All tools
Tool | What it does |
| Compile + clear errors + extra checks. No board needed. |
| Compile, upload, Serial test, PASS/FAIL. |
| Real functions of an installed library. |
| Which arduino-cli is used, and installed boards. Run first if something breaks. |
| Plugged-in boards and their ports ( |
| Find a board's ID (FQBN), e.g. "mega" gives |
| Install board support, e.g. |
| Library Manager. |
| Plain compile, or compile and upload. |
| Watch Serial output, or send a line. |
The plugin version also includes the arduino-dev skill, which tells Claude to work in this order.
The default board is the Arduino Nano 33 IoT (arduino:samd:nano_33_iot).
For any other board, just tell Claude which one ("use an Uno"), or change the
default (see Settings).
Related MCP server: MCP Arduino Server
Install as a Claude plugin (easiest)
You still need Python 3.10+ and arduino-cli on your computer (step 1 below). The plugin installs its two Python packages by itself on first start.
Claude Code:
/plugin marketplace add PhamAnhHoangg/Arduino-IDE-MCP
/plugin install arduino@arduino-ide-mcpRestart Claude Code, then check /mcp. You should see plugin:arduino:arduino
connected. The plugin also adds an arduino-dev skill that teaches Claude the
check, fix, test loop.
Claude desktop app: download
dist/arduino.plugin from this repo and upload it in
the app's plugin settings (or drag it into a chat).
On macOS/Linux, if python isn't found, edit .mcp.json to use python3.
Manual install (3 steps)
You need Python 3.10+ and arduino-cli.
1. Install arduino-cli
System | Command |
Windows |
|
macOS |
|
Linux |
|
Already have Arduino IDE 2 on Windows or macOS? You can skip this step. The server looks for the copy of arduino-cli that ships inside the IDE.
No Python yet? Get it from python.org. On Windows, tick "Add python.exe to PATH" in the installer.
2. Download this repo and install the Python packages
Click Code > Download ZIP on GitHub and unzip it (or git clone it), then
in a terminal inside the folder:
python -m pip install -r requirements.txt(On macOS/Linux use python3 if python isn't found.)
3. Add it to Claude
Claude Code (terminal, and the Claude Code extension for VS Code / JetBrains):
# Windows
claude mcp add arduino --scope user -- python "C:\path\to\arduino-mcp\arduino_mcp.py"
# macOS / Linux
claude mcp add arduino --scope user -- python3 /path/to/arduino-mcp/arduino_mcp.pyRestart claude and type /mcp. You should see arduino connected.
Settings > Developer > Edit Config, then add:
{
"mcpServers": {
"arduino": {
"command": "python",
"args": ["C:\\path\\to\\arduino-mcp\\arduino_mcp.py"]
}
}
}On Windows, write paths with double backslashes. On macOS/Linux use python3
and a normal path. Restart the app.
Copy vscode-mcp.example.json to .vscode/mcp.json in your project, fix the
path inside, and click Start above the server entry.
Finally, install your board's core once. You can just ask Claude "install the core for my board", or run it yourself:
arduino-cli core update-index
arduino-cli core install arduino:avr # Uno, Mega, classic Nano
arduino-cli core install arduino:samd # Nano 33 IoT, MKR boardsExample prompts
"List my connected Arduino boards."
"Check
blink/blink.inoand fix any errors.""Write a sketch that reads A0 and prints the value. Test it on COM5, expecting a number."
"Run
examples/serial_selfteston my board, sendping, expectREADYandpong.""What functions does the ArduinoMotorCarrier library have for servos?"
"Read the serial output for 10 seconds."
Tip for testable sketches: have the sketch print clear markers like
READY or TEST ok, and print them repeatedly or in reply to a command.
Output in the first second after reset can be missed while USB reconnects.
See examples/serial_selftest.
Settings
Optional environment variables. Add them with -e in claude mcp add, e.g.
claude mcp add arduino --scope user -e ARDUINO_FQBN=arduino:avr:uno -- python ...
Variable | Meaning | Default |
| Full path to | PATH, then Arduino IDE 2 |
| Default board |
|
Troubleshooting
"arduino-cli was not found": set
ARDUINO_CLIto its full path (where arduino-clion Windows,which arduino-clion macOS/Linux).Upload: "access denied" / "port busy": only one program can use a serial port. Close the Arduino IDE Serial Monitor and any script using the port.
No board found: try another USB cable, because some only charge.
Linux: permission denied on
/dev/ttyACM0: runsudo usermod -aG dialout $USER, then log out and back in.Native-USB boards (Nano 33 IoT, MKR, Leonardo) won't upload: double-tap reset (the LED pulses) and try again. The port name can change after this.
First compile is slow: that's normal. Later ones are faster.
Limits
test_on_boardonly sees what the board prints over Serial. It can't see a motor turn or an LED light. Make the sketch print what it did (sensor values, encoder counts), or check the hardware yourself.Claude can make mistakes. Read the code before running it on hardware that can move, heat up, or draw a lot of current.
Status: what is tested
This is an early version.
Tested (Linux, Python mcp 1.x, through a real MCP client):
The server starts and all 15 tools load.
The plugin passes
claude plugin validate, installs in Claude Code from the marketplace, shows as connected inclaude mcp list, and auto-installs its Python packages into a fresh Python environment.Compile-error parsing, hints and extra checks, using real
g++compiler errors.library_apiagainst the real ArduinoMotorCarrier library source.test_on_board,serial_sendandserial_readagainst a simulated serial board (PASS, FAIL, compile failure, send and reply).
Not tested yet:
Real compiles with the Arduino toolchain, and real uploads to a board.
Windows and macOS (including the plugin in the Claude desktop app).
Finding the arduino-cli bundled in Arduino IDE 2.
If you try it, please open an issue with what worked or broke.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Build, check and open Arduino, ESP32 and Pico circuits with code in the Mokxi simulator.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Arduino benches simulated in the browser: sessions, sketch push, simulation, tests, challenges.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude to control Arduino boards in real-time, allowing users to turn LEDs on and off through natural language commands using the Model Context Protocol and Firmata.13-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Arduino development through arduino-cli, allowing sketch management, code compilation and uploading, library and board operations, serial monitoring, and AI-powered circuit diagram generation using WireViz.32 PyPI10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Arduino boards for compiling, uploading sketches, and serial communication.6MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to compile, upload, and monitor Arduino boards via natural language, with electrical safety checks and dependency management.21252 npm26MIT