Arduino MCP Server

v0.2.8
io.github.hardware-mcp/arduino-mcp-server Checked 2 days ago Published 9 months ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_connected_boards List Connected Boards

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

arduino_cli_doctor Arduino CLI Doctor

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

install_arduino_cli Install Arduino CLI

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

ParameterTypeDescription
methodstringInstall method. Default `auto` tries OS-relevant methods in order.
setCliPathInProcessbooleanIf true (default), set ARDUINO_CLI_PATH in this MCP process after install.

list_supported_boards List Supported Boards

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

ParameterTypeDescription
searchstringOptional case-insensitive filter for name/FQBN.

ensure_core_installed Ensure Core Installed

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

ParameterTypeDescription
autoInstallbooleanIf true (default), install missing core automatically.
coreIdstringCore ID, e.g. arduino:avr.
fqbnstringBoard FQBN, e.g. arduino:avr:uno.

detect_hardware Detect Hardware

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

ParameterTypeDescription
includeBoardDetailsbooleanIf true, query `arduino-cli board details` for selected FQBN candidates.
portstringOptional exact port filter, e.g. COM6 or /dev/ttyACM0.

list_serial_ports List Serial Ports

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

compile_sketch Compile Sketch

Compile an Arduino sketch with a specific board FQBN.

ParameterTypeDescription
fqbn *stringBoard FQBN, e.g. arduino:avr:uno.
sketchPath *stringPath to sketch folder or .ino file.
autoInstallCorebooleanIf true (default), auto-install missing board core before compile.
buildPathstringOptional build output directory.
cleanbooleanIf true, clean build cache before compile.
exportBinariesbooleanIf true, export binaries into sketch folder.
warningsstring

upload_sketch Upload Sketch

Upload a compiled sketch to a connected board/port.

ParameterTypeDescription
port *stringSerial port path, e.g. COM6 or /dev/ttyACM0.
sketchPath *stringPath to sketch folder or .ino file.
autoInstallCorebooleanIf true (default), auto-install missing board core when fqbn is provided.
fqbnstringOptional board FQBN when auto-detect is insufficient.
safetyContextobjectOptional electrical context for preflight checks.
unsafeSkipPreflightbooleanIf true, bypasses safety_preflight checks. Use only when user explicitly accepts risk.
verifybooleanVerify uploaded binary when supported.

upload_and_wait_ready Upload And Wait Ready

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

ParameterTypeDescription
port *stringSerial port path, e.g. COM6 or /dev/ttyACM0.
sketchPath *stringPath to sketch folder or .ino file.
autoInstallCorebooleanIf true (default), auto-install missing board core when fqbn is provided.
fqbnstringOptional board FQBN when auto-detect is insufficient.
readyBaudRateintegerBaud rate for readiness check. Default 115200.
readyCaseSensitivebooleanIf true, readiness matching is case-sensitive.
readyPatternstringOptional serial text pattern to wait for after upload.
readyTimeoutMsintegerHow long to wait for readyPattern.
safetyContextobject
unsafeSkipPreflightbooleanIf true, bypasses safety_preflight checks. Use only when user explicitly accepts risk.
verifybooleanVerify uploaded binary when supported.

read_serial_snapshot Read Serial Snapshot

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

ParameterTypeDescription
port *stringSerial port path, e.g. COM6 or /dev/ttyACM0.
baudRateintegerBaud rate. Default: 9600.
durationMsintegerCapture duration in ms.

safety_preflight Safety Preflight

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

ParameterTypeDescription
boardstringBoard name/id (preferred when known).
fqbnstringBoard FQBN when known.
portstringOptional port for automatic board inference.
powerobject
wiringarray

serial_open_session Serial Open Session

Open a stateful serial monitor session with port lock ownership.

ParameterTypeDescription
port *stringSerial port path, e.g. COM6 or /dev/ttyACM0.
baudRateintegerBaud rate. Default: 9600.
maxBufferBytesintegerMax in-memory receive buffer.
ttlMsintegerSession lease TTL in ms.

serial_list_sessions Serial List Sessions

List active serial sessions and current port lock state.

serial_read Serial Read

Read buffered bytes from an open serial session.

ParameterTypeDescription
sessionId *string
encodingstringOutput encoding. Default: utf8.
fromOffsetintegerRead offset cursor. Defaults to current buffer start.
maxBytesintegerMaximum bytes to return.

serial_expect Serial Expect

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

ParameterTypeDescription
pattern *string
sessionId *string
caseSensitiveboolean
fromOffsetintegerOptional explicit cursor offset.
timeoutMsinteger

serial_write Serial Write

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

ParameterTypeDescription
data *stringPayload to send.
sessionId *string
encodingstringPayload encoding. Default: utf8.
lineEndingstringOptional line ending append.
safetyContextobject
unsafeSkipPreflightbooleanIf true, bypasses safety_preflight checks. Use only with explicit user acceptance.

serial_close_session Serial Close Session

Close a serial session and release its port lock.

ParameterTypeDescription
sessionId *string

get_board_details Get Board Details

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

ParameterTypeDescription
fqbn *stringBoard FQBN, e.g. arduino:avr:uno.

list_board_reference List Board Reference

List local board reference entries with pin/spec metadata.

search_board_reference Search Board Reference

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

ParameterTypeDescription
query *string