arduino-claude-mcp
Provides tools for reading, writing, listing source files, and building Arduino sketches using the Arduino CLI.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@arduino-claude-mcpRead the main .ino file and list all sources."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
arduino-claude-mcp
MCP server for Arduino IDE 2.0 sketches. It exposes a small REST API plus an MCP stdio bridge so agents can read and write the main .ino file, list sources, and optionally compile with arduino-cli.
Features
Validate an Arduino sketch folder
Read and write source files (defaults to main
.ino)List .ino/.h/.cpp/.c files
Compile with
arduino-cli(optional)REST + MCP stdio transport
Related MCP server: MCP Agent Operations
Requirements
An Arduino sketch folder (Arduino IDE 2.0 format)
Node.js 18+
Optional:
arduino-clifor builds
Installation
Global install:
npm install -g arduino-claude-mcpLocal dev:
npm install
npm run build
npm run build:mcpContainer image:
docker pull eoinedge/arduino-mcp:latestUsage
Run the REST server
arduino-claude-mcpDefaults to port 3080. Override with:
$env:PORT=3081
arduino-claude-mcpRun with Docker (Pi/OpenClaw)
docker run --rm --network host \
-e PORT=3080 \
-e ARDUINO_FQBN=arduino:mbed_nano:nano33ble \
-v /home/pi/pi-openclaw-mcp-stack/workspace/Arduino:/workspace \
eoinedge/arduino-mcp:latestRun the MCP stdio server
node build/mcp.jsIf your REST server is not on the default port, set one of:
ARDUINO_API_URL(full URL, for examplehttp://localhost:3081)ARDUINO_API_PORT(port only, for example3081)
MCP client config
{
"mcpServers": {
"arduino-mcp": {
"command": "node",
"args": ["/absolute/path/to/build/mcp.js"]
}
}
}Tutorial (10 minutes)
Create a sketch folder whose main
.inomatches the folder name.Validate it:
POST /validateBody:
{ "projectRoot": "/path/to/MySketch" }
Read the main sketch:
POST /read_sourceBody:
{ "projectRoot": "/path/to/MySketch" }
Write a small change:
POST /write_sourceBody:
{ "projectRoot": "/path/to/MySketch", "content": "// your code" }
Build (optional):
Set
ARDUINO_FQBN(examplearduino:avr:uno)POST /buildBody:
{ "projectRoot": "/path/to/MySketch" }
Environment variables
PORT: REST server port (default3080)ARDUINO_API_URL: REST base URL for the MCP bridgeARDUINO_API_PORT: REST port for the MCP bridgeARDUINO_CLI: arduino-cli executable (defaultarduino-cli)ARDUINO_FQBN: fully qualified board name for compileARDUINO_BUILD_TIMEOUT_MS: build timeout in ms (default120000)
REST API
Health
GET /health->{ status: "ok" }
Validate
POST /validatebody:{ projectRoot: string }Returns
{ valid, inoPath, projectRoot }
List sources
POST /list_sourcesbody:{ projectRoot: string }Returns
{ files: string[] }
Read source
POST /read_sourcebody:{ projectRoot: string, relativePath?: string }Returns
{ path, content }
Write source
POST /write_sourcebody:{ projectRoot: string, relativePath?: string, content: string }Returns
{ success, path, bytes }
Append source
POST /append_sourcebody:{ projectRoot: string, relativePath?: string, content: string }Returns
{ success, path, bytes }
Build
POST /buildbody:{ projectRoot: string, timeoutMs?: number }Returns
{ success, exitCode, stdout, stderr }Requires
arduino-cliandARDUINO_FQBN
Clawdbot / Moltbot compatibility
This repo ships a skill at skills/arduino-mcp/SKILL.md.
Enable it in Moltbot:
{
"skills": {
"load": {
"extraDirs": ["~/.clawdbot/skills"],
"watch": true,
"watchDebounceMs": 250
},
"entries": {
"arduino-mcp": {
"enabled": true,
"env": {}
}
}
}
}Example prompts
"Open this Arduino sketch and add a blinking LED on pin 13."
"List all source files and explain what each does."
"Append a serial debug line and recompile for an Uno board."
Testing
npm testTests use a temporary sketch folder and do not require arduino-cli.
Publishing
Update
package.jsonversionBuild:
npm run build npm run build:mcpPublish:
npm publish --access publicTag and push to trigger
.github/workflows/publish.yml
Docker publishing
Manual push:
docker login
docker buildx build --platform linux/amd64,linux/arm64 \
-t eoinedge/arduino-mcp:latest \
-t eoinedge/arduino-mcp:<version> \
--push .GitHub Actions:
docker-publish.ymlpushes Docker images onmainand version tags.Required repo secrets:
DOCKERHUB_USERNAMEDOCKERHUB_TOKEN
Project structure
src/index.tsREST APIsrc/mcp.tsMCP stdio bridgeskills/arduino-mcp/SKILL.mdagent skillserver.jsonMCP registry metadata
Contributing
PRs welcome. Please keep changes small and include tests where possible.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
The official MCP Server from Mia-Platform to interact with Mia-Platform Console
Related MCP Servers
- AlicenseCqualityDmaintenanceA comprehensive Model Context Protocol (MCP) server for Arduino CLI interactions, built with FastMCP. This server enables AI agents to seamlessly interact with Arduino CLI for development, debugging, code verification, and more.162MIT
- FlicenseBqualityAmaintenancemcp-agent-ops is a local stdio MCP server for deterministic agent-development operations that otherwise cause repeated shell and generated Python calls.25-
- FlicenseNot gradedqualityAmaintenanceA fully local MCP server for Mixly that lets AI clients discover boards, scan blocks, build/validate/open projects, generate code, and compile via Arduino CLI—all without uploading source or relying on a remote server.3-
- 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-