# Arduino MCP Server [Health: Active]

**Category:** 📟 Embedded System  
**Repository:** https://github.com/hardware-mcp/arduino-mcp-server  
**GitHub Stars:** 23  
**npm Downloads (last month):** 462  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/arduino-mcp-server-2

## Description
Arduino MCP server for CLI setup, board detection, compile/upload, serial monitoring, and pin refs.

## Tools
Capabilities this server exposes over MCP:

- **list_connected_boards** — List connected boards and serial ports detected by arduino-cli.
- **arduino_cli_doctor** — Check whether arduino-cli is available and return OS-specific installation instructions if missing.
- **install_arduino_cli** — Attempt to install arduino-cli for the current OS using available package managers, then verify and configure CLI path.
- **list_supported_boards** — List supported/installable boards from the local arduino-cli index.
- **ensure_core_installed** — Ensure the Arduino core required by a board FQBN is installed. Can auto-install via `arduino-cli core install`.
- **detect_hardware** — Detect connected Arduino-compatible hardware, infer board/FQBN candidates, and generate next compile/upload commands.
- **list_serial_ports** — List serial ports and any detected board metadata using arduino-cli. Works on Windows/macOS/Linux.
- **compile_sketch** — Compile an Arduino sketch with a specific board FQBN.
- **upload_sketch** — Upload a compiled sketch to a connected board/port.
- **upload_and_wait_ready** — Upload a sketch and wait for a serial readiness pattern, handling post-upload reset/re-enumeration windows.
- **read_serial_snapshot** — Capture serial output for a bounded duration from a given port.
- **safety_preflight** — Run electrical preflight checks (voltage/current/pin risks) before upload or serial write operations.
- **serial_open_session** — Open a stateful serial monitor session with port lock ownership.
- **serial_list_sessions** — List active serial sessions and current port lock state.
- **serial_read** — Read buffered bytes from an open serial session.
- **serial_expect** — Wait for a string pattern in a serial session buffer with timeout.
- **serial_write** — Write bytes to an open serial session. Safety preflight is enforced unless explicitly skipped.
- **serial_close_session** — Close a serial session and release its port lock.
- **get_board_details** — Get detailed board metadata from arduino-cli for a specific FQBN.
- **list_board_reference** — List local board reference entries with pin/spec metadata.
- **search_board_reference** — Search local board reference by board name, alias, id, or FQBN.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "arduino-mcp-server": {
    "command": "npx",
    "args": ["-y","arduino-mcp-server"],
    "env": {
      "ARDUINO_CLI_PATH": "",
      "ARDUINO_SKETCH_ROOT": ""
    }
  }
}
```

**Requires environment variables:** `ARDUINO_CLI_PATH`, `ARDUINO_SKETCH_ROOT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Arduino MCP Server MCP server does

Arduino MCP Server MCP server connects an MCP-compatible AI client to Arduino hardware through `arduino-cli`. It covers the workflow from environment checks through deployment and device communication:

- Verify the installed Arduino CLI and guide its installation.
- Find connected boards, serial ports, and likely fully qualified board names (FQBNs).
- Check or install the core required by a target board.
- Compile sketches and upload them to a selected device.
- Open serial sessions, read buffered output, wait for matching text, send data, and close sessions.
- Inspect supported boards, board details, pin capabilities, and searchable board references.

The server also provides an `arduino://boards/reference` resource and setup-oriented prompts for Arduino CLI bootstrapping and environment configuration.

## How it works

The server wraps Arduino CLI commands and exposes them as MCP tools. An AI client can first inspect the local environment, identify a connected board, and determine its port or FQBN. It can then prepare the required core, compile a sketch, and upload it.

For device interaction, stateful serial sessions preserve an open connection across separate read, expect, and write operations. A one-shot serial snapshot is available when a persistent session is unnecessary. The upload-and-wait workflow can pause until the device reports its ready signal.

Safety checks can run before hardware operations. `safety_preflight`, along with safety context supplied to uploads and serial writes, evaluates electrical details such as voltage and current. The documented checks include battery charge rate and polarity, classic ESP32 flash and boot pins, input-only pins without internal pull resistors, and board-specific details for Seeed XIAO ESP32S3 pins.

## Setup and configuration

Install the package globally with npm or run it through `npx` from an MCP client configuration. The documented runtime requires Node.js 20 or newer. Arduino CLI must be available on the system path unless the server installs or guides its installation.

Configuration supports these environment variables:

- `ARDUINO_CLI_PATH` selects the Arduino CLI executable and defaults to `arduino-cli`.
- `ARDUINO_SKETCH_ROOT` optionally restricts sketch paths to a specified directory.

Source development uses npm installation followed by type checking, tests, build, or development commands.

## Tools and capabilities

The tool set supports both discovery and execution. Hardware discovery includes connected-board listing, serial-port listing, automatic detection, board detail lookup, and a catalog of boards supported by Arduino CLI. Reference tools expose pin and capability information and allow keyword searches.

Build and deployment tools compile sketches, upload them, or upload while waiting for a readiness message. Serial tools provide session creation, buffered reads, pattern matching, writes, session listing, and closure. The safety preflight is table-driven for the documented board data, so its checks can distinguish blocking conditions from cautions.

Use Arduino MCP Server MCP server when an agent needs to coordinate board setup, firmware deployment, and serial verification without switching manually between an AI client and Arduino CLI. It is intended for connected hardware workflows, so the target board, port, sketch, and electrical context still need to be identified correctly.

_Full upstream README: https://allmcps.com/mcp/arduino-mcp-server-2/readme_

