An MCP server for the Arduino Uno R4

If you want an AI agent to write a sketch, upload it to an Arduino Uno R4 and read what Serial.println prints, this MCP server wires arduino-cli and the board's serial port into the agent's tool list. Here is what works today and one limit you should know first.

Last checked against the source code on 2026-09-20.

Setup

  1. Install arduino-cli (brew install arduino-cli, or the installer from the arduino-cli docs) and the Renesas core it needs for the R4: arduino-cli core install arduino:renesas_uno.
  2. Register the MCP server with your client using the config in the quickstart.
  3. Plug the board in with a data-capable USB-C cable.

Detection

list_boards matches Arduino's USB vendor ID 2341 with product IDs 0069 (Uno R4 Minima), 1002 (Uno R4 WiFi) and 0074 (Nano R4), plus each one's bootloader-mode id. It also recognises the Uno R3 IDs (2341:0043, 2341:0001 and 2a03:0043). Each board is returned with family arduino_uno_r4 and its port path; the board target (FQBN) that uploads compile for is derived from the same id.

Compile and upload

flash_firmware {
  "family": "arduino_uno_r4",
  "path": "/dev/cu.usbmodem1101",
  "firmwarePath": "/Users/you/Arduino/Blink"
}

The server runs arduino-cli compile --upload -p <port> --fqbn <board target> <sketch dir>, with the board target taken from the port's USB id: arduino:renesas_uno:unor4wifi for a WiFi, arduino:renesas_uno:minima for a Minima, arduino:renesas_uno:nanor4 for a Nano R4 and arduino:avr:uno for an R3. If arduino-cli is missing, the tool result says so and gives the install command. Compile errors come back as the tool's error text, which is usually all an agent needs to fix the sketch and try again. compile_sketch does the compile step alone and returns the compiler's diagnostics as data.

Pins and buses through the bridge sketch

An Arduino has no interpreter to talk to, so the server ships a small sketch with a one-line request/reply protocol. install_bridge_sketch uploads it to the detected board; after that gpio_mode, gpio_read, gpio_write, adc_read, pwm_write, i2c_scan, i2c_read, i2c_write and spi_transfer work on it, and board_info reports the sketch and its protocol version. Uploading the sketch replaces whatever sketch was on the board.

What is proven, as of 2026-09-20: the server side of this protocol is proven against a TypeScript emulator of the sketch, and the sketch itself has not been compiled or run on a physical Arduino by the studio. The upload commands are proven by asserting the arduino-cli arguments, with no arduino-cli installed on the machine that built this. Expect the first real run to find something.

Reading Serial output

serial_open { "family": "arduino_uno_r4", "path": "/dev/cu.usbmodem1101", "baudRate": 9600 }
serial_read { "family": "arduino_uno_r4", "handle": { ... }, "timeoutMs": 3000 }

Use the same baud rate as Serial.begin() in your sketch. The port is released with serial_close, which matters on the R4 because an upload needs the port free. Ask the agent to close the port before it uploads again.

Where this fits

Arduino Cloud's web editor has its own AI assistant with a monthly quota, and several open-source Arduino MCP servers exist; the comparison page lists the ones surveyed. This server's difference is that one install covers the Uno R4, ESP32 and Raspberry Pi Pico with the same 21 tools, free, with a one-time Pro unlock for the phone bridge.

Frequently asked questions

Is there an MCP server that can upload sketches to an Arduino Uno R4?
Yes. This server's flash_firmware tool runs arduino-cli compile --upload against the board's port, so an agent such as Claude Code or Cursor can build and upload a sketch folder and then read Serial output with serial_read.
Does it work with the Uno R4 Minima as well as the Uno R4 WiFi?
Both are detected by list_boards, and the upload target follows the detected model: arduino:renesas_uno:minima for a Minima (USB id 2341:0069) and arduino:renesas_uno:unor4wifi for a WiFi (2341:1002). A Nano R4 (2341:0074) gets arduino:renesas_uno:nanor4. A port whose USB id is not in the table is refused with a message that names list_boards, rather than compiled for the wrong core.
What does the agent pass as the firmware for an Arduino?
A sketch directory, the folder that contains your .ino file. arduino-cli compiles it and uploads the result in one step, and the tool returns arduino-cli's output so compile errors reach the agent verbatim.
Will it work with an older Uno R3?
An Uno R3 is detected by its USB ids (2341:0043, 2341:0001 and 2a03:0043), its serial port works with the serial tools, and uploads compile for arduino:avr:uno, the target derived from those ids. Install the AVR core first: arduino-cli core install arduino:avr.
Do I need Arduino Cloud or an Arduino account?
No. Everything runs on your computer: the MCP server, arduino-cli and the USB connection. Nothing is sent to a cloud service to compile or upload.