Skip to main content
Glama

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


Related MCP server: Arduino MCP Server (Simple)

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

Tool

What it does

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

search_board_reference

Search 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


Configuration

Variable

Default

Description

ARDUINO_CLI_PATH

arduino-cli

Path 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 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

Available Tools

21 tools
arduino_cli_doctorArduino CLI DoctorA
Read-only

Check whether arduino-cli is available and return OS-specific installation instructions if missing.

Inputs: no named parameters. Returns: ok, raw, data, note, +9 more

compile_sketchCompile SketchA
DestructiveIdempotent

Compile an Arduino sketch with a specific board FQBN.

Inputs: fqbn (required), sketchPath (required), clean, warnings, +3 more. Returns: ok, raw, data, note, +9 more

detect_hardwareDetect HardwareB
Read-only

Detect connected Arduino-compatible hardware, infer board/FQBN candidates, and generate next compile/upload commands.

Inputs: port, includeBoardDetails. Returns: ok, raw, data, note, +9 more

ensure_core_installedEnsure Core InstalledA
DestructiveIdempotent

Ensure the Arduino core required by a board FQBN is installed. Can auto-install via arduino-cli core install.

Inputs: fqbn, coreId, autoInstall. Returns: ok, raw, data, note, +9 more

get_board_detailsGet Board DetailsA
Read-only

Get detailed board metadata from arduino-cli for a specific FQBN.

Inputs: fqbn (required). Returns: ok, raw, data, note, +9 more

install_arduino_cliInstall Arduino CLIA
DestructiveIdempotent

Attempt to install arduino-cli for the current OS using available package managers, then verify and configure CLI path.

Inputs: method, setCliPathInProcess. Returns: ok, raw, data, note, +9 more

list_board_referenceList Board ReferenceA
Read-only

List local board reference entries with pin/spec metadata.

Inputs: no named parameters. Returns: ok, raw, data, note, +9 more

list_connected_boardsList Connected BoardsA
Read-only

List connected boards and serial ports detected by arduino-cli.

Inputs: no named parameters. Returns: ok, raw, data, note, +9 more

list_serial_portsList Serial PortsA
Read-only

List serial ports and any detected board metadata using arduino-cli. Works on Windows/macOS/Linux.

Inputs: no named parameters. Returns: ok, raw, data, note, +9 more

list_supported_boardsList Supported BoardsA
Read-only

List supported/installable boards from the local arduino-cli index.

Inputs: search. Returns: ok, raw, data, note, +9 more

read_serial_snapshotRead Serial SnapshotB
Read-only

Capture serial output for a bounded duration from a given port.

Inputs: port (required), baudRate, durationMs. Returns: ok, raw, data, note, +9 more

safety_preflightSafety PreflightA
Read-only

Run electrical preflight checks (voltage/current/pin risks) before upload or serial write operations.

Inputs: fqbn, port, board, power, +1 more. Returns: ok, raw, data, note, +9 more

search_board_referenceSearch Board ReferenceA
Read-only

Search local board reference by board name, alias, id, or FQBN.

Inputs: query (required). Returns: ok, raw, data, note, +9 more

serial_close_sessionSerial Close SessionA
DestructiveIdempotent

Close a serial session and release its port lock.

Inputs: sessionId (required). Returns: ok, raw, data, note, +9 more

serial_expectSerial ExpectA
Read-only

Wait for a string pattern in a serial session buffer with timeout.

Inputs: pattern (required), sessionId (required), timeoutMs, fromOffset, +1 more. Returns: ok, raw, data, note, +9 more

serial_list_sessionsSerial List SessionsA
Read-only

List active serial sessions and current port lock state.

Inputs: no named parameters. Returns: ok, raw, data, note, +9 more

serial_open_sessionSerial Open SessionA
Destructive

Open a stateful serial monitor session with port lock ownership.

Inputs: port (required), ttlMs, baudRate, maxBufferBytes. Returns: ok, raw, data, note, +9 more

serial_readSerial ReadA
Read-only

Read buffered bytes from an open serial session.

Inputs: sessionId (required), encoding, maxBytes, fromOffset. Returns: ok, raw, data, note, +9 more

serial_writeSerial WriteA
Destructive

Write bytes to an open serial session. Safety preflight is enforced unless explicitly skipped.

Inputs: data (required), sessionId (required), encoding, lineEnding, +2 more. Returns: ok, raw, data, note, +9 more

upload_and_wait_readyUpload And Wait ReadyA
Destructive

Upload a sketch and wait for a serial readiness pattern, handling post-upload reset/re-enumeration windows.

Inputs: port (required), sketchPath (required), fqbn, verify, +7 more. Returns: ok, raw, data, note, +9 more

upload_sketchUpload SketchB
DestructiveIdempotent

Upload a compiled sketch to a connected board/port.

Inputs: port (required), sketchPath (required), fqbn, verify, +3 more. Returns: ok, raw, data, note, +9 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 21 tools

    Disambiguation3/5

    Several tools cluster around board/port discovery (list_connected_boards, list_serial_ports, detect_hardware) and serial reading (serial_read, read_serial_snapshot), so an agent could select the wrong one without careful description reading. Most other tools have clear resource-action targets, but these near-duplicates lower the boundary clarity.

    Naming Consistency4/5

    Names are consistently snake_case and mostly verb_noun (list_*, install_*, compile_*, upload_*). The serial_* prefix group is internally consistent, but read_serial_snapshot and upload_and_wait_ready deviate from the dominant pattern.

    Tool Count3/5

    At 21 tools the server sits in the heavy 16-25 band, but the broad scope of Arduino CLI management, board detection, compile/upload, and serial sessions gives most tools a purpose. It is slightly over the ideal compact size but not excessive.

    Completeness4/5

    The workflow from CLI setup, board detection, core installation, compile, upload, and serial interaction is well covered, including safety preflight. Notable gaps are library management (search/install) and core uninstall/removal, but agents can complete core Arduino tasks without them.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Arduino development through arduino-cli, allowing sketch management, code compilation and uploading, library and board operations, serial monitoring, and AI-powered circuit diagram generation using WireViz.
      32 PyPI
      10
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      A local stdio MCP server wrapping arduino-cli to let agents detect boards, manage cores/libraries, compile and upload sketches, and communicate over serial, enabling hardware control without shell gymnastics.
      17
      -