Arduino MCP Server
arduino-mcp-server
AIアシスタントにArduinoの完全な制御を提供します — コンパイル、アップロード、シリアルモニタ、配線の安全性確認を、すべて自然言語で行えます。
HardwareMCP エコシステムの一部です — AIと物理ハードウェアを橋渡しするオープンソースのMCPサーバー群です。
これは何をするか
AIアシスタントはJira、GitHub、データベースを制御できます。しかし、マイクロコントローラーと話すことはできませんでした — 今までは。
arduino-mcp-server は arduino-cli をMCPサーバーにラップし、AIが以下のことを可能にします:
検出 接続されたボードとポートを自動的に検出
コンパイルとアップロード ターミナルに触れずにスケッチをコンパイルおよびアップロード
シリアル出力のモニタリング ステートフルセッション(open、read、expect、write、close)を使用
電気安全チェック ハードウェアにコマンドを送信する前に実行
依存関係の管理 — コア、ライブラリ、CLIのインストール
Related MCP server: Arduino MCP Server (Simple)
クイックスタート
インストール:
npm install -g arduino-mcp-serverClaude 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"
}
}
}
}arduino-cli がPATHに存在する必要があります。または、サーバーにインストールさせることもできます。
何を言えるか
ゼロからのブートストラップ:
"Arduino CLIがインストールされているか確認し、Arduino Uno用にすべてをセットアップしてください。"
コンパイルとアップロード:
"Blinkスケッチをコンパイルして、COM6のUnoにアップロードしてください。"
シリアルモニタリング:
"COM6でシリアルを115200で開き、デバイスがREADYと出力するまで待ってください。"
安全性優先のワークフロー:
"コマンドを送信する前に、ピン13に5V、25mAのArduino Unoの安全プリフライトを実行してください。"
ツール
ツール | 説明 |
| Arduino CLIのインストールとバージョンを確認 |
| arduino-cliのインストールを案内 |
| 接続されたボードを検出し、FQBNを推測 |
| 接続されているすべてのArduinoボードを一覧表示 |
| 利用可能なシリアルポートを一覧表示 |
| ボードコアの確認/インストール |
| 対象ボード用にスケッチをコンパイル |
| コンパイル済みスケッチをボードにアップロード |
| アップロードしてデバイスの準備完了信号を待つ |
| ステートフルなシリアルセッションを開く |
| バッファされたシリアルデータを読み取る |
| シリアル出力でパターンを待つ |
| シリアルでデータを送信 |
| シリアルセッションを閉じる |
| アクティブなシリアルセッションを一覧表示 |
| クイックなワンショットシリアル読み取り |
| ハードウェア操作前の電気安全チェック |
| ボードのピン/機能詳細を取得 |
| arduino-cliがサポートするすべてのボードを一覧表示 |
| ボードのピンリファレンスを閲覧 |
| キーワードでボードリファレンスを検索 |
リソース:
arduino://boards/reference— 構造化されたボードのピン/機能リファレンス
プロンプト:
arduino-cli-bootstrap-policy— arduino-cliセットアップ動作のポリシーarduino-setup-assistant— ガイド付きArduino環境セットアップ
設定
変数 | デフォルト | 説明 |
|
| arduino-cliバイナリへのパス |
| (なし) | スケッチのパスをこのディレクトリに制限 |
開発
git clone https://github.com/hardware-mcp/arduino-mcp-server
cd arduino-mcp-server
npm install
npm run typecheck
npm run build
npm run devHardwareMCPの一部
このサーバーは HardwareMCP エコシステムの一部です — AIアシスタントに物理ハードウェアの実際の制御を提供するMCPサーバーのコレクションです。
ライセンス
MIT — LICENSE を参照してください。
サポート
Available Tools
21 toolsarduino_cli_doctorArduino CLI DoctorARead-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 SketchADestructiveIdempotent
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 HardwareBRead-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 InstalledADestructiveIdempotent
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 DetailsARead-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 CLIADestructiveIdempotent
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 ReferenceARead-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 BoardsARead-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 PortsARead-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 BoardsARead-only
List supported/installable boards from the local arduino-cli index.
Inputs: search. Returns: ok, raw, data, note, +9 more
read_serial_snapshotRead Serial SnapshotBRead-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 PreflightARead-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 ReferenceARead-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 SessionADestructiveIdempotent
Close a serial session and release its port lock.
Inputs: sessionId (required). Returns: ok, raw, data, note, +9 more
serial_expectSerial ExpectARead-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 SessionsARead-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 SessionADestructive
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 ReadARead-only
Read buffered bytes from an open serial session.
Inputs: sessionId (required), encoding, maxBytes, fromOffset. Returns: ok, raw, data, note, +9 more
serial_writeSerial WriteADestructive
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 ReadyADestructive
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 SketchBDestructiveIdempotent
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
Scored across 21 tools
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.
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.
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.
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
Related MCP Connectors
Build, validate, test-run and publish AIOS workflows from Claude Code, Codex, Cursor or VS Code.
Check GitHub Actions workflows live: retired actions, bad inputs, injection. Pin actions to SHAs.
Checks AI-written code for leaked keys and made-up packages, on your machine. Never uploads code.
Build, check and open Arduino, ESP32 and Pico circuits with code in the Mokxi simulator.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables 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 PyPI10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Arduino boards for compiling, uploading sketches, and serial communication.6MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to compile, upload, and monitor Arduino boards via natural language, with electrical safety checks and dependency management.21252 npm26MIT
- FlicenseAqualityCmaintenanceA 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-