arduino-mcp-server logo

arduino-mcp-server

Organization
hardware-mcp

An open source Arduino MCP server that enables AI assistants to interact with Arduino using structured tool access via the Model Context Protocol.

Publisherhardware-mcp
Repositoryarduino-mcp-server
LanguageJavaScript
Forks
2
Stars
19
Available tools
21
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    arduino-mcp-server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 21 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    19 stars and 2 forks from the linked 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:

bash
npm install -g arduino-mcp-server

Add to Claude Desktop (claude_desktop_config.json):

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

bash
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

Installation

TypingMind
{
  "mcpServers": {
    "arduino-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "arduino-mcp-server"
      ]
    }
  }
}

Available Tools

  • 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.

Use arduino-mcp-server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once arduino-mcp-server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add arduino-mcp-server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the arduino-mcp-server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "arduino-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "arduino-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the arduino-mcp-server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the arduino-mcp-server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use arduino-mcp-server to help me with this task?
arduino-mcp-server
Sure. I read it.
Here is what I found using arduino-mcp-server.

Frequently asked questions

What is the arduino-mcp-server MCP server used for?

arduino-mcp-server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use arduino-mcp-server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use arduino-mcp-server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use arduino-mcp-server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With arduino-mcp-server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect arduino-mcp-server MCP to TypingMind?

arduino-mcp-server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does arduino-mcp-server MCP provide in TypingMind?

arduino-mcp-server exposes 21 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use arduino-mcp-server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If arduino-mcp-server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

arduino-board-reference

Static board pin/reference metadata for supported boards in this server.

arduino-cli-bootstrap-policy

Strict setup policy for agents when Arduino CLI is missing.

arduino-setup-assistant

Prompt template for wiring/setup guidance based on board + sensor.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇