PluginBench
MCP Server
Maintained
MIT

Arduino MCP Server MCP Server

io.github.hardware-mcp/arduino-mcp-server

Give AI assistants full control over Arduino — compile, upload, monitor serial, and verify wiring safety through natural language.

What is the Arduino MCP Server MCP server?

The Arduino MCP Server is an MCP server that wraps arduino-cli to give AI assistants direct control over Arduino boards. It enables board detection, sketch compilation and upload, serial monitoring with stateful sessions, and electrical safety checks—all accessible through natural language commands.

Arduino MCP Server bridges AI assistants to Arduino hardware by exposing arduino-cli functionality as MCP tools. You can detect connected boards, compile and upload sketches, monitor serial output interactively, and run safety preflight checks for battery charge rates, polarity, and pin conflicts before sending commands to hardware. Ideal for AI-assisted embedded development workflows where you want the assistant to handle the full hardware lifecycle without manual terminal commands.

How to install Arduino MCP Server

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • ARDUINO_CLI_PATH

    Optional path to arduino-cli binary. Defaults to arduino-cli on PATH.

  • ARDUINO_SKETCH_ROOT

    Optional absolute path restricting sketch operations to this directory.

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "arduino-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "arduino-mcp-server"
      ],
      "env": {
        "ARDUINO_CLI_PATH": "<YOUR_ARDUINO_CLI_PATH>",
        "ARDUINO_SKETCH_ROOT": "<YOUR_ARDUINO_SKETCH_ROOT>"
      }
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • arduino_cli_doctor — Check Arduino CLI installation and version
  • install_arduino_cli — Guide through arduino-cli installation
  • detect_hardware — Detect connected boards and infer FQBNs
  • list_connected_boards — List all connected Arduino boards
  • list_serial_ports — List available serial ports
  • ensure_core_installed — Check/install board cores
  • compile_sketch — Compile a sketch for a target board
  • upload_sketch — Upload compiled sketch to a board
  • upload_and_wait_ready — Upload and wait for device ready signal
  • serial_open_session — Open a stateful serial session
  • serial_read — Read buffered serial data
  • serial_expect — Wait for a pattern in serial output
  • serial_write — Send data over serial
  • serial_close_session — Close a serial session
  • serial_list_sessions — List active serial sessions
  • read_serial_snapshot — Quick one-shot serial read
  • safety_preflight — Electrical safety check before hardware ops
  • get_board_details — Get pin/capability details for a board
  • list_supported_boards — List all boards arduino-cli supports
  • list_board_reference — Browse board pin reference

Use cases

  • Bootstrap Arduino CLI and set up a development environment for a specific board (e.g., Arduino Uno) from scratch
  • Compile a sketch and upload it to a connected board without touching the terminal
  • Open a serial session, wait for a specific output pattern, and send commands interactively to monitor device behavior
  • Run electrical safety preflight checks for battery charge rates, polarity, and pin conflicts before uploading to hardware
  • Search board pin references and retrieve detailed capability information for a target microcontroller

Arduino MCP Server MCP server FAQ

What is the Arduino MCP Server?

It's an MCP server that wraps arduino-cli to give AI assistants like Claude direct control over Arduino boards. You can compile sketches, upload code, monitor serial output, detect hardware, and run safety checks—all through natural language.

Is it free?

Yes, it's open-source under the MIT license.

How do I install it in Claude Desktop?

Install via npm (npm install -g arduino-mcp-server), then add it to your claude_desktop_config.json with the command 'npx -y arduino-mcp-server' and set ARDUINO_CLI_PATH and ARDUINO_SKETCH_ROOT environment variables.

Do I need arduino-cli installed separately?

arduino-cli should be on your PATH, or you can set ARDUINO_CLI_PATH to point to it. The server can also guide you through installation if needed.

What safety checks does it provide?

The safety_preflight tool checks battery charge rates (C-rate), battery polarity confirmation, and board-specific pin conflicts (e.g., SPI-flash pins on ESP32, boot-strapping pins) before hardware operations.

Can I use it with Cursor?

Yes, Cursor supports MCP servers. Add the same configuration to Cursor's MCP settings as you would for Claude Desktop.

README (reference)

Source of truth, from the repository.

arduino-mcp-server

npm version License: MIT Node.js 20+

Give your AI assistant full control over Arduino — compile, upload, monitor serial, and verify wiring safety, all through natural language.

Part of the HardwareMCP ecosystem — open-source MCP servers that bridge AI to physical hardware.


What this does

AI assistants can control Jira, GitHub, and databases. They can't talk to a microcontroller — until now.

arduino-mcp-server wraps arduino-cli into an MCP server so your AI can:

  • Detect connected boards and ports automatically
  • Compile and upload sketches without touching the terminal
  • Monitor serial output with stateful sessions (open, read, expect, write, close)
  • Run electrical safety checks before sending commands to hardware
  • Manage dependencies — cores, libraries, and CLI installation

Quick Start

Install:

npm install -g arduino-mcp-server

Add to Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "arduino": {
      "command": "npx",
      "args": ["-y", "arduino-mcp-server"],
      "env": {
        "ARDUINO_CLI_PATH": "arduino-cli",
        "ARDUINO_SKETCH_ROOT": "/path/to/your/sketches"
      }
    }
  }
}

Requires arduino-cli on your PATH, or let the server install it for you.


What you can say

Bootstrap from scratch:

"Check if Arduino CLI is installed and set everything up for an Arduino Uno."

Compile and upload:

"Compile my Blink sketch and upload it to the Uno on COM6."

Serial monitoring:

"Open serial on COM6 at 115200 and wait until the device prints READY."

Safety-first workflows:

"Run a safety preflight for an Arduino Uno with 5V on pin 13 at 25mA before I send commands."


Tools

ToolWhat it does
arduino_cli_doctorCheck Arduino CLI installation and version
install_arduino_cliGuide through arduino-cli installation
detect_hardwareDetect connected boards and infer FQBNs
list_connected_boardsList all connected Arduino boards
list_serial_portsList available serial ports
ensure_core_installedCheck/install board cores
compile_sketchCompile a sketch for a target board
upload_sketchUpload compiled sketch to a board
upload_and_wait_readyUpload and wait for device ready signal
serial_open_sessionOpen a stateful serial session
serial_readRead buffered serial data
serial_expectWait for a pattern in serial output
serial_writeSend data over serial
serial_close_sessionClose a serial session
serial_list_sessionsList active serial sessions
read_serial_snapshotQuick one-shot serial read
safety_preflightElectrical safety check before hardware ops
get_board_detailsGet pin/capability details for a board
list_supported_boardsList all boards arduino-cli supports
list_board_referenceBrowse board pin reference
search_board_referenceSearch board reference by keyword

Resources:

  • arduino://boards/reference — structured board pin/capability reference

Prompts:

  • arduino-cli-bootstrap-policy — policy for arduino-cli setup behavior
  • arduino-setup-assistant — guided Arduino environment setup

Safety preflight guardrails

safety_preflight (and the safetyContext passed to upload_sketch, upload_and_wait_ready, and serial_write) now also covers battery and ESP32-family pin footguns, driven by small, extensible data tables rather than hardcoded to any one board:

Battery charge-rate (C-rate) check — pass a battery object (capacityMah, chargeCurrentMa, chemistry) and the check computes chargeCurrentMa / batteryCapacityMah and flags it:

  • BATTERY_CRATE_UNSAFE (hard, blocking) above 1C
  • BATTERY_CRATE_CAUTION (soft, non-blocking) above 0.5C

Generic small LiPo cells are commonly rated for roughly a 0.5–1C safe charge current, so the message spells out the math, e.g. "380mA into a 100mAh cell is a 3.8C rate — well above the ~0.5-1C safe range for typical small LiPo cells; verify your cell's actual rated charge current before proceeding." If chargeCurrentMa is omitted, it's inferred from a small board → onboard-charge-IC lookup table (currently seeded with Seeed XIAO ESP32S3, XIAO ESP32S3 Sense, and XIAO ESP32C3 — see data/battery-charge-ic-reference.json, easy to extend with more boards). These are approximate, manufacturer-published figures — verify against the live datasheet/wiki for your exact board revision before trusting them in a production workflow.

Battery polarity confirmation — when battery.connecting: true (or any battery field is set) but battery.polarityConfirmed isn't explicitly true, the preflight blocks with BATTERY_POLARITY_UNCONFIRMED and a reminder to never assume BAT+/BAT- from wire color. On Seeed XIAO boards it cites the official convention: the negative pad is closest to the USB-C port, positive is farthest from it.

ESP32-family pin safety (table-driven per board via data/board-reference.json):

  • SPI-flash pins (GPIO6-11 on classic ESP32 WROOM/WROVER modules) — hard error (SPI_FLASH_PIN_USED); wiring these prevents boot.
  • Boot-strapping pins (GPIO0/2/12/15 on classic ESP32) — caution; usable at runtime but risky if externally held during boot/reset (existing check).
  • Input-only pins with no internal pull resistor (GPIO34-39 on classic ESP32) — caution (NO_INTERNAL_PULL_PIN); add an external pull-up/pull-down if using them as buttons/switches.
  • Seeed XIAO ESP32S3 — modeled with its 11 usable GPIO (D0-D10), default I2C on D4/D5, and an informational note surfaced whenever D6/D7 are wired: they're hardware UART1 TX/RX by default, but enabling "USB CDC on Boot" frees them as plain GPIO.

Board data for all of the above lives in JSON, keyed by board id/FQBN, so more boards can be added without touching guardrail logic.


Configuration

VariableDefaultDescription
ARDUINO_CLI_PATHarduino-cliPath to arduino-cli binary
ARDUINO_SKETCH_ROOT(none)Restrict sketch paths to this directory

Development

git clone https://github.com/hardware-mcp/arduino-mcp-server
cd arduino-mcp-server
npm install
npm run typecheck
npm test
npm run build
npm run dev

Part of HardwareMCP

This server is part of the HardwareMCP ecosystem — a collection of MCP servers that give AI assistants real control over physical hardware.


License

MIT — see LICENSE.

Support

Open an issue

Related MCP servers

Create, read and edit Excel workbooks without Microsoft Excel installation.

4.2k
Python
MIT
View repository →
DIDiavlos logo

Diavlos

Active

Signed messages between AI agents. Dangerous actions wait for a human-signed approval.

2
Rust
MIT
View repository →

Live Mercury outboard data and CAD quote builder from a Mercury Platinum Dealer in Ontario.

0
TypeScript
View repository →

Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.

View repository →
VIVisuals MCP logo

Visuals MCP

Maintained

MCP server for interactive visualizations: tables, images, trees, lists, master-detail

5
TypeScript
View repository →
TATaxBrainAI MCP logo

TaxBrainAI MCP

Maintained

8 offline Indian income-tax MCP tools: deterministic compute, regimes, citations, notices.

0
Python
MIT
View repository →