Arduino MCP Server — Claude Code 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.
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-serverWhat Arduino MCP Server 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.
What it helps with
- 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 for the agent
- Check whether
arduino-cliis ready, set up an Arduino Uno environment, and detect the connected board. - Compile the
Blinksketch and upload it to the Arduino Uno on the detected port. - Open Serial at
115200, wait forREADY, and run the hardware safety check before sending data.
How to install Arduino MCP Server
Platform CLI
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-serverReplace <…> with your own values
Platform CLI
codex mcp add arduino-mcp-server --env ARDUINO_CLI_PATH=<ARDUINO_CLI_PATH> --env ARDUINO_SKETCH_ROOT=<ARDUINO_SKETCH_ROOT> -- npx -y arduino-mcp-serverReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
gemini mcp add -e ARDUINO_CLI_PATH=<ARDUINO_CLI_PATH> -e ARDUINO_SKETCH_ROOT=<ARDUINO_SKETCH_ROOT> arduino-mcp-server npx -y arduino-mcp-serverReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Arduino MCP Server
How do I install Arduino MCP Server in Claude Code?
Run claude mcp add arduino-mcp-server -- npx -y arduino-mcp-server.
What does Arduino MCP Server do?
It gives an agent MCP tools for board detection, sketch compilation and upload, Serial sessions, pin references, and electrical safety checks.
What does Arduino MCP Server require?
It requires Node.js 20+ and arduino-cli on PATH, or a path supplied through ARDUINO_CLI_PATH. Use ARDUINO_SKETCH_ROOT to limit sketch directories.