Arduino-MCP
by warusakudeveroper
Overview
Automates ESP32 development workflows including compiling, uploading, serial monitoring, pin analysis, and SPIFFS file management via an MCP stdio server.
Installation
npx mcp-arduino-esp32Environment Variables
- ESP32_FQBN
- ARDUINO_CLI
- MCP_PYTHON
- MCP_CORS_ORIGIN
- MCP_LOG_LEVEL
Security Notes
The primary Node.js server uses input validation (Zod) and path sanitization (`resolveSafePath`) which mitigate common server-side risks. However, critical vulnerabilities exist within the associated `ArduinoMCP` ESP32 firmware library and its usage examples: 1. **ESP32 Firmware Path Traversal**: The `ArduinoMCP` library's SPIFFS API endpoints (`/api/spiffs/list`, `/api/spiffs/read`, `/api/spiffs/write`, `/api/spiffs/delete`) directly use user-provided `path` arguments in `SPIFFS.open`, `SPIFFS.remove`, and `file.print` operations without apparent sanitization against path traversal (e.g., `../`). This creates a critical vulnerability on the ESP32 device itself, allowing an attacker to read, write, or delete arbitrary files on the SPIFFS partition. 2. **Hardcoded Credentials in Example Sketch**: The `mercury_net_diag/settingManager.cpp` file, part of an example sketch, contains multiple hardcoded WiFi SSIDs and passwords (`mainSSID`, `mainPass`, `altSSID`, `altPass`, `devSSID`, `devPass`). Deploying this sketch or similar code with sensitive information hardcoded poses a significant security risk. 3. **Default Lax CORS Policy**: The Console Server's API defaults `MCP_CORS_ORIGIN` to `*`, making it accessible from any origin. This is a security concern if the console server is exposed to an untrusted network. 4. **Unrobust JSON Parsing (ESP32 Sketch)**: The `settingManager.cpp` uses a simplistic string-based JSON parser (`fromJson`) which is prone to errors with malformed JSON and could lead to unexpected behavior or data corruption on the device, though not directly to code execution.
Similar Servers
xiaozhi-esp32-server-java
Provides backend support and a management platform for smart hardware devices, focusing on AI-powered voice interaction, device management, and IoT control.
tinystruct-mcp
A modular Java server providing a JSON-RPC interface for file system and Git/GitHub operations, aimed at automation and DevOps workflows.
singular-blockly
An MCP (Model Context Protocol) server for the Singular Blockly VSCode extension, providing tools for querying Blockly block definitions, platform configurations (Arduino/ESP32), workspace states, and facilitating code generation and embedded device programming in an educational context.
mcp-devcontainers
Provides a Model Context Protocol (MCP) server for integrating with and managing devcontainer environments via the devcontainers CLI.