# Arduino MCP Server

This MCP server lets an AI agent detect Arduino boards, build and upload sketches, inspect Serial output, and check wiring risks before hardware actions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 23
- Author: hardware-mcp
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hardware-mcp/arduino-mcp-server
- Updated: 2026-08-22
- HTML: https://affpapa.org/en/nevibecode/mcp/arduino-mcp-server

## What it does

Arduino MCP Server exposes `arduino-cli` through MCP tools. An agent can find connected boards and ports, check or install board cores, compile a sketch, upload it, and wait for a ready signal. Serial work uses sessions that support opening, reading buffered data, waiting for a pattern, writing, and closing.

The server also provides board pin references and runs `safety_preflight` before hardware operations. Its checks cover ESP32 flash and boot pins, input-only pins without internal pull resistors, and battery charge settings. The setup needs `arduino-cli` on `PATH`, unless the server installs it or you set `ARDUINO_CLI_PATH`.

Set `ARDUINO_SKETCH_ROOT` to restrict sketch locations. The package requires Node.js 20+ and can be added to Claude Code with `npx`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `ARDUINO_CLI_PATH`, `ARDUINO_SKETCH_ROOT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env ARDUINO_CLI_PATH=<ARDUINO_CLI_PATH> --env ARDUINO_SKETCH_ROOT=<ARDUINO_SKETCH_ROOT> --transport stdio arduino-mcp-server -- npx -y arduino-mcp-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add arduino-mcp-server --env ARDUINO_CLI_PATH=<ARDUINO_CLI_PATH> --env ARDUINO_SKETCH_ROOT=<ARDUINO_SKETCH_ROOT> -- npx -y arduino-mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "arduino-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "arduino-mcp-server"
            ],
            "env": {
                "ARDUINO_CLI_PATH": "<ARDUINO_CLI_PATH>",
                "ARDUINO_SKETCH_ROOT": "<ARDUINO_SKETCH_ROOT>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "arduino-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "arduino-mcp-server"
            ],
            "env": {
                "ARDUINO_CLI_PATH": "<ARDUINO_CLI_PATH>",
                "ARDUINO_SKETCH_ROOT": "<ARDUINO_SKETCH_ROOT>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ARDUINO_CLI_PATH=<ARDUINO_CLI_PATH> -e ARDUINO_SKETCH_ROOT=<ARDUINO_SKETCH_ROOT> arduino-mcp-server npx -y arduino-mcp-server
```
Replace <…> with your own values

## When to use it
- find a connected Arduino board and serial port
- compile a sketch for a selected board
- upload firmware from an agent session
- watch Serial output until a device signal appears
- check pins and battery settings before hardware commands

## Example prompts
- Check whether `arduino-cli` is ready, set up an Arduino Uno environment, and detect the connected board.
- Compile the `Blink` sketch and upload it to the Arduino Uno on the detected port.
- Open Serial at `115200`, wait for `READY`, and run the hardware safety check before sending data.

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13169
- [Inbox Zero](https://affpapa.org/en/nevibecode/mcp/inbox-zero.md) — MCP server · ★ 12791

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
