arduino-mcp
Provides tools for detecting connected Arduino boards, managing cores and libraries, compiling and uploading sketches, and performing serial I/O for Arduino-based projects.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@arduino-mcp compile examples/Blink for arduino:avr:uno and upload to the connected port"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
arduino-mcp
Local stdio MCP server that wraps arduino-cli so agents can detect boards, manage cores/libraries, compile/upload sketches, and talk serial — without shell gymnastics.
Built as a standalone package (reuse across projects). Designed with Ratchet Phase 0.3 / 2.7 in mind (Uno + Portenta, 115200 UART), but not coupled to that firmware tree.
Prerequisites
Node.js 20+
Arduino CLI on your machine:
Standalone
arduino-clionPATH, orArduino IDE 2.x (this server auto-detects the IDE-bundled
arduino-cli.exeon Windows), orSet
ARDUINO_CLI_PATHto the executable
Optional boards for Ratchet:
Board | Core to install | FQBN |
Arduino Uno |
|
|
Portenta H7 |
|
|
Portenta note: OpenMV firmware and the Arduino Mbed core overwrite each other. Switching is deliberate — use MCP
uploadonly when you intend to be on the Arduino core.
Related MCP server: Arduino MCP Server (Simple)
Install
cd arduino-mcp
npm install
npm run buildTools
Tool | Purpose |
| Health check + resolved CLI path |
| Detect connected boards / ports |
| List/install platforms |
| Library Manager |
| Build a sketch for an FQBN |
| Flash a board on a port |
| Serial I/O (default baud 115200) |
Serial buffers are capped (~64KB). Prefer hex encoding for binary UART frames.
Cursor / Claude Desktop (stdio)
Do not add this to Cursor until you have run a local smoke test and explicitly approve the MCP config (local serial + upload access).
Example Cursor MCP entry (user-level or project .cursor/mcp.json):
{
"mcpServers": {
"arduino": {
"command": "node",
"args": ["C:/Users/YOU/CursorProjects/arduino-mcp/dist/index.js"],
"env": {
"ARDUINO_CLI_PATH": "C:/Users/YOU/Downloads/arduino-cli_1.5.2-rc.1_Windows_64bit/arduino-cli.exe"
}
}
}
}Omit ARDUINO_CLI_PATH if the IDE-bundled CLI is enough or arduino-cli is on PATH.
Dev without build:
{
"command": "npx",
"args": ["tsx", "C:/Users/YOU/CursorProjects/arduino-mcp/src/index.ts"]
}Smoke test
npm run smokeWith a board plugged in:
$env:SMOKE_UPLOAD_PORT = "COM3" # your port from board list
npm run smokeThe smoke script compiles examples/Blink for arduino:avr:uno (installs the AVR core if missing). Upload is optional.
Example agent flow (Uno blink)
arduino_cli_versioncore_install→arduino:avr(once)board_list→ noteCOMxcompile→ sketchexamples/Blink, fqbnarduino:avr:unoupload→ same sketch/fqbn + portserial_open→ port, baud115200serial_read→ expectblink-high/blink-lowlinesserial_close
Security notes
All
arduino-cliinvocations usespawnwith an argv array (no shell interpolation).This server can flash firmware and open serial ports on your machine — treat it as a privileged local tool.
Prefer absolute sketch paths from trusted projects.
License
Apache-2.0
Available Tools
17 toolsarduino_cli_versionA
Confirm arduino-cli is available and report its version. Call this first to verify the toolchain before compile/upload.
Inputs: no named parameters.
board_listA
List connected boards with detected FQBN when possible. Alias-friendly companion to list_ports.
Inputs: discoveryTimeout.
compileA
Compile a sketch for a board FQBN without uploading. Use arduino:avr:uno for Uno or arduino:mbed_portenta:envie_m7 for Portenta H7.
Inputs: fqbn (required), sketchPath (required), clean, verbose, +2 more.
core_installA
Install an Arduino core/platform by id. Examples: arduino:avr (Uno), arduino:mbed_portenta (Portenta H7).
Inputs: platformId (required).
core_listA
List installed Arduino cores (platform packages), e.g. arduino:avr or arduino:mbed_portenta.
Inputs: no named parameters.
lib_installB
Install one or more Arduino libraries by name from Library Manager.
Inputs: libraries (required).
lib_searchC
Search the Arduino Library Manager by query string.
Inputs: query (required).
list_portsB
List serial ports detected by arduino-cli (USB adapters, Uno, Portenta, etc.).
Inputs: no named parameters.
rattus_crc_self_testA
Verify host-side CRC-8/MAXIM matches firmware RattusUart (expect check vector 0xA1).
Inputs: no named parameters.
rattus_heartbeatC
Send CMD_TWIST heartbeats at ~20 Hz for durationMs (Phase 2.7 soak / link-up). Uses open serial port.
Inputs: vMmS, periodMs, durationMs, omegaMradS.
rattus_send_twistA
Phase 2.7 PC-masquerade: pack a CMD_TWIST frame (CRC-8/MAXIM) and write it to the open serial port (Uno USB). Requires serial_open first.
Inputs: vMmS (required), omegaMradS (required), seq.
serial_closeB
Close the currently open serial port session.
Inputs: no named parameters.
serial_openA
Open a serial port exclusively for read/write. Default baud is 115200 (Ratchet UART). Close any previous session first.
Inputs: path (required), baudRate.
serial_readA
Read buffered bytes from the open serial port. Buffer is capped (~64KB) to protect agent context.
Inputs: encoding, maxBytes.
serial_statusA
Report whether a serial session is open and how many bytes are buffered.
Inputs: no named parameters.
serial_writeA
Write data to the open serial port. Use hex/base64 for binary UART frames (e.g. Ratchet Phase 2.7).
Inputs: data (required), encoding.
uploadA
Upload a sketch to a board on a serial port. Prefer compile first with libraries/buildPath, then pass the same buildPath as inputDir (upload does not accept --libraries).
Inputs: fqbn (required), port (required), sketchPath (required), verify, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
There is some overlap between list_ports and board_list, both of which enumerate connected hardware, and between rattus_send_twist and rattus_heartbeat, which both send CMD_TWIST frames. The descriptions clarify their differences (single frame vs. continuous heartbeat, port enumeration vs. FQBN detection), but an agent could still confuse them without careful reading.
Most tool names follow a noun_verb pattern (core_install, lib_search, serial_open), but there are clear deviations: list_ports is verb_noun, compile and upload are bare verbs, and the rattus_* tools use a project-specific prefix. All names use snake_case consistently, but the inconsistent verb placement and mixture of styles make the set only mildly predictable.
With 17 tools, the server sits slightly above the typical 3-15 tool range, but the scope of Arduino development (port detection, core/library management, compile/upload, serial communication, and protocol-specific utilities) justifies the count. A couple of tools, like board_list and rattus_crc_self_test, are arguably redundant or niche, but overall the count is reasonable for the domain.
The tool set covers the main lifecycle of an Arduino project: board discovery, core installation, library search/install, compiling, uploading, and serial monitor functionality. Missing operations such as uninstalling or updating cores/libraries are minor gaps that don't significantly hinder the primary workflow, so the surface is fairly complete.
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Hosted MCP server and Agent Skills for specs, engineering threads, and project memory.
Related MCP Servers
- AlicenseCqualityDmaintenanceA comprehensive Model Context Protocol (MCP) server for Arduino CLI interactions, built with FastMCP. This server enables AI agents to seamlessly interact with Arduino CLI for development, debugging, code verification, and more.1639 PyPI2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Arduino boards for compiling, uploading sketches, and serial communication.6MIT
- AlicenseNot gradedqualityDmaintenanceA lightweight, stdio-based MCP server enabling AI assistants to perform local file system operations like reading, writing, searching, and executing commands.6,054 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Arduino IDE 2.0 sketches. It exposes a small REST API plus an MCP stdio bridge so agents can read and write the main .ino file, list sources, and optionally compile with arduino-cli.61 npmMIT